8ba8c265b1fe4e3e0097867cad547cad7cc2de0a
[clsql.git] / sql / classes.cl
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          classes.cl
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
10 ;;;;
11 ;;;; $Id: classes.cl,v 1.1 2002/03/29 08:13:02 kevin Exp $
12 ;;;;
13 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
15 ;;;;
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 ;;;; *************************************************************************
20
21 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
22 (in-package :clsql-sys)
23
24
25 (defclass database ()
26   ((name :initarg :name :reader database-name))
27   (:documentation
28    "This class is the supertype of all databases handled by CLSQL."))
29
30 (defmethod print-object ((object database) stream)
31   (print-unreadable-object (object stream :type t :identity t)
32     (write-string (if (slot-boundp object 'name)
33                       (database-name object)
34                       "<unbound>")
35                   stream)))
36
37
38 (defclass closed-database ()
39   ((name :initarg :name :reader database-name))
40   (:documentation
41    "This class represents all databases after they are closed via
42 `disconnect'."))
43
44 (defmethod print-object ((object closed-database) stream)
45   (print-unreadable-object (object stream :type t :identity t)
46     (write-string (if (slot-boundp object 'name)
47                       (database-name object)
48                       "<unbound>")
49                   stream)))
50