INITIALIZE-DATABASE-TYPE
Prev | Connection and Initialisation | Next

## Name

INITIALIZE-DATABASE-TYPE — Initializes a database typeFunction

## Syntax

          initialize-database-type &key database-type => result

## Arguments and Values

`database-type`

  The database type to initialize, i.e. a keyword symbol denoting a known database back-end. Defaults to the value of *default-database-type*.

result

  Either `NIL` if the initialization attempt fails, or t otherwise.

## Description

If the back-end specified by `database-type` has not already been initialized, as seen from *initialized-database-types*, an attempt is made to initialize the database. If this attempt succeeds, or the back-end has already been initialized, the function returns t, and places the keyword denoting the database type onto the list stored in *initialized-database-types*, if not already present.

If initialization fails, the function returns `NIL`, and/or signals an error of type clsql-error. The kind of action taken depends on the back-end and the cause of the problem.

## Examples

    *initialized-database-types*
    => NIL
    (setf *default-database-type* :mysql)
    => :MYSQL
    (initialize-database-type)
    >> Compiling LAMBDA (#:G897 #:G898 #:G901 #:G902):
    >> Compiling Top-Level Form:
    >>
    => T
    *initialized-database-types*
    => (:MYSQL)
    (initialize-database-type)
    => T
    *initialized-database-types*
    => (:MYSQL)

## Side Effects

The database back-end corresponding to the database type specified is initialized, unless it has already been initialized. This can involve any number of other side effects, as determined by the back-end implementation (like e.g. loading of foreign code, calling of foreign code, networking operations, etc.). If initialization is attempted and succeeds, the `database-type` is pushed onto the list stored in *initialized-database-types*.

## Affected by

*default-database-type*
*initialized-database-types*

## Exceptional Situations

If an error is encountered during the initialization attempt, the back-end may signal errors of kind clsql-error.

## See Also

`*initialized-database-types*`
`*default-database-type*`

## Notes

None.

Prev | Up | Next
FIND-DATABASE | Home | RECONNECT