1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: initialize.cl
6 ;;;; Purpose: Initializion routines for backend
7 ;;;; Programmers: Kevin M. Rosenberg
8 ;;;; Date Started: May 2002
10 ;;;; $Id: initialize.lisp,v 1.1 2002/09/30 10:19:01 kevin Exp $
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
15 ;;;; CLSQL users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
20 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
21 (in-package :clsql-base-sys)
23 (defvar *loaded-database-types* nil
24 "Contains a list of database types which have been defined/loaded.")
26 (defmethod database-type-load-foreign :after (database-type)
27 (when (database-type-library-loaded database-type)
28 (pushnew database-type *loaded-database-types*)))
30 (defun reload-database-types ()
31 "Reloads any foreign code for the loaded database types after a dump."
32 (mapc #'database-type-load-foreign *loaded-database-types*))
34 (defvar *default-database-type* nil
35 "Specifies the default type of database. Currently only :mysql is
38 (defvar *initialized-database-types* nil
39 "Contains a list of database types which have been initialized by calls
40 to initialize-database-type.")
42 (defun initialize-database-type (&key (database-type *default-database-type*))
43 "Initialize the given database-type, if it is not already
44 initialized, as indicated by `*initialized-database-types*'."
45 (if (member database-type *initialized-database-types*)
47 (when (database-initialize-database-type database-type)
48 (push database-type *initialized-database-types*)