X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fdb-interface.cl;h=b2dd41ec5df64103d2227721bb3bf1c8fd016152;hb=f8478421f5a0440246f70aa4234ff25f416be7e3;hp=ca6a5159ef25cf3a66571e3386220c956f470188;hpb=0384597fcf4fdc8b05c48596798606ea5dc58146;p=clsql.git diff --git a/sql/db-interface.cl b/sql/db-interface.cl index ca6a515..b2dd41e 100644 --- a/sql/db-interface.cl +++ b/sql/db-interface.cl @@ -5,13 +5,14 @@ ;;;; Name: db-interface.cl ;;;; Purpose: Generic function definitions for DB interfaces ;;;; Programmers: Kevin M. Rosenberg based on -;;;; Original code by Pierre R. Mai +;;;; Original code by Pierre R. Mai. Additions from +;;;; onShoreD to support UncommonSQL front-end ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: db-interface.cl,v 1.2 2002/03/29 08:12:16 kevin Exp $ +;;;; $Id: db-interface.cl,v 1.7 2002/04/27 20:58:11 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; and Copyright (c) 1999-2001 by Pierre R. Mai +;;;; and Copyright (c) 1999-2001 by Pierre R. Mai, and onShoreD ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -21,18 +22,23 @@ (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :clsql-sys) - (defgeneric database-type-load-foreign (database-type) (:documentation - "The internal generic implementation of reload-database-types.") - (:method :after (database-type) - (pushnew database-type *loaded-database-types*))) + "The internal generic implementation of reload-database-types.")) (defgeneric database-type-library-loaded (database-type) (:documentation "The internal generic implementation for checking if database type library loaded successfully.")) +(defgeneric database-type (database-type) + (:documentation + "Returns database type") + (:method (database-type) + (declare (ignore database-type)) + (signal-nodb-error database))) + + (defgeneric database-initialize-database-type (database-type) (:documentation "The internal generic implementation of initialize-database-type.")) @@ -116,3 +122,61 @@ function should signal a clsql-sql-error.")) (:documentation "Returns t and stores the next row in the result set in list or returns nil when result-set is finished.")) + + +;; Interfaces to support UncommonSQL + +(defgeneric database-create-sequence (name database) + (:documentation "Create a sequence in DATABASE.")) + +(defgeneric database-drop-sequence (name database) + (:documentation "Drop a sequence from DATABASE.")) + +(defgeneric database-sequence-next (name database) + (:documentation "Increment a sequence in DATABASE.")) + +(defgeneric database-start-transaction (database) + (:documentation "Start a transaction in DATABASE.")) + +(defgeneric database-commit-transaction (database) + (:documentation "Commit current transaction in DATABASE.")) + +(defgeneric database-abort-transaction (database) + (:documentation "Abort current transaction in DATABASE.")) + +(defgeneric database-get-type-specifier (type args database) + (: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 nil)) + (:documentation "List all tables in the given database")) + +(defgeneric database-list-attributes (table database) + (:documentation "List all attributes in TABLE.")) + +(defgeneric database-attribute-type (attribute table database) + (:documentation "Return the type of ATTRIBUTE in TABLE.")) + +(defgeneric database-add-attribute (table attribute database) + (:documentation "Add the attribute to the table.")) + +(defgeneric database-rename-attribute (table oldatt newname database) + (:documentation "Rename the attribute in the table to NEWNAME.")) + +(defgeneric oid (object) + (:documentation "Return the unique ID of a database object.")) + + +;;; Large objects support (Marc Battyani) + +(defgeneric database-create-large-object (database) + (:documentation "Creates a new large object in the database and returns the object identifier")) + +(defgeneric database-write-large-object (object-id (data string) database) + (:documentation "Writes data to the large object")) + +(defgeneric database-read-large-object (object-id database) + (:documentation "Reads the large object content")) + +(defgeneric database-delete-large-object (object-id database) + (:documentation "Deletes the large object in the database"))