Name

WITH-DEFAULT-DATABASE — Execute a body of code with *default-database* bound to a specified database.Macro

Syntax

      with-default-database database &rest body => result

Arguments and Values

database

An active database object.

body

A Lisp code body.

result

Determined by the result of executing the last expression in body.

Description

Perform body with DATABASE bound as *default-database*.

Examples

*default-database*
=> #<CLSQL-ODBC:ODBC-DATABASE new/dent OPEN {49095CAD}>

(let ((database (clsql:find-database ":memory:")))
  (with-default-database (database) 
    (database-name *default-database*)))
=> ":memory:"
      

Side Effects

None.

Affected by

None.

Exceptional Situations

Calls to CLSQL functions in body may signal errors if database is not an active database object.

See Also

with-database
*default-database*

Notes

with-default-database is a CLSQL extension.