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?
140 #:db-type-has-subqueries?
141 #:db-type-has-boolean-where?
142 #:db-type-transaction-capable?
143 #:db-type-has-fancy-math?
144 #:db-type-default-case
145 #:db-type-use-column-on-drop-index?
146 #:database-underlying-type
149 #:database-create-large-object
150 #:database-write-large-object
151 #:database-read-large-object
152 #:database-delete-large-object
153 #:create-large-object
156 #:delete-large-object
158 ;; accessors for database class
164 #:command-recording-stream
165 #:result-recording-stream
178 #:symbol-name-default-case
179 #:convert-to-db-default-case
183 #:clsql-invalid-spec-error
184 #:clsql-invalid-spec-error-connection-spec
185 #:clsql-invalid-spec-error-database-type
186 #:clsql-invalid-spec-error-template
188 #:clsql-access-error-database-type
189 #:clsql-access-error-connection-spec
190 #:clsql-access-error-error
191 #:clsql-connect-error
192 #:clsql-connect-error-errno
194 #:clsql-sql-error-database
195 #:clsql-sql-error-expression
196 #:clsql-sql-error-errno
197 #:clsql-sql-error-error
198 #:clsql-database-warning
199 #:clsql-database-warning-database
200 #:clsql-database-warning-message
201 #:clsql-exists-condition
202 #:clsql-exists-condition-new-db
203 #:clsql-exists-condition-old-db
204 #:clsql-exists-warning
207 #:clsql-closed-error-database
208 #:clsql-sql-syntax-error
211 #:clsql-odbc-error-message
213 #:*loaded-database-types*
214 #:reload-database-types
215 #:*initialized-database-types*
216 #:initialize-database-type
217 #:*connect-if-exists*
219 #:connected-databases
223 #:database-type ; database x
226 #:number-to-sql-string
227 #:float-to-sql-string
232 ;; Shared exports for re-export by CLSQL package.
233 ;; I = Implemented, D = Documented
235 ;;====================================================
236 #1=(;;------------------------------------------------
238 ;;------------------------------------------------
240 #:select ; objects xx
241 #:cache-table-queries ;
242 #:*cache-table-queries-default* ;
243 #:delete-records ; sql xx
244 #:insert-records ; sql xx
245 #:update-records ; sql xx
246 #:execute-command ; sql xx
248 #:print-query ; sql xx
255 #:create-table ; table xx
256 #:drop-table ; table xx
257 #:list-tables ; table xx
258 #:table-exists-p ; table xx
259 #:list-attributes ; table xx
260 #:attribute-type ; table xx
261 #:list-attribute-types ; table xx
262 #:*cache-table-queries-default*
263 #:create-view ; table xx
264 #:drop-view ; table xx
265 #:create-index ; table xx
266 #:drop-index ; table xx
269 #:standard-db-object ; objects xx
270 #:def-view-class ; objects xx
271 #:create-view-from-class ; objects xx
272 #:drop-view-from-class ; objects xx
274 #:instance-refreshed ; objects xx
275 #:update-object-joins ;
276 #:*default-update-objects-max-len* ;
277 #:update-slot-from-record ; objects xx
278 #:update-instance-from-records ; objects xx
279 #:update-records-from-instance ; objects xx
280 #:update-record-from-slot ; objects xx
281 #:update-record-from-slots ; objects xx
282 #:list-classes ; objects xx
283 #:delete-instance-records ; objects xx
284 ;;Symbolic SQL Syntax
286 #:sql-expression ; syntax xx
287 #:sql-operation ; syntax xx
288 #:sql-operator ; syntax xx
289 #:disable-sql-reader-syntax ; syntax xx
290 #:enable-sql-reader-syntax ; syntax xx
291 #:locally-disable-sql-reader-syntax ; syntax xx
292 #:locally-enable-sql-reader-syntax ; syntax xx
293 #:restore-sql-reader-syntax-state ; syntax xx
296 #:list-views ; table xx
297 #:view-exists-p ; table xx
298 #:list-indexes ; table xx
299 #:list-table-indexes ; table xx
300 #:index-exists-p ; table xx
301 #:create-sequence ; table xx
302 #:drop-sequence ; table xx
303 #:list-sequences ; table xx
304 #:sequence-exists-p ; table xx
305 #:sequence-next ; table xx
306 #:sequence-last ; table xx
307 #:set-sequence-position ; table xx
309 #:view-table ; metaclass x
310 #:universal-time ; objects xx
313 #:*db-auto-sync* ; objects xx
314 #:add-to-relation ; objects x
315 #:remove-from-relation ; objects x
316 #:read-sql-value ; objects x
317 #:database-output-sql-as-type ; objects x
318 #:database-get-type-specifier ; objects x
319 #:database-output-sql ; sql/class xx
326 #:clsql-simple-warning
328 ;;-----------------------------------------------
329 ;; Symbolic Sql Syntax
330 ;;-----------------------------------------------
395 #:duration-timestring
426 #:time-by-adding-duration
452 ;; recording.lisp -- SQL I/O Recording
455 #:add-sql-stream ; recording xx
456 #:delete-sql-stream ; recording xx
457 #:list-sql-streams ; recording xx
458 #:sql-recording-p ; recording xx
459 #:sql-stream ; recording xx
460 #:start-sql-recording ; recording xx
461 #:stop-sql-recording ; recording xx
463 ;; database.lisp -- Connection
464 #:*default-database-type* ; clsql-base xx
465 #:*default-database* ; classes xx
466 #:connect ; database xx
467 #:*connect-if-exists* ; database xx
468 #:connected-databases ; database xx
469 #:database ; database xx
470 #:database-name ; database xx
471 #:disconnect ; database xx
472 #:reconnect ; database
473 #:find-database ; database xx
474 #:status ; database xx
476 #:with-default-database
484 #:*backend-warning-behavior*
489 #:rollback-transaction
490 #:add-transaction-commit-hook
491 #:add-transaction-rollback-hook
492 #:commit ; transact xx
493 #:rollback ; transact xx
494 #:with-transaction ; transact xx .
495 #:start-transaction ; transact xx
496 #:in-transaction-p ; transact xx
497 #:database-start-transaction
498 #:database-abort-transaction
499 #:database-commit-transaction
503 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
508 (:import-from #:clsql-sys . #1#)
510 (:documentation "This is the user package with CLSQL symbols."))
512 (defpackage #:clsql-user
514 (:import-from #:clsql-sys . #1#)
516 (:documentation "This is the user package with CLSQL symbols."))
518 ;; This is from USQL's pcl-patch
519 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
521 ;; Note that this will no longer required for cmucl as of version 19a.
522 (in-package #+cmu :pcl #+sbcl :sb-pcl)
523 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
525 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
526 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
527 slot-vars pv-parameters))
528 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
531 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
533 (setf *packages-for-warn-on-redefinition*
534 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
537 (if (find-package 'sb-mop)
538 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
539 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
542 (if (find-package 'mop)
543 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
544 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))