;;;; onShoreD to support UncommonSQL front-end
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id$
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg
+;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai, and onShoreD
;;;;
;;;; CLSQL users are granted the rights to distribute and use this software
(:documentation
"Lists all databases found for TYPE. May signal an error if unable to communicate with database server."))
-(defgeneric database-destroy (connection-spec database)
- (:documentation "Destroys (drops) a database."))
-
(defgeneric database-truncate (database)
(:method ((database t))
(signal-no-database-error database))
(:documentation "Remove all data from database."))
-(defgeneric database-destory (connection-spec type)
+(defgeneric database-destroy (connection-spec type)
(:documentation
- "Destroys a database, returns T if successfull or signals an error
+ "Destroys (drops) a database, returns T if successfull or signals an error
if unable to destory."))
(defgeneric database-create-sequence (name database)
(defgeneric database-sequence-last (name database)
(:documentation "Select the last value in sequence NAME in DATABASE."))
+(defgeneric database-last-autoincrement-id (database table column)
+ (:documentation "Many databases have the notion of an auto-increment
+ id; i.e. a sequence implicitly on a table. This function should
+ return that ID." ))
+
+
(defgeneric database-start-transaction (database)
(:documentation "Start a transaction in DATABASE.")
(:method ((database t))
t)
(:documentation "T [default] if database-type supports EXCEPT."))
+(defgeneric db-type-has-auto-increment? (db-type)
+ (:method (db-type)
+ (declare (ignore db-type)
+ nil))
+ (:documentation "NIL [default] if database-type supports auto-incrementing columns."))
+
;;; Large objects support (Marc Battyani)
(defgeneric database-create-large-object (database)
nil)
(:documentation "Free the resources of a prepared statement."))
+(defgeneric database-acquire-from-conn-pool (database)
+ (:documentation "Acquire a database connection from the pool. This
+is a chance to test the connection for validity before returning it to
+the user. If this function returns NIL or throws an error that
+database connection is considered bad and we make a new one.
+
+Database objects have a chance to specialize, otherwise the default
+method uses the database-underlying-type and tries to do something
+appropriate."))
+
+(defgeneric database-release-to-conn-pool (database)
+ (:documentation "Chance for the database to cleanup before it is
+ returned to the connection pool."))
+
;; Checks for closed database
(defmethod database-disconnect :before ((database database))