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

Rowid functionality missing #7

Open
sepi opened this issue Dec 18, 2015 · 2 comments
Open

Rowid functionality missing #7

sepi opened this issue Dec 18, 2015 · 2 comments

Comments

@sepi
Copy link

sepi commented Dec 18, 2015

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.

@fukamachi
Copy link
Owner

As datafly is not an ORM, it's out of the scope.

@asarch
Copy link

asarch commented Jan 22, 2021

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

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

No branches or pull requests

3 participants