Red
Red copied to clipboard
Make docs use RETURNING
Given that SQLite has added support for RETURNING in 3.35 (2021-03-12), the documentation should probably assume its presence for better readability (and at some later point the implementation should probably follow?)
-- Equivalent to the following query:
INSERT INTO person(
name
)
VALUES(
?
)
-- BIND: ["Fernando"]
-- SQLite needs an extra select:
SELECT
person.id,
person.name
FROM
person
WHERE
_rowid_ = last_insert_rowid()
LIMIT 1
Would be replaced with
-- Equivalent to the following query:
INSERT INTO person(
name
)
VALUES(
?
)
RETURNING
person.id,
person.name
-- BIND: ["Fernando"]
Thanks!