Skip to content
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

[SQLite] Support .returning in the latest SQLite #4370

Closed
umaar opened this issue Mar 13, 2021 · 8 comments · Fixed by #5285
Closed

[SQLite] Support .returning in the latest SQLite #4370

umaar opened this issue Mar 13, 2021 · 8 comments · Fixed by #5285
Labels

Comments

@umaar
Copy link

umaar commented Mar 13, 2021

.returning() doesn't work on SQLite, however it looks like their latest version does support it now: https://nalgeon.github.io/sqlite-3-35/

Any chance of getting this working in Knex? Thanks

@kibertoad
Copy link
Collaborator

kibertoad commented Mar 13, 2021

@umaar We depend on node-sqlite driver for that, which is only on 3.32.3 for now (https://github.com/mapbox/node-sqlite3/releases/tag/v5.0.1).
As soon as updated version of driver is released, we'll check if any changes on our end will be needed for returning to work correctly with SQLite.

@umaar
Copy link
Author

umaar commented Mar 15, 2021

Thanks for raising an issue there! TryGhost/node-sqlite3#1453

@tkalliom
Copy link
Contributor

The aforementioned TryGhost/node-sqlite3#1453 has landed in version 5.0.3 of the driver. Is it now possible to move forward with this? microsoft/vscode-node-sqlite3#15, related to this, was opened with the fork of the driver, but a corresponding issue does not seem to exist in the newly relocated upstream repo of the driver

@kibertoad
Copy link
Collaborator

yes, that's the plan

@simonplend
Copy link
Contributor

@kibertoad As sqlite3 has bundled SQLite with RETURNING support since v5.0.3, and better-sqlite3 since v7.1.4, would a PR now be welcome to resolve this issue?

I've hacked in the changes locally in my node_modules and they seem to be working well.

@kibertoad
Copy link
Collaborator

@simonplend Would be awesome! Tests should already exist: #4934

@simonplend
Copy link
Contributor

@kibertoad Great, I'll see what I can throw together tomorrow.

simonplend added a commit to simonplend/knex that referenced this issue Aug 1, 2022
The `RETURNING` SQL statement is now supported for insert and update
queries.

Fixes knex#4370.
simonplend added a commit to simonplend/knex that referenced this issue Aug 1, 2022
The `RETURNING` SQL statement is now supported for insert and update
queries.

Fixes knex#4370.
@kibertoad
Copy link
Collaborator

Released in 2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants