X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fdb-interface.lisp;h=9c8d363646aa9604d3b7127d4bae0310f7e45760;hb=2ae9ee745ff9e17806178e1999b880acc64ab894;hp=a27a9580185869e35401c82d4491e50bf9af6612;hpb=43ec897ec7d84892fa59cc9b7858ce23d64a8a1a;p=clsql.git diff --git a/base/db-interface.lisp b/base/db-interface.lisp index a27a958..9c8d363 100644 --- a/base/db-interface.lisp +++ b/base/db-interface.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; 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 @@ -11,7 +11,7 @@ ;;;; ;;;; $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 @@ -122,8 +121,19 @@ function should signal a clsql-sql-error.")) "Returns t and stores the next row in the result set in list or returns nil when result-set is finished.")) +(defgeneric database-create (connection-spec type) + (:documentation + "Creates a database, returns T if successfull or signals an error.")) + +(defgeneric database-probe (connection-spec type) + (:documentation + "Probes for the existence of a database, returns T if database found or NIL +if not found. May signal an error if unable to communicate with database server.")) -;; Interfaces to support UncommonSQL +(defgeneric database-destory (connection-spec type) + (:documentation + "Destroys a database, returns T if successfull or signals an error +if unable to destory.")) (defgeneric database-create-sequence (name database) (:documentation "Create a sequence in DATABASE."))