X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fsql.cl;h=4b88fd584118ec8f3eb3023bd5d4b1ab4f0c9d04;hb=2073ba6b66571d3da57523dbdcb30ed6ffb4b161;hp=2d8ab3f239e6aac3035173992c0ab426b9d2f77e;hpb=30656549f102f19d3cedba9e2b6e30fc763ea20d;p=clsql.git diff --git a/sql/sql.cl b/sql/sql.cl index 2d8ab3f..4b88fd5 100644 --- a/sql/sql.cl +++ b/sql/sql.cl @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: sql.cl,v 1.8 2002/03/29 07:42:10 kevin Exp $ +;;;; $Id: sql.cl,v 1.12 2002/04/19 20:25:20 marc.battyani Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -35,11 +35,14 @@ (defvar *loaded-database-types* nil "Contains a list of database types which have been defined/loaded.") +(defmethod database-type-load-foreign :after (database-type) + (when (database-type-library-loaded database-type) + (pushnew database-type *loaded-database-types*))) + (defun reload-database-types () "Reloads any foreign code for the loaded database types after a dump." (mapc #'database-type-load-foreign *loaded-database-types*)) - (defvar *default-database-type* nil "Specifies the default type of database. Currently only :mysql is supported.") @@ -73,35 +76,7 @@ initialized, as indicated by `*initialized-database-types*'." (defvar *default-database* nil "Specifies the default database to be used.") -(defclass database () - ((name :initarg :name :reader database-name)) - (: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) - (write-string (if (slot-boundp object 'name) - (database-name object) - "") - stream))) - -(defclass closed-database () - ((name :initarg :name :reader database-name)) - (:documentation - "This class represents all databases after they are closed via -`disconnect'.")) - -(defmethod print-object ((object closed-database) stream) - (print-unreadable-object (object stream :type t :identity t) - (write-string (if (slot-boundp object 'name) - (database-name object) - "") - stream))) - -(defun signal-closed-database-error (database) - (cerror "Ignore this error and return nil." - 'clsql-closed-error - :database database)) + (defun find-database (database &optional (errorp t)) (etypecase database @@ -295,5 +270,20 @@ specified in output-type-spec and returned like in MAP." ,@body)) (database-dump-result-set ,result-set ,db))))))) +;;; Marc Battyani : Large objects support + +(defun create-large-object (&key (database *default-database*)) + "Creates a new large object in the database and returns the object identifier" + (database-create-large-object database)) + +(defun write-large-object (object-id data &key (database *default-database*)) + "Writes data to the large object" + (database-write-large-object object-id data database)) +(defun read-large-object (object-id &key (database *default-database*)) + "Reads the large object content" + (database-read-large-object object-id database)) +(defun delete-large-object (object-id &key (database *default-database*)) + "Deletes the large object in the database" + (database-delete-large-object object-id database))