FIND-DATABASE — Locate a database object through it's name.
Function
A database object or a string, denoting a database name.
A generalized boolean. Defaults to t.
Either a database object, or, if errorp is nil, possibly nil.
find-database locates an active database object given the specification in database. If database is an object of type database, find-database returns this. Otherwise it will search the active databases as indicated by the list returned by connected-databases for a database whose name (as returned by database-name is equal as per string= to the string passed as database. If it succeeds, it returns the first database found.
If it fails to find a matching database, it will signal an error of type clsql-error if errorp is true. If errorp is nil, it will return nil instead.
(database-name-from-spec '("dent" "newesim" "dent" "dent") :mysql) => "dent/newesim/dent" (connect '("dent" "newesim" "dent" "dent") :database-type :mysql) => #<CLSQL-MYSQL:MYSQL-DATABASE {48391DCD}> (database-name *default-database*) => "dent/newesim/dent" (database-name-from-spec '(nil "template1" "dent" nil) :postgresql) => "/template1/dent" (connect '(nil "template1" "dent" nil) :database-type :postgresql) => #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}> (database-name *default-database*) => "/template1/dent" (database-name-from-spec '("www.pmsf.de" "template1" "dent" nil) :postgresql) => "www.pmsf.de/template1/dent" (find-database "dent/newesim/dent") => #<CLSQL-MYSQL:MYSQL-DATABASE {484E91C5}> (find-database "/template1/dent") => #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}> (find-database "www.pmsf.de/template1/dent" nil) => NIL (find-database **) => #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}>