1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: Classes for High-level SQL interface
7 ;;;; Programmers: Kevin M. Rosenberg based on
8 ;;;; original code by Pierre R. Mai
9 ;;;; Date Started: Feb 2002
11 ;;;; $Id: classes.cl,v 1.4 2002/09/17 17:16:43 kevin Exp $
13 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
16 ;;;; CLSQL users are granted the rights to distribute and use this software
17 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
18 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
19 ;;;; *************************************************************************
21 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
22 (in-package :clsql-base-sys)
26 ((name :initform nil :initarg :name :reader database-name)
27 (connection-spec :initform nil :initarg :connection-spec :reader connection-spec
28 :documentation "Require to use connection pool")
29 (transaction-level :initform 0 :accessor transaction-level)
30 (transaction :initform nil :accessor transaction)
31 (conn-pool :initform nil :initarg :conn-pool :accessor conn-pool))
33 "This class is the supertype of all databases handled by CLSQL."))
35 (defmethod print-object ((object database) stream)
36 (print-unreadable-object (object stream :type t :identity t)
37 (write-string (if (slot-boundp object 'name)
38 (database-name object)
42 ;; Closed database idea and original code comes from UncommonSQL
44 (defclass closed-database ()
45 ((name :initarg :name :reader database-name))
47 "This class represents databases after they are closed via 'disconnect'."))
49 (defmethod print-object ((object closed-database) stream)
50 (print-unreadable-object (object stream :type t :identity t)
51 (write-string (if (slot-boundp object 'name)
52 (database-name object)