datafly
datafly copied to clipboard
Rowid functionality missing
When inserting a row with an auto increment in sqlit3 for example, the newly created id as returned by sqlite3:last-insert-rowid (http://quickdocs.org/cl-sqlite/api) for the sqlite3 DBMS should be accessible. Sqlite3 does not support the RETURNING SQL clause. Alternatively, add possibility to use the last_insert_rowid() sql function in SxQl.
As datafly is not an ORM, it's out of the scope.
One stupid question: with PostgreSQL, how would you get the id of the newly created record?
(with-connection (db :school)
(execute
(insert-into :students
(set=
:last_name "Uzumaki"
:first_name "Naruto"
:address "Ever green st #598, Konoha"
(returning :id)))))
I only get NIL from that
@asarch
Rather late, but try retrieve-one-value instead of execute.