r8885: pre 2.3.4
[clsql.git] / base / db-interface.lisp
index ce1b068a69900035576fe428111022da33778c4b..2904f3d46365d877e8c6dc55357b1ea59e6e0641 100644 (file)
@@ -2,16 +2,16 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          db-interface.cl
+;;;; Name:          db-interface.lisp
 ;;;; Purpose:       Generic function definitions for DB interfaces
 ;;;; Programmers:   Kevin M. Rosenberg based on
 ;;;;                Original code by Pierre R. Mai. Additions from
 ;;;;                onShoreD to support UncommonSQL front-end 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: db-interface.lisp,v 1.1 2002/09/30 10:19:01 kevin Exp $
+;;;; $Id$
 ;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 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
@@ -19,8 +19,7 @@
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :clsql-base-sys)
+(in-package #:clsql-base-sys)
 
 (defgeneric database-type-load-foreign (database-type)
   (:documentation
@@ -57,12 +56,12 @@ was called with the connection-spec."))
           (signal-nodb-error database))
   (:documentation "Internal generic implementation of disconnect."))
 
-(defgeneric database-query (query-expression database types)
-  (:method (query-expression (database closed-database) types)
-          (declare (ignore query-expression types))
+(defgeneric database-query (query-expression database result-types)
+  (:method (query-expression (database closed-database) result-types)
+          (declare (ignore query-expression result-types))
           (signal-closed-database-error database))  
-  (:method (query-expression (database t) types)
-          (declare (ignore query-expression types))
+  (:method (query-expression (database t) result-types)
+          (declare (ignore query-expression result-types))
           (signal-nodb-error database))
   (:documentation "Internal generic implementation of query."))
 
@@ -78,13 +77,13 @@ was called with the connection-spec."))
 
 ;;; Mapping and iteration
 (defgeneric database-query-result-set
-    (query-expression database &key full-set types)
-  (:method (query-expression (database closed-database) &key full-set types)
-          (declare (ignore query-expression full-set types))
+    (query-expression database &key full-set result-types)
+  (:method (query-expression (database closed-database) &key full-set result-types)
+          (declare (ignore query-expression full-set result-types))
           (signal-closed-database-error database)
           (values nil nil nil))
-  (:method (query-expression (database t) &key full-set types)
-          (declare (ignore query-expression full-set types))
+  (:method (query-expression (database t) &key full-set result-types)
+          (declare (ignore query-expression full-set result-types))
           (signal-nodb-error database)
           (values nil nil nil))
   (:documentation
@@ -134,6 +133,15 @@ returns nil when result-set is finished."))
 (defgeneric database-sequence-next (name database)
   (:documentation "Increment a sequence in DATABASE."))
 
+(defgeneric database-list-sequences (database &key owner)
+  (:documentation "List all sequences in DATABASE."))
+
+(defgeneric database-set-sequence-position (name position database)
+  (:documentation "Set the position of the sequence called NAME in DATABASE."))
+
+(defgeneric database-sequence-last (name database)
+  (:documentation "Select the last value in sequence NAME in DATABASE."))
+
 (defgeneric database-start-transaction (database)
   (:documentation "Start a transaction in DATABASE."))
 
@@ -147,13 +155,19 @@ returns nil when result-set is finished."))
   (:documentation "Return the type SQL type specifier as a string, for
 the given lisp type and parameters."))
 
-(defgeneric database-list-tables (database &key system-tables)
+(defgeneric database-list-tables (database &key owner)
   (:documentation "List all tables in the given database"))
+(defgeneric database-list-views (database &key owner)
+  (:documentation "List all views in the DATABASE."))
 
-(defgeneric database-list-attributes (table database)
+(defgeneric database-list-indexes (database &key owner)
+  (:documentation "List all indexes in the DATABASE."))
+
+(defgeneric database-list-attributes (table database &key owner)
   (:documentation "List all attributes in TABLE."))
 
-(defgeneric database-attribute-type (attribute table database)
+(defgeneric database-attribute-type (attribute table database &key owner)
   (:documentation "Return the type of ATTRIBUTE in TABLE."))
 
 (defgeneric database-add-attribute (table attribute database)
@@ -165,7 +179,7 @@ the given lisp type and parameters."))
 (defgeneric oid (object)
   (:documentation "Return the unique ID of a database object."))
 
+
 ;;; Large objects support (Marc Battyani)
 
 (defgeneric database-create-large-object (database)