X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Finitialize.lisp;h=cc827bb9661677c31726ec126a957b2b18523210;hp=9fad818b05a7ada566e27067ab1cda80d0c8da41;hb=HEAD;hpb=8a8ee2d7d791b7a3efaed06420802a925d16fca3 diff --git a/sql/initialize.lisp b/sql/initialize.lisp index 9fad818..cc827bb 100644 --- a/sql/initialize.lisp +++ b/sql/initialize.lisp @@ -3,13 +3,11 @@ ;;;; FILE IDENTIFICATION ;;;; ;;;; Name: initialize.lisp -;;;; Purpose: Initializion routines for backend -;;;; Programmers: Kevin M. Rosenberg +;;;; Purpose: Initializion routines for db backend +;;;; Programmers: Kevin M. Rosenberg ;;;; Date Started: May 2002 ;;;; -;;;; $Id$ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg +;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software @@ -34,25 +32,30 @@ (mapc #'database-type-load-foreign *loaded-database-types*)) (defvar *default-database-type* nil - "Specifies the default type of database.") + "Designates the default database type which is initialised by + the function INITIALISE-DATABASE-TYPE.") (defvar *initialized-database-types* nil - "Contains a list of database types which have been initialized by calls -to initialize-database-type.") + "A list of database types which have currently been initialised +by calling INITIALIZE-DATABASE-TYPE.") (defun initialize-database-type (&key (database-type *default-database-type*)) - "Initialize the given database-type, if it is not already -initialized, as indicated by `*initialized-database-types*'." + "Initializes the supplied DATABASE-TYPE, if it is not already +initialized, as indicated by *INITIALIZED-DATABASE-TYPES* and +returns DATABASE-TYPE. *DEFAULT-DATABASE-TYPE* is set to +DATABASE-TYPE and, if DATABASE-TYPE has not been initialised, it +is added to *INITIALIZED-DATABASE-TYPES*. " (when (member database-type *initialized-database-types*) (return-from initialize-database-type database-type)) - - (let ((system (intern (concatenate 'string - (symbol-name '#:clsql-) - (symbol-name database-type))))) + + (let ((system (intern (concatenate 'string + (symbol-name '#:clsql-) + (symbol-name database-type))))) (when (not (find-package system)) (asdf:operate 'asdf:load-op system))) - + (when (database-initialize-database-type database-type) (push database-type *initialized-database-types*) + (setf *default-database-type* database-type) database-type))