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
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
28 :reader connection-spec
29 :documentation "Require to use connection pool")
30 (command-recording-stream :accessor command-recording-stream :initform nil)
31 (result-recording-stream :accessor result-recording-stream :initform nil)
32 (view-classes :accessor database-view-classes :initform nil)
33 (schema :accessor database-schema :initform nil)
34 (transaction-level :initform 0 :accessor transaction-level)
35 (transaction :initform nil :accessor transaction)
36 (conn-pool :initform nil :initarg :conn-pool :accessor conn-pool))
38 "This class is the supertype of all databases handled by CLSQL."))
40 (defmethod print-object ((object database) stream)
41 (print-unreadable-object (object stream :type t :identity t)
42 (write-string (if (slot-boundp object 'name)
43 (database-name object)
47 ;; Closed database idea and original code comes from UncommonSQL
49 (defclass closed-database ()
50 ((name :initarg :name :reader database-name))
52 "This class represents databases after they are closed via 'disconnect'."))
54 (defmethod print-object ((object closed-database) stream)
55 (print-unreadable-object (object stream :type t :identity t)
56 (write-string (if (slot-boundp object 'name)
57 (database-name object)