Hello Timo,
A couple of notes here. First "user" is a restricted word for postgresql, so I
suggest naming the table "users" instead.
Second, your s-sql sample create table misplaced a paren. You need another paren after
the username column and before the primary key
I agree that daos do not yet have identity columns, but that really only
prevents you from creating a table using the dao.
So consider the following where we create a table using s-sql, insert some items,
demonstrate that we can retrieve an item using a dao, then demonstrate we can
create a dao item, insert it in the table and then retrieve it. Postgresql handles all
the identity stuff. Also note that I used "users" as the table, but I can create a dao class
named "user".
(query (:create-table (:if-not-exists 'users)
((id :type integer :identity-always t)
(username :type text))
(:primary-key id)))
(query (:insert-rows-into 'users :columns 'username :values '(("Jason") ("Tim") ("Karolyn"))))
(defclass user ()
((id :col-type integer :accessor id)
(username :col-type text :initarg :username :accessor username))
(:metaclass dao-class)
(:table-name users)
(:keys id))
(username (get-dao 'user 1))
"Jason"
(let ((item (make-instance 'user :username "Zenya")))
(insert-dao item))
(username (get-dao 'user 4))
"Zenya"
Does this help?
Sabra Crolleton