X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fbase-classes.lisp;fp=sql%2Fbase-classes.lisp;h=98980d4ccf750794afa7332843a55657c2979ebc;hp=0000000000000000000000000000000000000000;hb=8a8ee2d7d791b7a3efaed06420802a925d16fca3;hpb=09f07ac9d914a83f9426609f3264f4e66b5a6d97 diff --git a/sql/base-classes.lisp b/sql/base-classes.lisp new file mode 100644 index 0000000..98980d4 --- /dev/null +++ b/sql/base-classes.lisp @@ -0,0 +1,55 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: classes.lisp +;;;; Purpose: Classes for High-level SQL interface +;;;; Programmers: Kevin M. Rosenberg based on +;;;; original code by Pierre R. Mai +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id$ +;;;; +;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg +;;;; and Copyright (c) 1999-2001 by Pierre R. Mai +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(in-package #:clsql-sys) + + +(defclass database () + ((name :initform nil :initarg :name :reader database-name) + (connection-spec :initform nil :initarg :connection-spec + :reader connection-spec + :documentation "Require to use connection pool") + (database-type :initarg :database-type :initform :unknown + :reader database-type) + (state :initform :closed :reader database-state) + (command-recording-stream :accessor command-recording-stream :initform nil) + (result-recording-stream :accessor result-recording-stream :initform nil) + (record-caches :accessor record-caches :initform nil) + (view-classes :accessor database-view-classes :initform nil) + (schema :accessor database-schema :initform nil) + (transaction-level :initform 0 :accessor transaction-level) + (transaction :initform nil :accessor transaction) + (conn-pool :initform nil :initarg :conn-pool :accessor conn-pool) + (attribute-cache :initform (make-hash-table :size 100 :test 'equal) + :accessor attribute-cache + :documentation "Internal cache of table attributes. It is keyed by table-name. Values +are a list of ACTION specified for table and any cached value of list-attributes-types.")) + (:documentation + "This class is the supertype of all databases handled by CLSQL.")) + +(defmethod print-object ((object database) stream) + (print-unreadable-object (object stream :type t :identity t) + (format stream "~A ~A" + (if (slot-boundp object 'name) + (database-name object) + "") + (database-state object)))) + +