Once the database type has been initialized a connection can be established by callingconnect. A call toconnect sets*default-database* to the database instance which represents the connection. All the other database functions described take a:database argument that can be either a database or a database name, and which defaults to*default-database*.
Variable
Function
Function
connect connection-spec &key if-exists database-type
:odbc, the connection specification is a string of the format
"datasource-name/username/password"
connect function sets*default-database* to an instance of the database opened and returns that instance. The argument if-exists modifies the behavior ofconnect as follows: :new Makes a new connection even if connections to the same database already exist.
:warn-newMakes a new connection but warns about existing connections.
:errorMakes a new connection but signals an error for existing connections.
:warn-oldSelects the old connection if one exists (and warns) or makes a new one.
:oldSelects the old connection if one exists or makes a new one.
Variable
:if-exists variable of theconnect function. See the connect description for the possible values. Initial value is:error. Function
disconnect &key database
*default-database* if that database was disconnected and only one other connection exists. Function
database-name database
Function
find-database database &optional errorp
nil thenfind-database signals an error, otherwise it returnsnil. By default, errorp ist. Function
status &optional full
nil. Ift, more detailed information is returned.