Skip to content

Instantly share code, notes, and snippets.

@kencoba
Created February 27, 2014 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kencoba/9247431 to your computer and use it in GitHub Desktop.
Save kencoba/9247431 to your computer and use it in GitHub Desktop.
; SLIME 2013-11-17
CL-USER> (ql:quickload :integral)
To load "integral":
Load 1 ASDF system:
integral
; Loading "integral"
(:INTEGRAL)
CL-USER> (import 'integral:connect-toplevel)
T
CL-USER> (connect-toplevel :sqlite3
:database-name "c:/home/ken/lisp/testdb.db")
To load "dbd-sqlite3":
Load 1 ASDF system:
dbd-sqlite3
; Loading "dbd-sqlite3"
#<DBD.SQLITE3:<DBD-SQLITE3-CONNECTION> #xD0F3BFE>
CL-USER> (import 'integral:<dao-table-class>)
T
CL-USER> (defclass user ()
((name :col-type text
:initarg :name))
(:metaclass <dao-table-class>))
#<<DAO-TABLE-CLASS> USER>
CL-USER> (import '(integral:table-definition integral:execute-sql))
T
CL-USER> (table-definition 'user)
"CREATE TABLE \"user\" (\"%oid\" SERIAL NOT NULL PRIMARY KEY, \"name\" TEXT)"
NIL
CL-USER> (execute-sql (table-definition 'user))
; Evaluation aborted on #<DBI.ERROR:<DBI-PROGRAMMING-ERROR> #xD090EC6>.
CL-USER> (integral:ensure-table-exists 'user)
CREATE TABLE IF NOT EXISTS "user" ("%oid" SERIAL NOT NULL PRIMARY KEY, "name" TEXT);
NIL
CL-USER> (make-instance 'user :name "Ken-Coba")
#<USER %oid: <unbound>>
CL-USER> (import 'integral:save-dao)
T
CL-USER> (save-dao (make-instance 'user :name "Ken-Coba"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment