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/04/28 00:50:17 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-sys)
26 ((name :initarg :name :reader database-name)
27 (connection-spec :initarg :connection-spec :reader connection-spec
28 :documentation "Require to use connection pool")
29 (transaction-level :initarg :transaction-level :accessor transaction-level))
30 (:default-initargs :name nil :connection-spec nil :transaction-level 0)
32 "This class is the supertype of all databases handled by CLSQL."))
34 (defmethod print-object ((object database) stream)
35 (print-unreadable-object (object stream :type t :identity t)
36 (write-string (if (slot-boundp object 'name)
37 (database-name object)
41 ;; Closed database idea and original code comes from UncommonSQL
43 (defclass closed-database ()
44 ((name :initarg :name :reader database-name))
46 "This class represents databases after they are closed via 'disconnect'."))
48 (defmethod print-object ((object closed-database) stream)
49 (print-unreadable-object (object stream :type t :identity t)
50 (write-string (if (slot-boundp object 'name)
51 (database-name object)