Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the integral Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:52:45 2020 GMT+0.
• Introduction | What integral is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Integral is not recommended for a new project. Consider using Mito instead.
Integral is an object relational mapper for Common Lisp based on CL-DBI and SxQL.
This software is still ALPHA quality. The APIs will be likely to change.
Should work well with MySQL/SQLite3 on SBCL/Clozure CL.
(defclass tweet ()
((id :type integer
:primary-key t
:auto-increment t
:reader tweet-id)
(status :type text
:initarg :status
:accessor tweet-status)
(user :type (varchar 32)
:initarg :user
:accessor tweet-user))
(:metaclass <dao-table-class>))
(connect-toplevel :mysql
:database-name "myapp"
:username "nitro_idiot"
:password "xxxxxxxx")
(let ((tw (make-instance 'tweet
:status "Good morning, world."
:user "nitro_idiot")))
(save-dao tw))
;; Same as the above
(create-dao 'tweet
:status "Good morning, world."
:user "nitro_idiot")
(let ((tw (find-dao 'tweet 3)))
(with-slot (status user) tw
(format t "~A said ~A" user status))
(setf (tweet-status tw) "Good evening, world.")
(save-dao tw))
(let ((tw (find-dao 'tweet 3)))
(delete-dao tw))
(ql:quickload :integral)
connect-toplevel
is a function to establish a connection to a database.
(import 'integral:connect-toplevel)
(connect-toplevel :mysql
:database-name "testdb"
:username "nitro_idiot"
:password "password")
Integral is intended to work with MySQL, PostgreSQL and SQLite3. Replace :mysql
the above by your favorite RDBMS engine name.
In Integral, database tables are defined as CLOS classes. A table definition looks like this.
(import 'integral:<dao-table-class>)
(defclass user ()
((name :col-type text
:initarg :name))
(:metaclass <dao-table-class>))
This user
class means a "user" table in a database with a single "TEXT" column, "name".
table-definition
is a function to generate a CREATE TABLE
SQL for it.
(import '(integral:table-definition integral:execute-sql))
(table-definition 'user)
;=> "CREATE TABLE `user` (`%oid` SERIAL NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` TEXT)"
; NIL
(execute-sql (table-definition 'user))
;; Same as the above except ignoring CREATE TABLE if it already exists.
(ensure-table-exists 'user)
Table classes can be called with make-instance
like Common Lisp standard-class.
(make-instance 'user :name "Eitaro Fukamachi")
;=> #<USER %oid: <unbound>>
The instance won't be recorded in a database. Call save-dao
it to add the record to a database.
(import 'integral:save-dao)
(save-dao (make-instance 'user :name "Eitaro Fukamachi"))
;=> #<USER %oid: 1>
(save-dao (make-instance 'user :name "Tomohiro Matsuyama"))
;=> #<USER %oid: 2>
(import 'integral:select-dao)
(select-dao 'user)
;=> (#<USER %oid: 1> #<USER %oid: 2>)
(mapcar (lambda (row)
(slot-value row 'name))
(select-dao 'user))
;=> ("Eitaro Fukamachi" "Tomohiro Matsuyama")
select-dao
takes SxQL clauses. You can specify WHERE, ORDER BY or LIMIT with it.
(import '(sxql:where sxql:limit))
(select-dao 'user
(where (:= :name "Eitaro Fukamachi"))
(limit 1))
;=> (#<USER %oid: 1>)
You can also use find-dao
for retrieving a single row.
(import 'integral:find-dao)
(find-dao 'user 1)
;=> #<USER %oid: 1>
(let ((user (find-dao 'user 1)))
(setf (slot-value user 'name) "深町英太郎")
(save-dao user))
(import 'integral:delete-dao)
(let ((user (find-dao 'user 1)))
(setf (slot-value user 'name) "深町英太郎")
(delete-dao user))
I introduced Integral generates a table schema from a CLOS class definition. But how can we do when we want to change the table schema after creating it.
Integral has a function to apply the change of the class definition to a table schema. It is generally known as "Migration".
For example, if you want to record a "profile" of users to "user" table, add a slot for it.
(defclass user ()
((name :col-type text
:initarg :name)
(profile :col-type text
:initarg :profile))
(:metaclass <dao-table-class>))
Then call migrate-table
.
(import 'integral:migrate-table)
(migrate-table 'user)
;-> ALTER TABLE `user` ADD COLUMN `profile` TEXT AFTER `name`;
;=> NIL
All changes of indexes and column types are also followed.
(defclass user ()
((id :col-type serial
:primary-key t)
(name :col-type (varchar 64)
:initarg :name)
(profile :col-type text
:initarg :profile))
(:metaclass <dao-table-class>))
;-> ALTER TABLE `user` DROP COLUMN `%oid`;
; ALTER TABLE `user` MODIFY COLUMN `name` VARCHAR(64);
; ALTER TABLE `user` ADD COLUMN `id` SERIAL NOT NULL PRIMARY KEY FIRST;
;=> NIL
In development, class redefinitions are done many times. It's boring to execute migrate-table
for each single time, isn't it?
Integral has auto-migration feature for executing migrate-table
after redefinitions automatically.
Set *auto-migration-mode*
T to use the mode.
(setf integral:*auto-migration-mode* t)
If you'd like to administrate a database directly by writing raw SQLs, or wanna use Integral for an existing database, you can generate slot definitions from it.
(defclass tweet () ()
(:metaclass <dao-table-class>)
(:generate-slots t))
:generate-slots
option means slot definitions follow database schema. Note you must establish a database connection before the first make-instance
.
inflate
and deflate
is a feature to convert data between a database and Common Lisp.
(defclass user ()
((name :type string
:initarg :name)
(created-at :type timestamp
:col-type integer
:initarg :created-at))
(:metaclass integral:<dao-table-class>))
;=> #<INTEGRAL.TABLE:<DAO-TABLE-CLASS> USER>
(find-dao 'user 1)
;=> #<USER #x302001D9452D>
(slot-value * 'created-at)
;=> 3599088727
;; Define inflate/deflate methods
(defmethod integral:inflate ((object user) (slot-name (eql 'created-at)) value)
(local-time:universal-to-timestamp value))
(defmethod integral:deflate ((object user) (slot-name (eql 'created-at)) value)
(local-time:timestamp-to-universal value))
(slot-value (find-dao 'user 1) 'created-at)
;=> @2014-01-19T11:52:07.000000+09:00
You can also set inflate
and deflate
functions via :inflate
or :deflate
keywords in defclass
.
(defclass user ()
((name :type string
:initarg :name)
(created-at :type timestamp
:col-type integer
:initarg :created-at
:inflate #'local-time:universal-to-timestamp
:deflate #'local-time:timestamp-to-universal))
(:metaclass integral:<dao-table-class>))
Although Integral doesn't have a specific feature for relations like :has-a
and :has-many
, it can be done with normal methods.
(defmethod user-config ((user user))
(find-dao 'user-config (user-id user)))
(defmethod user-entries ((user user))
(select-dao 'entry (where (:= :user_id (user-id user)))))
(import 'integral:retrieve-by-sql)
(retrieve-by-sql "SELECT * FROM user")
;=> ((:%oid 1 :name "深町英太郎"
; :profile "I love Common Lisp and beer")
; (:%oid 2 :name "Tomohiro Matsuyama"
; :profile NIL))
retrieve-by-sql
takes :as
keyword argument to specify a class of the result record.
(retrieve-sql "SELECT * FROM user" :as 'user)
;=> (#<USER %oid: 1> #<USER %oid: 2>)
Copyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)
Licensed un
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The integral system |
Eitaro Fukamachi
BSD 3-Clause
Object Relational Mapper for Common Lisp
# IMPORTANT NOTICE
**Integral is not recommended for a new project.** Consider using [Mito](https://github.com/fukamachi/mito) instead.
# Integral
[](https://travis-ci.org/fukamachi/integral)
Integral is an object relational mapper for Common Lisp based on [CL-DBI](https://github.com/fukamachi/cl-dbi) and [SxQL](https://github.com/fukamachi/sxql).
## Warning
This software is still ALPHA quality. The APIs will be likely to change.
Should work well with MySQL/SQLite3 on SBCL/Clozure CL.
## Usage
“‘common-lisp
(defclass tweet ()
((id :type integer
:primary-key t
:auto-increment t
:reader tweet-id)
(status :type text
:initarg :status
:accessor tweet-status)
(user :type (varchar 32)
:initarg :user
:accessor tweet-user))
(:metaclass <dao-table-class>))
(connect-toplevel :mysql
:database-name "myapp"
:username "nitro_idiot"
:password "xxxxxxxx")
(let ((tw (make-instance ’tweet
:status "Good morning, world."
:user "nitro_idiot")))
(save-dao tw))
;; Same as the above
(create-dao ’tweet
:status "Good morning, world."
:user "nitro_idiot")
(let ((tw (find-dao ’tweet 3)))
(with-slot (status user) tw
(format t "~A said ~A" user status))
(setf (tweet-status tw) "Good evening, world.")
(save-dao tw))
(let ((tw (find-dao ’tweet 3)))
(delete-dao tw))
“‘
## Quickstart
### Installation
“‘common-lisp
(ql:quickload :integral)
“‘
### Connecting to database
‘connect-toplevel‘ is a function to establish a connection to a database.
“‘common-lisp
(import ’integral:connect-toplevel)
(connect-toplevel :mysql
:database-name "testdb"
:username "nitro_idiot"
:password "password")
“‘
Integral is intended to work with MySQL, PostgreSQL and SQLite3. Replace ‘:mysql‘ the above by your favorite RDBMS engine name.
### Defining a database table
In Integral, database tables are defined as CLOS classes. A table definition looks like this.
“‘common-lisp
(import ’integral:<dao-table-class>)
(defclass user ()
((name :col-type text
:initarg :name))
(:metaclass <dao-table-class>))
“‘
This ‘user‘ class means a "user" table in a database with a single "TEXT" column, "name".
‘table-definition‘ is a function to generate a ‘CREATE TABLE‘ SQL for it.
“‘common-lisp
(import ’(integral:table-definition integral:execute-sql))
(table-definition ’user)
;=> "CREATE TABLE ‘user‘ (‘%oid‘ SERIAL NOT NULL AUTO_INCREMENT PRIMARY KEY, ‘name‘ TEXT)"
; NIL
(execute-sql (table-definition ’user))
;; Same as the above except ignoring CREATE TABLE if it already exists.
(ensure-table-exists ’user)
“‘
### Adding records
Table classes can be called with ‘make-instance‘ like Common Lisp standard-class.
“‘common-lisp
(make-instance ’user :name "Eitaro Fukamachi")
;=> #<USER %oid: <unbound>>
“‘
The instance won’t be recorded in a database. Call ‘save-dao‘ it to add the record to a database.
“‘common-lisp
(import ’integral:save-dao)
(save-dao (make-instance ’user :name "Eitaro Fukamachi"))
;=> #<USER %oid: 1>
(save-dao (make-instance ’user :name "Tomohiro Matsuyama"))
;=> #<USER %oid: 2>
“‘
### Retrieving records
“‘common-lisp
(import ’integral:select-dao)
(select-dao ’user)
;=> (#<USER %oid: 1> #<USER %oid: 2>)
(mapcar (lambda (row)
(slot-value row ’name))
(select-dao ’user))
;=> ("Eitaro Fukamachi" "Tomohiro Matsuyama")
“‘
‘select-dao‘ takes SxQL clauses. You can specify WHERE, ORDER BY or LIMIT with it.
“‘common-lisp
(import ’(sxql:where sxql:limit))
(select-dao ’user
(where (:= :name "Eitaro Fukamachi"))
(limit 1))
;=> (#<USER %oid: 1>)
“‘
You can also use ‘find-dao‘ for retrieving a single row.
“‘common-lisp
(import ’integral:find-dao)
(find-dao ’user 1)
;=> #<USER %oid: 1>
“‘
### Updating records
“‘common-lisp
(let ((user (find-dao ’user 1)))
(setf (slot-value user ’name) "深町英太郎")
(save-dao user))
“‘
### Deleting records
“‘common-lisp
(import ’integral:delete-dao)
(let ((user (find-dao ’user 1)))
(setf (slot-value user ’name) "深町英太郎")
(delete-dao user))
“‘
### Migration
I introduced Integral generates a table schema from a CLOS class definition. But how can we do when we want to change the table schema after creating it.
Integral has a function to apply the change of the class definition to a table schema. It is generally known as "Migration".
For example, if you want to record a "profile" of users to "user" table, add a slot for it.
“‘common-lisp
(defclass user ()
((name :col-type text
:initarg :name)
(profile :col-type text
:initarg :profile))
(:metaclass <dao-table-class>))
“‘
Then call ‘migrate-table‘.
“‘common-lisp
(import ’integral:migrate-table)
(migrate-table ’user)
;-> ALTER TABLE ‘user‘ ADD COLUMN ‘profile‘ TEXT AFTER ‘name‘;
;=> NIL
“‘
All changes of indexes and column types are also followed.
“‘common-lisp
(defclass user ()
((id :col-type serial
:primary-key t)
(name :col-type (varchar 64)
:initarg :name)
(profile :col-type text
:initarg :profile))
(:metaclass <dao-table-class>))
;-> ALTER TABLE ‘user‘ DROP COLUMN ‘%oid‘;
; ALTER TABLE ‘user‘ MODIFY COLUMN ‘name‘ VARCHAR(64);
; ALTER TABLE ‘user‘ ADD COLUMN ‘id‘ SERIAL NOT NULL PRIMARY KEY FIRST;
;=> NIL
“‘
### Mystique: Auto-migration
In development, class redefinitions are done many times. It’s boring to execute ‘migrate-table‘ for each single time, isn’t it?
Integral has **auto-migration** feature for executing ‘migrate-table‘ after redefinitions automatically.
Set ‘*auto-migration-mode*‘ T to use the mode.
“‘common-lisp
(setf integral:*auto-migration-mode* t)
“‘
### Another Way: define a class from an existing table
If you’d like to administrate a database directly by writing raw SQLs, or wanna use Integral for an existing database, you can generate slot definitions from it.
“‘common-lisp
(defclass tweet () ()
(:metaclass <dao-table-class>)
(:generate-slots t))
“‘
‘:generate-slots‘ option means slot definitions follow database schema. Note you must establish a database connection before the first ‘make-instance‘.
### inflate/deflate
‘inflate‘ and ‘deflate‘ is a feature to convert data between a database and Common Lisp.
“‘common-lisp
(defclass user ()
((name :type string
:initarg :name)
(created-at :type timestamp
:col-type integer
:initarg :created-at))
(:metaclass integral:<dao-table-class>))
;=> #<INTEGRAL.TABLE:<DAO-TABLE-CLASS> USER>
(find-dao ’user 1)
;=> #<USER #x302001D9452D>
(slot-value * ’created-at)
;=> 3599088727
;; Define inflate/deflate methods
(defmethod integral:inflate ((object user) (slot-name (eql ’created-at)) value)
(local-time:universal-to-timestamp value))
(defmethod integral:deflate ((object user) (slot-name (eql ’created-at)) value)
(local-time:timestamp-to-universal value))
(slot-value (find-dao ’user 1) ’created-at)
;=> @2014-01-19T11:52:07.000000+09:00
“‘
You can also set ‘inflate‘ and ‘deflate‘ functions via ‘:inflate‘ or ‘:deflate‘ keywords in ‘defclass‘.
“‘common-lisp
(defclass user ()
((name :type string
:initarg :name)
(created-at :type timestamp
:col-type integer
:initarg :created-at
:inflate #’local-time:universal-to-timestamp
:deflate #’local-time:timestamp-to-universal))
(:metaclass integral:<dao-table-class>))
“‘
### Relations
Although Integral doesn’t have a specific feature for relations like ‘:has-a‘ and ‘:has-many‘, it can be done with normal methods.
“‘common-lisp
(defmethod user-config ((user user))
(find-dao ’user-config (user-id user)))
(defmethod user-entries ((user user))
(select-dao ’entry (where (:= :user_id (user-id user)))))
“‘
### Wanna write a raw SQL?
“‘common-lisp
(import ’integral:retrieve-by-sql)
(retrieve-by-sql "SELECT * FROM user")
;=> ((:%oid 1 :name "深町英太郎"
; :profile "I love Common Lisp and beer")
; (:%oid 2 :name "Tomohiro Matsuyama"
; :profile NIL))
“‘
‘retrieve-by-sql‘ takes ‘:as‘ keyword argument to specify a class of the result record.
“‘common-lisp
(retrieve-sql "SELECT * FROM user" :as ’user)
;=> (#<USER %oid: 1> #<USER %oid: 2>)
“‘
## Symbols
### Connections
* connect-toplevel (driver-name &rest args &key database-name &allow-other-keys)
* disconnect-toplevel ()
### Classes
* <dao-class>
* <dao-table-class>
* table-name (class)
* table-definition (class &key (yield t) if-not-exists)
* inflate (object slot-name value)
* deflate (object slot-name value)
* migrate-table (class)
* ensure-table-exists (class)
* recreate-table (class)
* \*auto-migration-mode\*
### SQL
* select-dao ((class <dao-table-class>) &rest expressions)
* insert-dao ((obj <dao-class>))
* create-dao ((class <dao-table-class>) &rest initargs)
* update-dao ((obj <dao-class>))
* delete-dao ((obj <dao-class>))
* execute-sql ((sql string) &optional binds)
* retrieve-by-sql ((sql string) &key binds as)
* save-dao ((obj <dao-class>))
* where
* order-by
* group-by
* limit
### Data types
* serial
* tinyint
* smallint
* mediumint
* bigint
* text
* varchar
* enum
* datetime
* date
* timestamp
### Errors
* <integral-error>
* <connection-not-established-error>
* <unknown-primary-key-error>
* <type-missing-error>
* <migration-error>
## See Also
* [CL-DBI](http://8arrow.org/cl-dbi/) - Database independent interface library.
* [SxQL](http://8arrow.org/sxql/) - SQL builder library.
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)
# License
Licensed under the BSD 3-Clause License.
0.0.1
integral.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The integral/src module | ||
• The integral/src/connection-drivers module |
Next: The integral/src/connection-drivers module, Previous: Modules, Up: Modules [Contents][Index]
integral (system)
src/
Previous: The integral/src module, Up: Modules [Contents][Index]
src (module)
src/connection/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The integral/src/integral․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
integral.asd
integral (system)
Next: The integral/src/table․lisp file, Previous: The integral․asd file, Up: Lisp files [Contents][Index]
src (module)
src/integral.lisp
Next: The integral/src/column․lisp file, Previous: The integral/src/integral․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/table.lisp
Next: The integral/src/connection․lisp file, Previous: The integral/src/table․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/column.lisp
Next: The integral/src/connection-drivers/mysql․lisp file, Previous: The integral/src/column․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/connection.lisp
Next: The integral/src/connection-drivers/postgres․lisp file, Previous: The integral/src/connection․lisp file, Up: Lisp files [Contents][Index]
connection-drivers (module)
src/connection/mysql.lisp
Next: The integral/src/connection-drivers/sqlite3․lisp file, Previous: The integral/src/connection-drivers/mysql․lisp file, Up: Lisp files [Contents][Index]
connection-drivers (module)
src/connection/postgres.lisp
get-serial-keys (function)
Next: The integral/src/database․lisp file, Previous: The integral/src/connection-drivers/postgres․lisp file, Up: Lisp files [Contents][Index]
connection-drivers (module)
src/connection/sqlite3.lisp
Next: The integral/src/migration․lisp file, Previous: The integral/src/connection-drivers/sqlite3․lisp file, Up: Lisp files [Contents][Index]
connection.lisp (file)
src (module)
src/database.lisp
Next: The integral/src/fixture․lisp file, Previous: The integral/src/database․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/migration.lisp
Next: The integral/src/type․lisp file, Previous: The integral/src/migration․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/fixture.lisp
Next: The integral/src/error․lisp file, Previous: The integral/src/fixture․lisp file, Up: Lisp files [Contents][Index]
util.lisp (file)
src (module)
src/type.lisp
Next: The integral/src/variable․lisp file, Previous: The integral/src/type․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/error.lisp
Next: The integral/src/util․lisp file, Previous: The integral/src/error․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/variable.lisp
*auto-migration-mode* (special variable)
Previous: The integral/src/variable․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/util.lisp
%list-diff (function)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
Next: The integral package, Previous: Packages, Up: Packages [Contents][Index]
integral.asd
Next: The integral․table package, Previous: The integral-asd package, Up: Packages [Contents][Index]
integral.lisp (file)
Next: The integral․column package, Previous: The integral package, Up: Packages [Contents][Index]
table.lisp (file)
Next: The integral․connection package, Previous: The integral․table package, Up: Packages [Contents][Index]
column.lisp (file)
Next: The integral․connection․mysql package, Previous: The integral․column package, Up: Packages [Contents][Index]
connection.lisp (file)
common-lisp
Next: The integral․connection․postgres package, Previous: The integral․connection package, Up: Packages [Contents][Index]
mysql.lisp (file)
Next: The integral․connection․sqlite3 package, Previous: The integral․connection․mysql package, Up: Packages [Contents][Index]
postgres.lisp (file)
get-serial-keys (function)
Next: The integral․database package, Previous: The integral․connection․postgres package, Up: Packages [Contents][Index]
sqlite3.lisp (file)
common-lisp
Next: The integral․migration package, Previous: The integral․connection․sqlite3 package, Up: Packages [Contents][Index]
database.lisp (file)
common-lisp
Next: The integral․fixture package, Previous: The integral․database package, Up: Packages [Contents][Index]
migration.lisp (file)
common-lisp
Next: The integral․type package, Previous: The integral․migration package, Up: Packages [Contents][Index]
fixture.lisp (file)
common-lisp
Next: The integral․error package, Previous: The integral․fixture package, Up: Packages [Contents][Index]
type.lisp (file)
common-lisp
Next: The integral․variable package, Previous: The integral․type package, Up: Packages [Contents][Index]
error.lisp (file)
common-lisp
Next: The integral․util package, Previous: The integral․error package, Up: Packages [Contents][Index]
variable.lisp (file)
common-lisp
*auto-migration-mode* (special variable)
Previous: The integral․variable package, Up: Packages [Contents][Index]
util.lisp (file)
common-lisp
%list-diff (function)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported conditions | ||
• Exported classes | ||
• Exported types |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Whether use auto-migration mode or not.
variable.lisp (file)
Current connection object.
connection.lisp (file)
database.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
type.lisp (file)
connection.lisp (file)
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
util.lisp (file)
util.lisp (file)
mysql.lisp (file)
postgres.lisp (file)
sqlite3.lisp (file)
Connect to the database with given ‘ARGS’.
Same as DBI:CONNECT except this has a simple cache mechanizm.
connection.lisp (file)
Return whether already connected to a database.
connection.lisp (file)
connection.lisp (file)
Return the database type of the current connection. It is one of :mysql, :postgres and :sqlite3. If no connections are established, NIL will be returned.
connection.lisp (file)
Disconnect the current connection.
If no connections established, this do nothing.
connection.lisp (file)
util.lisp (file)
util.lisp (file)
Return the current established connection handle.
connection.lisp (file)
util.lisp (file)
util.lisp (file)
type.lisp (file)
Return the last value of a serial column.
connection.lisp (file)
mysql.lisp (file)
postgres.lisp (file)
sqlite3.lisp (file)
util.lisp (file)
Compute differences two lists.
Note this can be applied for a list of string-designators.
util.lisp (file)
connection.lisp (file)
Retrieve column definitions of ‘TABLE-NAME’ from ‘CONN’.
connection.lisp (file)
connection.lisp (file)
type.lisp (file)
util.lisp (file)
table.lisp (file)
mysql.lisp (file)
postgres.lisp (file)
sqlite3.lisp (file)
type.lisp (file)
util.lisp (file)
Next: Exported conditions, Previous: Exported functions, Up: Exported definitions [Contents][Index]
automatically generated reader method
column.lisp (file)
automatically generated writer method
column.lisp (file)
type.lisp (file)
column.lisp (file)
integral.lisp (file)
integral.lisp (file)
table.lisp (file)
Same as C2MOP:CLASS-DIRECT-SLOTS except to remove ghost columns.
table.lisp (file)
table.lisp (file)
integral.lisp (file)
table.lisp (file)
database.lisp (file)
database.lisp (file)
integral.lisp (file)
integral.lisp (file)
table.lisp (file)
Option to specify slots as ghost slots. Ghost slots do not depend on a database.
column.lisp (file)
table.lisp (file)
table.lisp (file)
integral.lisp (file)
table.lisp (file)
migration.lisp (file)
migration.lisp (file)
automatically generated reader method
column.lisp (file)
automatically generated writer method
column.lisp (file)
table.lisp (file)
database.lisp (file)
database.lisp (file)
integral.lisp (file)
integral.lisp (file)
integral.lisp (file)
integral.lisp (file)
integral.lisp (file)
column.lisp (file)
column.lisp (file)
column.lisp (file)
column.lisp (file)
table.lisp (file)
Return the table name of ‘CLASS’ as a string.
table.lisp (file)
Return the primary key as a list.
table.lisp (file)
Return the serial key as a symbol or NIL if there’s no serial keys.
table.lisp (file)
table.lisp (file)
table.lisp (file)
integral.lisp (file)
table.lisp (file)
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
error.lisp (file)
<integral-error> (condition)
error.lisp (file)
simple-error (condition)
error.lisp (file)
<integral-error> (condition)
error.lisp (file)
<integral-error> (condition)
:slot-name
error.lisp (file)
<integral-error> (condition)
:table-name
Next: Exported types, Previous: Exported conditions, Up: Exported definitions [Contents][Index]
Base class of classes whose metaclass is <DAO-TABLE-CLASS>. The inheritance will be done implicitly. If you want to use another class, specify it as a superclass in the usual way.
table.lisp (file)
standard-object (class)
Metaclass to define classes for your database-access objects as regular CLOS classes.
table.lisp (file)
standard-class (class)
:primary-key
:unique-keys
list
:keys
(trivial-types:proper-list (quote string))
:table-name
(trivial-types:proper-list (quote boolean))
:generate-slots
(trivial-types:proper-list (quote boolean))
:auto-pk
(quote (t))
boolean
initializedp (generic function)
(setf initializedp) (generic function)
column.lisp (file)
standard-direct-slot-definition (class)
(or symbol cons)
:col-type
boolean
:primary-key
primary-key-p (generic function)
(setf primary-key-p) (generic function)
boolean
:auto-increment
auto-increment-p (generic function)
(setf auto-increment-p) (generic function)
boolean
:not-null
(or function null)
:inflate
(or function null)
:deflate
(or function null)
:satisfies
Option to specify slots as ghost slots. Ghost slots do not depend on a database.
boolean
:ghost
ghost-slot-p (generic function)
(setf ghost-slot-p) (generic function)
Previous: Exported classes, Up: Exported definitions [Contents][Index]
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
type.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal structures |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
table.lisp (file)
table.lisp (file)
column.lisp (file)
type.lisp (file)
Next: Internal generic functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
migration.lisp (file)
migration.lisp (file)
util.lisp (file)
connection.lisp (file)
migration.lisp (file)
migration.lisp (file)
connection.lisp (file)
connection.lisp (file)
connection.lisp (file)
connection.lisp (file)
table.lisp (file)
connection.lisp (file)
table.lisp (file)
table.lisp (file)
migration.lisp (file)
postgres.lisp (file)
table.lisp (file)
connection.lisp (file)
integral.lisp (file)
type.lisp (file)
sqlite3.lisp (file)
sqlite3.lisp (file)
Next: Internal structures, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
table.lisp (file)
automatically generated writer method
table.lisp (file)
integral.lisp (file)
integral.lisp (file)
integral.lisp (file)
integral.lisp (file)
column.lisp (file)
column.lisp (file)
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
Class of database connection
connection.lisp (file)
structure-object (structure)
list
connection-connect-args (function)
(setf connection-connect-args) (function)
keyword
connection-driver-name (function)
(setf connection-driver-name) (function)
(or dbi.driver:<dbi-connection> null)
connection-handle (function)
(setf connection-handle) (function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F I L M |
---|
Jump to: | F I L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A C D E F G I L M P R S T U V W |
---|
Jump to: | %
(
A C D E F G I L M P R S T U V W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | %
*
A C D G H I K N P S T U |
---|
Jump to: | %
*
A C D G H I K N P S T U |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | <
B C D E I M P S T V |
---|
Jump to: | <
B C D E I M P S T V |
---|