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

support latest sqlite3 for returning clause #330

Closed
etorth opened this issue Jul 10, 2021 · 4 comments
Closed

support latest sqlite3 for returning clause #330

etorth opened this issue Jul 10, 2021 · 4 comments
Assignees

Comments

@etorth
Copy link

etorth commented Jul 10, 2021

The latest sqlite3 supports returning-clause to return affected rows in delete and others.
It's useful and could you please support it?

The first version supports returning-clause is 3.36, released on June 20, 2021.
https://github.com/sqlite/sqlite/releases/tag/version-3.36.0

sqlite> select * from tbl_secureditemlist;
fld_dbid  fld_itemid  fld_seqid  fld_count  fld_duration  fld_extattrlist
--------  ----------  ---------  ---------  ------------  ---------------
2         687         9          1          12         687         6          1          12         692         9          1          12         692         8          1          12         692         1          1          12         687         8          1          12         687         10         1          12         692         4          1          12         692         3          1          12         687         11         1          12         692         7          1          12         692         6          1          12         687         13         1          12         692         5          1          12         687         12         1          12         687         14         1          12         687         15         1          12         687         7          1          12         666         5          1          12         687         16         1          1             �
sqlite> delete from tbl_secureditemlist where fld_dbid = 2 and fld_itemid = 687 and fld_seqid = 9 returning *;
fld_dbid  fld_itemid  fld_seqid  fld_count  fld_duration  fld_extattrlist
--------  ----------  ---------  ---------  ------------  ---------------
2         687         9          1          1
@jagerman
Copy link
Contributor

The first version supports returning-clause is 3.36

It's not quite that new: it was added in 3.35 (released 12 March 2021).

@jagerman
Copy link
Contributor

Also for the record: I've used SQLiteCpp linked to a compatible sqlite3 (rather than the embedded copy) and RETURNING queries work just fine.

@etorth
Copy link
Author

etorth commented Aug 24, 2021

that's true, I can alternatively link to the newer SQLite version.
I mean, can SQLiteCpp pack the latest sqlite3 and distribute then we don't need extra dependency?

@SRombauts
Copy link
Owner

SRombauts commented Sep 30, 2022

An up-to-date version of SQLite was packed in the master branch of the project in October, 3 months after the question:
Commit 0da8c46 by Sébastien Rombauts, 2021-10-06

Updated SQLite3 from 3.34.0 to 3.36.0 (2021-06-18)

But I realize that it has taken way too long to officially release this support officially, but it is now in the latest https://github.com/SRombauts/SQLiteCpp/releases/tag/3.2.0

Cheers!

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

No branches or pull requests

3 participants