Common Lisp Package: CLACK.MIDDLEWARE.CLSQL

# Clack.Middleware.Clsql - Middleware for CLSQL connection management. ## SYNOPSIS (builder (<clack-middleware-clsql> :database-type :mysql :connection-spec '("localhost" "db" "fukamachi" "password")) app) ## DESCRIPTION This is a Clack Middleware component for managing CLSQL's connection. ## Slots * database-type (Optional, Keyword) The default is `:sqlite3`. * connection-spec (Optional, List) The default is `("memory")`. * connect-args (Optional, List) ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com) ## SEE ALSO * [CLSQL](http://clsql.b9.com/)

README:

FUNCTION

Private

CONNECT (CONNECTION-SPEC &KEY (IF-EXISTS *CONNECT-IF-EXISTS*) (MAKE-DEFAULT T) (POOL NIL) (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*) (ENCODING NIL))

Connects to a database of the supplied DATABASE-TYPE which defaults to *DEFAULT-DATABASE-TYPE*, using the type-specific connection specification CONNECTION-SPEC. The value of IF-EXISTS, which defaults to *CONNECT-IF-EXISTS*, determines what happens if a connection to the database specified by CONNECTION-SPEC is already established. A value of :new means create a new connection. A value of :warn-new means warn the user and create a new connect. A value of :warn-old means warn the user and use the old connection. A value of :error means fail, notifying the user. A value of :old means return the old connection. MAKE-DEFAULT is t by default which means that *DEFAULT-DATABASE* is set to the new connection, otherwise *DEFAULT-DATABASE* is not changed. If POOL is t the connection will be taken from the general pool, if POOL is a CONN-POOL object the connection will be taken from this pool.

DISCONNECT (&KEY (DATABASE *DEFAULT-DATABASE*) (ERROR NIL))

Closes the connection to DATABASE and resets *DEFAULT-DATABASE* if that database was disconnected. If DATABASE is a database instance, this object is closed. If DATABASE is a string, then a connected database whose name matches DATABASE is sought in the list of connected databases. If no matching database is found and ERROR and DATABASE are both non-nil an error is signaled, otherwise nil is returned. If the database is from a pool it will be released to this pool.

SLOT-ACCESSOR

Private

Undocumented

CONNECT-ARGS (OBJECT)

SETFCONNECT-ARGS (NEW-VALUE OBJECT)

CONNECTION-SPEC (OBJECT)

SETFCONNECTION-SPEC (NEW-VALUE OBJECT)

DATABASE-TYPE (OBJECT)

SETFDATABASE-TYPE (NEW-VALUE OBJECT)

CLASS

Public

Undocumented

<CLACK-MIDDLEWARE-CLSQL>