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
The RETURNING clause with explicit column names keeps extra quotes around #657
Comments
First Can you reproduce this in the sqlite cli? |
Thanks for looking into this. I’m not exactly sure what you mean by “Can you reproduce this in the sqlite cli?” But I tested the following on the command line and it behaved like I expected: $ sqlite3 --version
3.36.0 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5
$ sqlite3
sqlite> .mode json
sqlite> CREATE TABLE "users" ("id" INTEGER PRIMARY KEY, "name" TEXT NOT NULL);
sqlite> INSERT INTO "users" ("name") VALUES ('Leandro Facchinetti') RETURNING "id";
[{"id":1}]
sqlite> INSERT INTO "users" ("name") VALUES ('Alexander Prinzhorn') RETURNING id;
[{"id":2}] Note how the quotes around |
I don't know what |
Yeah, you definitely don't want to rely on For some reason this has the double quotes.
|
The column names returned by |
Sounds good. Thanks for all the information 😀 |
Consider the following example:
The current workaround is to not quote the table name, for example:
I believe that in general the output of a RETURNING clause should match the output of a SELECT clause, for example:
Note that the issue also applies to things like
RETURNING "users"."id"
and so forth.The text was updated successfully, but these errors were encountered: