DESTROY-DATABASE
Prev | Connection and Initialisation | Next

## Name

DESTROY-DATABASE — destroys a databaseFunction

## Syntax

    destroy-database connection-spec &key database-type => success

## Arguments and Values

`connection-spec`

  A connection specification

`database-type`

  A database type specifier, i.e. a keyword. This defaults to the value of *default-database-type*

`success`

  A boolean flag. If `T`, the database was successfully destroyed.

## Description

This function destroys a database in the database system specified by `database-type`.

## Examples

    (destroy-database '("localhost" "new" "dent" "dent") :database-type :postgresql)
    => T

    (destroy-database '("localhost" "new" "dent" "dent") :database-type :postgresql)
    =>
    Error: While trying to access database localhost/test2/root
      using database-type POSTGRESQL:
      Error database-destroy failed: dropdb: database removal failed: ERROR:  database "test2" does not exist
      has occurred.
      [condition type: CLSQL-ACCESS-ERROR]

## Side Effects

A database will be removed from the filesystem of the host.

## Exceptional Situations

An exception will be thrown if the database system does not allow databases to be removed, the database does not exist, or if database removal fails.

## See Also

`create-database`
`probe-database`
`list-databases`

## Notes

This function may invoke the operating systems functions. Thus, some database systems may require the administration functions to be available in the current PATH. At this time, the :mysql backend requires `mysqladmin` and the :postgresql backend requires `dropdb`.

`destroy-database` is a CLSQL extension.

Prev | Up | Next
CREATE-DATABASE | Home | PROBE-DATABASE