1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: package.lisp
6 ;;;; Purpose: Package definition for SQL interface
10 ;;;; This file is part of CLSQL.
12 ;;;; CLSQL users are granted the rights to distribute and use this software
13 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
14 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15 ;;;; *************************************************************************
17 (in-package #:cl-user)
19 ;;;; This file makes the required package definitions for CLSQL's
22 (eval-when (:compile-toplevel :load-toplevel :execute)
24 (if (find-package 'sb-mop)
25 (pushnew :clsql-sbcl-mop cl:*features*)
26 (pushnew :clsql-sbcl-pcl cl:*features*))
29 (if (eq (symbol-package 'pcl:find-class)
30 (find-package 'common-lisp))
31 (pushnew :clsql-cmucl-mop cl:*features*)
32 (pushnew :clsql-cmucl-pcl cl:*features*)))
35 (eval-when (:compile-toplevel :load-toplevel :execute)
36 (defpackage #:clsql-sys
38 #+clsql-sbcl-mop #:sb-mop
39 #+clsql-cmucl-mop #:mop
43 #+openmcl #:openmcl-mop)
46 (:shadowing-import-from
49 (:shadowing-import-from
52 (:shadowing-import-from
54 #:generic-function-lambda-list)
56 (:shadowing-import-from
60 #:class-of #:class-name #:class-slots #:find-class
63 #:slot-definition-name #:finalize-inheritance
64 #:standard-direct-slot-definition
65 #:standard-effective-slot-definition #:validate-superclass
66 #:direct-slot-definition-class #:compute-effective-slot-definition
67 #:effective-slot-definition-class
68 #:slot-value-using-class
69 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
70 #:make-method-lambda #:generic-function-lambda-list
71 #:class-precedence-list #:slot-definition-type
72 #:class-direct-superclasses
73 #:compute-class-precedence-list)
75 (:shadowing-import-from
77 #:generic-function-lambda-list)
79 (:shadowing-import-from
83 #:class-of #:class-name #:class-slots #:find-class #:standard-class
85 #:slot-definition-name #:finalize-inheritance
86 #:standard-direct-slot-definition #:standard-effective-slot-definition
87 #:validate-superclass #:direct-slot-definition-class
88 #:effective-slot-definition-class
89 #:compute-effective-slot-definition
90 #:slot-value-using-class
91 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
92 #:make-method-lambda #:generic-function-lambda-list
93 #:class-precedence-list #:slot-definition-type
94 #:class-direct-superclasses
95 #:compute-class-precedence-list)
97 (:shadowing-import-from
99 #:class-prototype ;; note: make-method-lambda is not fbound
103 ;; "Private" exports for use by interface packages
104 #:check-connection-spec
105 #:database-initialize-database-type
106 #:database-type-load-foreign
108 #:database-disconnect
110 #:database-execute-command
111 #:database-create-sequence
112 #:database-drop-sequence
113 #:database-sequence-next
114 #:database-set-sequence-position
115 #:database-query-result-set
116 #:database-dump-result-set
117 #:database-store-next-row
118 #:database-list-tables
119 #:database-list-tables-and-sequences
120 #:database-table-exists-p
121 #:database-list-views
122 #:database-view-exists-p
123 #:database-list-indexes
124 #:database-list-table-indexes
125 #:database-index-exists-p
126 #:database-list-sequences
127 #:database-sequence-last
128 #:database-sequence-exists-p
129 #:database-list-attributes
130 #:database-attribute-type
131 #:database-type-library-loaded
137 #:db-backend-has-create/destroy-db?
139 #:db-type-has-bigint?
141 #:db-type-has-prepared-stmt?
142 #:db-type-has-subqueries?
143 #:db-type-has-boolean-where?
144 #:db-type-transaction-capable?
145 #:db-type-has-fancy-math?
146 #:db-type-default-case
147 #:db-type-use-column-on-drop-index?
148 #:database-underlying-type
149 #:database-get-type-specifier
151 #:database-output-sql-as-type
152 #:*loaded-database-types*
153 #:reload-database-types
157 #:database-create-large-object
158 #:database-write-large-object
159 #:database-read-large-object
160 #:database-delete-large-object
161 #:create-large-object
164 #:delete-large-object
166 ;; Prepared statments
168 #:database-run-prepared
169 #:database-bind-parameter
170 #:database-free-prepared
172 ;; accessors for database class
178 #:command-recording-stream
179 #:result-recording-stream
184 #:database-autocommit
191 #:symbol-name-default-case
192 #:convert-to-db-default-case
195 #:number-to-sql-string
196 #:float-to-sql-string
202 #:generic-postgresql-database
203 #:generic-odbc-database
205 ;; Subclasses of sql-expresssion (expressions.lisp)
209 #:sql-query-modifier-exp
216 #:sql-ident-attribute
221 ;; Shared exports for re-export by CLSQL package.
224 ;; Condition system (conditions.lisp)
227 #:sql-database-data-error
228 #:sql-connection-error
229 #:sql-temporary-error
233 #:sql-error-secondary-error-id
234 #:sql-error-database-message
239 #:sql-database-warning
241 #:sql-error-database-type
242 #:sql-error-connection-spec
243 #:sql-error-expression
244 #:sql-warning-database
245 #:sql-user-error-message
246 #:*backend-warning-behavior*
248 ;; Connection/initialisation (base-classes.lisp, database.lisp,
250 #:*default-database-type*
252 #:*initialized-database-types*
253 #:initialize-database-type
256 #:*connect-if-exists*
257 #:connected-databases
264 #:database-name-from-spec
267 #:with-default-database
274 ;; I/O Recording (recording.lisp)
280 #:start-sql-recording
290 #:list-attribute-types
307 #:set-sequence-position
311 #:cache-table-queries
312 #:*cache-table-queries-default*
328 ;; Transaction handling (transaction.lisp)
333 #:add-transaction-commit-hook
334 #:add-transaction-rollback-hook
339 ;; OODDL (ooddl.lisp)
342 #:create-view-from-class
343 #:drop-view-from-class
350 #:generalized-boolean
353 #:*default-string-length*
355 ;; OODML (oodml.lisp)
357 #:update-objects-joins
358 #:*default-update-objects-max-len*
359 #:update-slot-from-record
360 #:update-instance-from-records
361 #:update-records-from-instance
362 #:update-record-from-slot
363 #:update-record-from-slots
364 #:delete-instance-records
367 #:write-instance-to-stream
368 #:read-instance-from-stream
370 ;; Symbolic SQL Syntax (syntax.lisp)
375 #:disable-sql-reader-syntax
376 #:enable-sql-reader-syntax
377 #:locally-disable-sql-reader-syntax
378 #:locally-enable-sql-reader-syntax
379 #:restore-sql-reader-syntax-state
381 ;; SQL operations (operations.lisp)
436 ;; Time handling (time.lisp)
459 #:duration-timestring
490 #:time-by-adding-duration
516 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
521 (:import-from #:clsql-sys . #1#)
523 (:documentation "This is the user package with CLSQL symbols."))
525 (defpackage #:clsql-user
527 (:import-from #:clsql-sys . #1#)
529 (:documentation "This is the user package with CLSQL symbols."))
531 ;; This is from USQL's pcl-patch
532 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
534 ;; Note that this will no longer required for cmucl as of version 19a.
535 (in-package #+cmu :pcl #+sbcl :sb-pcl)
536 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
538 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
539 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
540 slot-vars pv-parameters))
541 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
544 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
546 (setf *packages-for-warn-on-redefinition*
547 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
550 (if (find-package 'sb-mop)
551 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
552 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
555 (if (find-package 'mop)
556 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
557 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))