AnyhowStep
AnyhowStep
Related, https://github.com/AnyhowStep/tsql/issues/154
I would **really** want to be able to defer the call to `.groupBy()`, and then check that the GROUP BY columns cover the columns used by non-aggregate expressions in the...
First thing we need to do is change the typedef for `OrderByClause`. Right now, it is, ```ts export type OrderByClause = readonly Order[]; ``` We need something like, ```ts export...
```sql SELECT PI() = 3.14159265358979, 3.14159265358979 = PI(), PI() = 3.141592653589793, 3.141592653589793 = PI(), 3.14159265358979 = 3.141592653589793, 3.141592653589793 = 3.14159265358979, PI(), 3.14159265358979, 3.141592653589793, (PI()+0e0) = 3.14159265358979, 3.14159265358979 = (PI()+0e0), (PI()+0e0)...
WHY MYSQL WHY
Basically, for multi inserts, | Database | Result | |---|---| |MySQL|FIrst insert id| |PostgreSQL|Last insert id| |SQLite|Last insert id| As usual, MySQL fucks everything up. ---- How the hell is...
Potential workaround: start a transaction, perform multi-insert/replace, get `MAX(autoIncrementId)`. But you have to know that you did not insert/replace zero rows. If it's one row, you can use `LAST_INSERT_ID()` just...
Unrelated to multi-insert. This is setting an explicit value for the auto-increment column. MySQL, ```sql INSERT INTO myTable(myId, myColumn) VALUES (999, 6); SELECT LAST_INSERT_ID(); ``` PostgreSQL, ```sql INSERT INTO myTable(myId,...
We have the following possibilities, ----- + `insertOne()` + `insertMany()` - Inserts zero rows + `insertMany()` - Inserts one row + `insertMany()` - Inserts many rows + `insertSelect()` - inserts...
+ `insertMany()` - Inserts many rows + Table has autoIncrement, autoIncrement is specified How to get `lastInsertId`, + Use ??? on MySQL + Use ??? on PostgreSQL; or `RETURNING` clause...