-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add
operations are forced to receive a client-side ID due to Knex + MySQL limitations
#260
Comments
I took a look into this issue (mostly because I hate the warnings in the console every time I run the tests).
The problem here is that... this is tricky grounds:
|
@isBatak do you happen to know if using Prisma would help us to fix this problem? |
@joelalejandro I'm not an expert but
|
So... checking back into this, I found an update that relates to the issue: So... soon, the only engine that doesn't support returning will be MySQL. The main issue that we face regarding this, is that any implementation would probably involve creating a transaction, that effectively creates an object, and then pulls the latest data up (something like this). Doing this outside a transaction is a no-go, because AFAIK that's the only way to ensure the atomicity of the operation. |
I like the transaction-based approach. I wonder if it would affect the ability to rollback bulk operations. |
So, SQLite 3.36 is out, and the PR mentioned by @spersico is now merged. We're waiting on a driver upgrade, but we'll also need to upgrade Knex to remove the I've opened an issue here: knex/knex#4766 |
This continues to happen with MySQL, unfortunately. I've implemented #354 to avoid having a failing response pipeline. At least client-side ID'ed insertions will work. But we'll need a last_inserted_id strategy for this. |
Due to knex/knex#2682,
add
operations in MySQL require anid
to be passed, otherwise Kurier won't return the resource ID on the result of the operation.kurier/src/processors/knex-processor.ts
Line 163 in 28c25e3
This
insert
+RETURNING
syntax works only on engines such as PostgreSQL or Oracle.The text was updated successfully, but these errors were encountered: