fukamachi / cl-dbi

Database independent interface for Common Lisp
202 stars 28 forks source link

The id of the new record with PostgreSQL, how? #69

Open asarch opened 3 years ago

asarch commented 3 years ago

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)))))