Skip to content

Instantly share code, notes, and snippets.

@marijnh
Created June 3, 2011 07:44
Show Gist options
  • Save marijnh/1006016 to your computer and use it in GitHub Desktop.
Save marijnh/1006016 to your computer and use it in GitHub Desktop.
deftable example
(defclass test-data ()
((id :col-type serial :initarg :id :accessor test-id)
(a :col-type (or (varchar 100) db-null) :initarg :a :accessor test-a)
(b :col-type boolean :col-default nil :initarg :b :accessor test-b))
(:metaclass dao-class)
(:table-name dao-test)
(:keys id))
(deftable test-data
(!dao-def)
(!foreign other-table (a)))
;; Now (create-table 'test-data) will run the SQL code to create the test_data table and give it a foreign key to the other_table table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment