1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: package.lisp
6 ;;;; Purpose: Package definition for SQL interface
8 ;;;; This file is part of CLSQL.
10 ;;;; CLSQL users are granted the rights to distribute and use this software
11 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
12 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
13 ;;;; *************************************************************************
15 (in-package #:cl-user)
17 ;;;; This file makes the required package definitions for CLSQL's
20 (eval-when (:compile-toplevel :load-toplevel :execute)
22 (if (find-package 'sb-mop)
23 (pushnew :clsql-sbcl-mop cl:*features*)
24 (pushnew :clsql-sbcl-pcl cl:*features*))
27 (if (eq (symbol-package 'pcl:find-class)
28 (find-package 'common-lisp))
29 (pushnew :clsql-cmucl-mop cl:*features*)
30 (pushnew :clsql-cmucl-pcl cl:*features*)))
33 (eval-when (:compile-toplevel :load-toplevel :execute)
34 (defpackage #:clsql-sys
36 #+clsql-sbcl-mop #:sb-mop
37 #+clsql-cmucl-mop #:mop
41 #+openmcl #:openmcl-mop)
44 (:shadowing-import-from
47 (:shadowing-import-from
50 (:shadowing-import-from
52 #:generic-function-lambda-list)
54 (:shadowing-import-from
58 #:class-of #:class-name #:class-slots #:find-class
61 #:slot-definition-name #:finalize-inheritance
62 #:standard-direct-slot-definition
63 #:standard-effective-slot-definition #:validate-superclass
64 #:direct-slot-definition-class #:compute-effective-slot-definition
65 #:effective-slot-definition-class
66 #:slot-value-using-class
67 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
68 #:make-method-lambda #:generic-function-lambda-list
69 #:class-precedence-list #:slot-definition-type
70 #:class-direct-superclasses
71 #:compute-class-precedence-list)
73 (:shadowing-import-from
75 #:generic-function-lambda-list)
77 (:shadowing-import-from
81 #:class-of #:class-name #:class-slots #:find-class #:standard-class
83 #:slot-definition-name #:finalize-inheritance
84 #:standard-direct-slot-definition #:standard-effective-slot-definition
85 #:validate-superclass #:direct-slot-definition-class
86 #:effective-slot-definition-class
87 #:compute-effective-slot-definition
88 #:slot-value-using-class
89 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
90 #:make-method-lambda #:generic-function-lambda-list
91 #:class-precedence-list #:slot-definition-type
92 #:class-direct-superclasses
93 #:compute-class-precedence-list)
95 (:shadowing-import-from
97 #:class-prototype ;; note: make-method-lambda is not fbound
101 ;; "Private" exports for use by interface packages
102 #:check-connection-spec
103 #:database-initialize-database-type
104 #:database-type-load-foreign
105 #:database-name-from-spec
107 #:database-disconnect
109 #:database-execute-command
110 #:database-create-sequence
111 #:database-drop-sequence
112 #:database-sequence-next
113 #:database-set-sequence-position
114 #:database-query-result-set
115 #:database-dump-result-set
116 #:database-store-next-row
117 #:database-get-type-specifier
118 #:database-list-tables
119 #:database-table-exists-p
120 #:database-list-views
121 #:database-view-exists-p
122 #:database-list-indexes
123 #:database-list-table-indexes
124 #:database-index-exists-p
125 #:database-list-sequences
126 #:database-sequence-last
127 #:database-sequence-exists-p
128 #:database-list-attributes
129 #:database-attribute-type
130 #:database-describe-table
131 #:database-type-library-loaded
137 #:db-backend-has-create/destroy-db?
139 #:db-type-has-subqueries?
140 #:db-type-has-boolean-where?
141 #:db-type-transaction-capable?
142 #:db-type-has-fancy-math?
143 #:db-type-default-case
144 #:db-type-use-column-on-drop-index?
145 #:database-underlying-type
148 #:database-create-large-object
149 #:database-write-large-object
150 #:database-read-large-object
151 #:database-delete-large-object
152 #:create-large-object
155 #:delete-large-object
157 ;; accessors for database class
163 #:command-recording-stream
164 #:result-recording-stream
177 #:symbol-name-default-case
178 #:convert-to-db-default-case
182 #:clsql-invalid-spec-error
183 #:clsql-invalid-spec-error-connection-spec
184 #:clsql-invalid-spec-error-database-type
185 #:clsql-invalid-spec-error-template
187 #:clsql-access-error-database-type
188 #:clsql-access-error-connection-spec
189 #:clsql-access-error-error
190 #:clsql-connect-error
191 #:clsql-connect-error-errno
193 #:clsql-sql-error-database
194 #:clsql-sql-error-expression
195 #:clsql-sql-error-errno
196 #:clsql-sql-error-error
197 #:clsql-database-warning
198 #:clsql-database-warning-database
199 #:clsql-database-warning-message
200 #:clsql-exists-condition
201 #:clsql-exists-condition-new-db
202 #:clsql-exists-condition-old-db
203 #:clsql-exists-warning
206 #:clsql-closed-error-database
207 #:clsql-sql-syntax-error
210 #:clsql-odbc-error-message
212 #:*loaded-database-types*
213 #:reload-database-types
214 #:*initialized-database-types*
215 #:initialize-database-type
216 #:*connect-if-exists*
218 #:connected-databases
222 #:database-type ; database x
225 #:number-to-sql-string
226 #:float-to-sql-string
231 ;; Shared exports for re-export by CLSQL package.
232 ;; I = Implemented, D = Documented
234 ;;====================================================
235 #1=(;;------------------------------------------------
237 ;;------------------------------------------------
239 #:select ; objects xx
240 #:cache-table-queries ;
241 #:*cache-table-queries-default* ;
242 #:delete-records ; sql xx
243 #:insert-records ; sql xx
244 #:update-records ; sql xx
245 #:execute-command ; sql xx
247 #:print-query ; sql xx
254 #:create-table ; table xx
255 #:drop-table ; table xx
256 #:list-tables ; table xx
257 #:table-exists-p ; table xx
258 #:list-attributes ; table xx
259 #:attribute-type ; table xx
260 #:list-attribute-types ; table xx
261 #:*cache-table-queries-default*
262 #:create-view ; table xx
263 #:drop-view ; table xx
264 #:create-index ; table xx
265 #:drop-index ; table xx
268 #:standard-db-object ; objects xx
269 #:def-view-class ; objects xx
270 #:create-view-from-class ; objects xx
271 #:drop-view-from-class ; objects xx
273 #:instance-refreshed ; objects xx
274 #:update-object-joins ;
275 #:*default-update-objects-max-len* ;
276 #:update-slot-from-record ; objects xx
277 #:update-instance-from-records ; objects xx
278 #:update-records-from-instance ; objects xx
279 #:update-record-from-slot ; objects xx
280 #:update-record-from-slots ; objects xx
281 #:list-classes ; objects xx
282 #:delete-instance-records ; objects xx
283 ;;Symbolic SQL Syntax
285 #:sql-expression ; syntax xx
286 #:sql-operation ; syntax xx
287 #:sql-operator ; syntax xx
288 #:disable-sql-reader-syntax ; syntax xx
289 #:enable-sql-reader-syntax ; syntax xx
290 #:locally-disable-sql-reader-syntax ; syntax xx
291 #:locally-enable-sql-reader-syntax ; syntax xx
292 #:restore-sql-reader-syntax-state ; syntax xx
295 #:list-views ; table xx
296 #:view-exists-p ; table xx
297 #:list-indexes ; table xx
298 #:list-table-indexes ; table xx
299 #:index-exists-p ; table xx
300 #:create-sequence ; table xx
301 #:drop-sequence ; table xx
302 #:list-sequences ; table xx
303 #:sequence-exists-p ; table xx
304 #:sequence-next ; table xx
305 #:sequence-last ; table xx
306 #:set-sequence-position ; table xx
308 #:view-table ; metaclass x
309 #:universal-time ; objects xx
312 #:*db-auto-sync* ; objects xx
313 #:add-to-relation ; objects x
314 #:remove-from-relation ; objects x
315 #:read-sql-value ; objects x
316 #:database-output-sql-as-type ; objects x
317 #:database-get-type-specifier ; objects x
318 #:database-output-sql ; sql/class xx
325 #:clsql-simple-warning
327 ;;-----------------------------------------------
328 ;; Symbolic Sql Syntax
329 ;;-----------------------------------------------
394 #:duration-timestring
425 #:time-by-adding-duration
451 ;; recording.lisp -- SQL I/O Recording
454 #:add-sql-stream ; recording xx
455 #:delete-sql-stream ; recording xx
456 #:list-sql-streams ; recording xx
457 #:sql-recording-p ; recording xx
458 #:sql-stream ; recording xx
459 #:start-sql-recording ; recording xx
460 #:stop-sql-recording ; recording xx
462 ;; database.lisp -- Connection
463 #:*default-database-type* ; clsql-base xx
464 #:*default-database* ; classes xx
465 #:connect ; database xx
466 #:*connect-if-exists* ; database xx
467 #:connected-databases ; database xx
468 #:database ; database xx
469 #:database-name ; database xx
470 #:disconnect ; database xx
471 #:reconnect ; database
472 #:find-database ; database xx
473 #:status ; database xx
475 #:with-default-database
483 #:*backend-warning-behavior*
488 #:rollback-transaction
489 #:add-transaction-commit-hook
490 #:add-transaction-rollback-hook
491 #:commit ; transact xx
492 #:rollback ; transact xx
493 #:with-transaction ; transact xx .
494 #:start-transaction ; transact xx
495 #:in-transaction-p ; transact xx
496 #:database-start-transaction
497 #:database-abort-transaction
498 #:database-commit-transaction
502 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
507 (:import-from #:clsql-sys . #1#)
509 (:documentation "This is the user package with CLSQL symbols."))
511 (defpackage #:clsql-user
513 (:import-from #:clsql-sys . #1#)
515 (:documentation "This is the user package with CLSQL symbols."))
517 ;; This is from USQL's pcl-patch
518 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
520 ;; Note that this will no longer required for cmucl as of version 19a.
521 (in-package #+cmu :pcl #+sbcl :sb-pcl)
522 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
524 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
525 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
526 slot-vars pv-parameters))
527 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
530 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
532 (setf *packages-for-warn-on-redefinition*
533 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
536 (if (find-package 'sb-mop)
537 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
538 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
541 (if (find-package 'mop)
542 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
543 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))