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-bigint?
141 #:db-type-has-subqueries?
142 #:db-type-has-boolean-where?
143 #:db-type-transaction-capable?
144 #:db-type-has-fancy-math?
145 #:db-type-default-case
146 #:db-type-use-column-on-drop-index?
147 #:database-underlying-type
150 #:database-create-large-object
151 #:database-write-large-object
152 #:database-read-large-object
153 #:database-delete-large-object
154 #:create-large-object
157 #:delete-large-object
159 ;; accessors for database class
165 #:command-recording-stream
166 #:result-recording-stream
179 #:symbol-name-default-case
180 #:convert-to-db-default-case
184 #:clsql-invalid-spec-error
185 #:clsql-invalid-spec-error-connection-spec
186 #:clsql-invalid-spec-error-database-type
187 #:clsql-invalid-spec-error-template
189 #:clsql-access-error-database-type
190 #:clsql-access-error-connection-spec
191 #:clsql-access-error-error
192 #:clsql-connect-error
193 #:clsql-connect-error-errno
195 #:clsql-sql-error-database
196 #:clsql-sql-error-expression
197 #:clsql-sql-error-errno
198 #:clsql-sql-error-error
199 #:clsql-database-warning
200 #:clsql-database-warning-database
201 #:clsql-database-warning-message
202 #:clsql-exists-condition
203 #:clsql-exists-condition-new-db
204 #:clsql-exists-condition-old-db
205 #:clsql-exists-warning
208 #:clsql-closed-error-database
209 #:clsql-sql-syntax-error
212 #:clsql-odbc-error-message
214 #:*loaded-database-types*
215 #:reload-database-types
216 #:*initialized-database-types*
217 #:initialize-database-type
218 #:*connect-if-exists*
220 #:connected-databases
224 #:database-type ; database x
227 #:number-to-sql-string
228 #:float-to-sql-string
233 ;; Shared exports for re-export by CLSQL package.
234 ;; I = Implemented, D = Documented
236 ;;====================================================
237 #1=(;;------------------------------------------------
239 ;;------------------------------------------------
241 #:select ; objects xx
242 #:cache-table-queries ;
243 #:*cache-table-queries-default* ;
244 #:delete-records ; sql xx
245 #:insert-records ; sql xx
246 #:update-records ; sql xx
247 #:execute-command ; sql xx
249 #:print-query ; sql xx
256 #:create-table ; table xx
257 #:drop-table ; table xx
258 #:list-tables ; table xx
259 #:table-exists-p ; table xx
260 #:list-attributes ; table xx
261 #:attribute-type ; table xx
262 #:list-attribute-types ; table xx
263 #:*cache-table-queries-default*
264 #:create-view ; table xx
265 #:drop-view ; table xx
266 #:create-index ; table xx
267 #:drop-index ; table xx
270 #:standard-db-object ; objects xx
271 #:def-view-class ; objects xx
272 #:create-view-from-class ; objects xx
273 #:drop-view-from-class ; objects xx
275 #:instance-refreshed ; objects xx
276 #:update-object-joins ;
277 #:*default-update-objects-max-len* ;
278 #:update-slot-from-record ; objects xx
279 #:update-instance-from-records ; objects xx
280 #:update-records-from-instance ; objects xx
281 #:update-record-from-slot ; objects xx
282 #:update-record-from-slots ; objects xx
283 #:list-classes ; objects xx
284 #:delete-instance-records ; objects xx
285 ;;Symbolic SQL Syntax
287 #:sql-expression ; syntax xx
288 #:sql-operation ; syntax xx
289 #:sql-operator ; syntax xx
290 #:disable-sql-reader-syntax ; syntax xx
291 #:enable-sql-reader-syntax ; syntax xx
292 #:locally-disable-sql-reader-syntax ; syntax xx
293 #:locally-enable-sql-reader-syntax ; syntax xx
294 #:restore-sql-reader-syntax-state ; syntax xx
297 #:list-views ; table xx
298 #:view-exists-p ; table xx
299 #:list-indexes ; table xx
300 #:list-table-indexes ; table xx
301 #:index-exists-p ; table xx
302 #:create-sequence ; table xx
303 #:drop-sequence ; table xx
304 #:list-sequences ; table xx
305 #:sequence-exists-p ; table xx
306 #:sequence-next ; table xx
307 #:sequence-last ; table xx
308 #:set-sequence-position ; table xx
310 #:view-table ; metaclass x
311 #:universal-time ; objects xx
314 #:*db-auto-sync* ; objects xx
315 #:add-to-relation ; objects x
316 #:remove-from-relation ; objects x
317 #:read-sql-value ; objects x
318 #:database-output-sql-as-type ; objects x
319 #:database-get-type-specifier ; objects x
320 #:database-output-sql ; sql/class xx
327 #:clsql-simple-warning
329 ;;-----------------------------------------------
330 ;; Symbolic Sql Syntax
331 ;;-----------------------------------------------
396 #:duration-timestring
427 #:time-by-adding-duration
453 ;; recording.lisp -- SQL I/O Recording
456 #:add-sql-stream ; recording xx
457 #:delete-sql-stream ; recording xx
458 #:list-sql-streams ; recording xx
459 #:sql-recording-p ; recording xx
460 #:sql-stream ; recording xx
461 #:start-sql-recording ; recording xx
462 #:stop-sql-recording ; recording xx
464 ;; database.lisp -- Connection
465 #:*default-database-type* ; clsql-base xx
466 #:*default-database* ; classes xx
467 #:connect ; database xx
468 #:*connect-if-exists* ; database xx
469 #:connected-databases ; database xx
470 #:database ; database xx
471 #:database-name ; database xx
472 #:disconnect ; database xx
473 #:reconnect ; database
474 #:find-database ; database xx
475 #:status ; database xx
477 #:with-default-database
485 #:*backend-warning-behavior*
490 #:rollback-transaction
491 #:add-transaction-commit-hook
492 #:add-transaction-rollback-hook
493 #:commit ; transact xx
494 #:rollback ; transact xx
495 #:with-transaction ; transact xx .
496 #:start-transaction ; transact xx
497 #:in-transaction-p ; transact xx
498 #:database-start-transaction
499 #:database-abort-transaction
500 #:database-commit-transaction
504 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
509 (:import-from #:clsql-sys . #1#)
511 (:documentation "This is the user package with CLSQL symbols."))
513 (defpackage #:clsql-user
515 (:import-from #:clsql-sys . #1#)
517 (:documentation "This is the user package with CLSQL symbols."))
519 ;; This is from USQL's pcl-patch
520 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
522 ;; Note that this will no longer required for cmucl as of version 19a.
523 (in-package #+cmu :pcl #+sbcl :sb-pcl)
524 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
526 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
527 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
528 slot-vars pv-parameters))
529 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
532 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
534 (setf *packages-for-warn-on-redefinition*
535 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
538 (if (find-package 'sb-mop)
539 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
540 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
543 (if (find-package 'mop)
544 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
545 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))