1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; ======================================================================
3 ;;;; File: package.lisp
4 ;;;; Authors: Marcus Pearce <m.t.pearce@city.ac.uk> and Kevin Rosenberg
5 ;;;; Created: 30/03/2004
7 ;;;; ======================================================================
9 ;;;; Description ==========================================================
10 ;;;; ======================================================================
12 ;;;; Package definitions for CLSQL.
14 ;;;; ======================================================================
16 (in-package #:cl-user)
18 (eval-when (:compile-toplevel :load-toplevel :execute)
21 (if (find-package 'sb-mop)
22 (pushnew :clsql-sbcl-mop cl:*features*)
23 (pushnew :clsql-sbcl-pcl cl:*features*))
26 (if (eq (symbol-package 'pcl:find-class)
27 (find-package 'common-lisp))
28 (pushnew :clsql-cmucl-mop cl:*features*)
29 (pushnew :clsql-cmucl-pcl cl:*features*)))
32 (eval-when (:compile-toplevel :load-toplevel :execute)
33 (defpackage #:clsql-sys
34 (:use #:common-lisp #:clsql-base-sys
35 #+clsql-sbcl-mop #:sb-mop
36 #+clsql-cmucl-mop #:mop
40 #+openmcl #:openmcl-mop)
43 (:shadowing-import-from
46 (:shadowing-import-from
49 (:shadowing-import-from
51 #:generic-function-lambda-list)
53 (:shadowing-import-from
57 #:class-of #:class-name #:class-slots #:find-class
60 #:slot-definition-name #:finalize-inheritance
61 #:standard-direct-slot-definition
62 #:standard-effective-slot-definition #:validate-superclass
63 #:direct-slot-definition-class #:compute-effective-slot-definition
64 #:effective-slot-definition-class
65 #:slot-value-using-class
66 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
67 #:make-method-lambda #:generic-function-lambda-list
68 #:class-precedence-list #:slot-definition-type
69 #:class-direct-superclasses)
71 (:shadowing-import-from
73 #:generic-function-lambda-list)
75 (:shadowing-import-from
79 #:class-of #:class-name #:class-slots #:find-class #:standard-class
81 #:slot-definition-name #:finalize-inheritance
82 #:standard-direct-slot-definition #:standard-effective-slot-definition
83 #:validate-superclass #:direct-slot-definition-class
84 #:effective-slot-definition-class
85 #:compute-effective-slot-definition
86 #:slot-value-using-class
87 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
88 #:make-method-lambda #:generic-function-lambda-list
89 #:class-precedence-list #:slot-definition-type
90 #:class-direct-superclasses)
92 (:shadowing-import-from
94 #:class-prototype ;; note: make-method-lambda is not fbound
106 :clsql-simple-warning
107 :clsql-invalid-spec-error
108 :clsql-invalid-spec-error-connection-spec
109 :clsql-invalid-spec-error-database-type
110 :clsql-invalid-spec-error-template
112 :clsql-connect-error-database-type
113 :clsql-connect-error-connection-spec
114 :clsql-connect-error-errno
115 :clsql-connect-error-error
117 :clsql-sql-error-database
118 :clsql-sql-error-expression
119 :clsql-sql-error-errno
120 :clsql-sql-error-error
121 :clsql-database-warning
122 :clsql-database-warning-database
123 :clsql-database-warning-message
124 :clsql-exists-condition
125 :clsql-exists-condition-new-db
126 :clsql-exists-condition-old-db
127 :clsql-exists-warning
130 :clsql-closed-error-database
132 :clsql-sql-syntax-error
135 :check-connection-spec
136 :database-initialize-database-type
137 :database-type-load-foreign
138 :database-name-from-spec
139 :database-create-sequence
140 :database-drop-sequence
141 :database-sequence-next
142 :database-set-sequence-position
143 :database-query-result-set
144 :database-dump-result-set
145 :database-store-next-row
146 :database-get-type-specifier
147 :database-list-tables
149 :database-list-indexes
150 :database-list-sequences
151 :database-list-attributes
152 :database-attribute-type
153 :database-add-attribute
156 :*loaded-database-types*
157 :reload-database-types
158 :*default-database-type*
159 :*initialized-database-types*
160 :initialize-database-type
165 :command-recording-stream
166 :result-recording-stream
167 :database-view-classes
174 ;; database.lisp -- Connection
175 #:*default-database-type* ; clsql-base xx
176 #:*default-database* ; classes xx
177 #:connect ; database xx
178 #:*connect-if-exists* ; database xx
179 #:connected-databases ; database xx
180 #:database ; database xx
181 #:database-name ; database xx
182 #:disconnect ; database xx
183 #:reconnect ; database
184 #:find-database ; database xx
185 #:status ; database xx
187 #:with-default-database
194 #:delete-large-object
198 ;; recording.lisp -- SQL I/O Recording
201 #:add-sql-stream ; recording xx
202 #:delete-sql-stream ; recording xx
203 #:list-sql-streams ; recording xx
204 #:sql-recording-p ; recording xx
205 #:sql-stream ; recording xx
206 #:start-sql-recording ; recording xx
207 #:stop-sql-recording ; recording xx
212 #:rollback-transaction
213 #:add-transaction-commit-hook
214 #:add-transaction-rollback-hook
215 #:commit ; transact xx
216 #:rollback ; transact xx
217 #:with-transaction ; transact xx .
218 #:start-transaction ; transact xx
219 #:in-transaction-p ; transact xx
220 #:database-start-transaction
221 #:database-abort-transaction
222 #:database-commit-transaction
227 ;; "Private" exports for use by interface packages
228 :check-connection-spec
229 :database-initialize-database-type
230 :database-type-load-foreign
231 :database-name-from-spec
234 :database-execute-command
235 :database-create-sequence
236 :database-drop-sequence
237 :database-sequence-next
238 :database-set-sequence-position
239 :database-query-result-set
240 :database-dump-result-set
241 :database-store-next-row
242 :database-get-type-specifier
243 :database-list-tables
244 :database-table-exists-p
246 :database-view-exists-p
247 :database-list-indexes
248 :database-index-exists-p
249 :database-list-sequences
250 :database-sequence-exists-p
251 :database-list-attributes
252 :database-attribute-type
255 ;; Shared exports for re-export by CLSQL.
256 ;; I = Implemented, D = Documented
258 ;;====================================================
259 #2=(;;------------------------------------------------
261 ;;------------------------------------------------
264 :cache-table-queries ;
265 :*cache-table-queries-default* ;
266 :delete-records ; sql xx
267 :insert-records ; sql xx
268 :update-records ; sql xx
269 :execute-command ; sql xx
271 :print-query ; sql xx
276 :create-table ; table xx
277 :drop-table ; table xx
278 :list-tables ; table xx
279 :table-exists-p ; table xx
280 :list-attributes ; table xx
281 :attribute-type ; table xx
282 :list-attribute-types ; table xx
283 :create-view ; table xx
284 :drop-view ; table xx
285 :create-index ; table xx
286 :drop-index ; table xx
288 :standard-db-object ; objects xx
289 :def-view-class ; objects xx
290 :create-view-from-class ; objects xx
291 :drop-view-from-class ; objects xx
293 :instance-refreshed ;
294 :update-object-joins ;
295 :*default-update-objects-max-len* ;
296 :update-slot-from-record ; objects xx
297 :update-instance-from-records ; objects xx
298 :update-records-from-instance ; objects xx
299 :update-record-from-slot ; objects xx
300 :update-record-from-slots ; objects xx
301 :list-classes ; objects xx
302 :delete-instance-records ; objects xx
303 ;;Symbolic SQL Syntax
305 :sql-expression ; syntax xx
306 :sql-operation ; syntax xx
307 :sql-operator ; syntax xx
308 :disable-sql-reader-syntax ; syntax xx
309 :enable-sql-reader-syntax ; syntax xx
310 :locally-disable-sql-reader-syntax ; syntax xx
311 :locally-enable-sql-reader-syntax ; syntax xx
312 :restore-sql-reader-syntax-state ; syntax xx
314 ;;------------------------------------------------
315 ;; Miscellaneous Extensions
316 ;;------------------------------------------------
318 :*loaded-database-types* ; clsql-base xx
319 :reload-database-types ; clsql-base xx
320 :closed-database ; database xx
321 :database-type ; database x
322 :in-schema ; classes x
324 :list-views ; table xx
325 :view-exists-p ; table xx
326 :list-indexes ; table xx
327 :index-exists-p ; table xx
328 :create-sequence ; table xx
329 :drop-sequence ; table xx
330 :list-sequences ; table xx
331 :sequence-exists-p ; table xx
332 :sequence-next ; table xx
333 :sequence-last ; table xx
334 :set-sequence-position ; table xx
336 :view-table ; metaclass x
337 :create-sequence-from-class ; objects x
338 :drop-sequence-from-class ; objects x
340 :add-to-relation ; objects x
341 :remove-from-relation ; objects x
342 :read-sql-value ; objects x
343 :database-output-sql-as-type ; objects x
344 :database-get-type-specifier ; objects x
345 :database-output-sql ; sql/class xx
347 ;;-----------------------------------------------
348 ;; Symbolic Sql Syntax
349 ;;-----------------------------------------------
391 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
394 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
396 (setf *packages-for-warn-on-redefinition*
397 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
401 (:import-from :clsql-sys . #2#)
403 (:documentation "This is the SQL-Interface package of CLSQL."))
405 ;; This is from USQL's pcl-patch
406 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
408 ;; Note that this will no longer required for cmucl as of version 19a.
409 (in-package #+cmu :pcl #+sbcl :sb-pcl)
410 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
412 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
413 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
414 slot-vars pv-parameters))
415 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
420 (if (find-package 'sb-mop)
421 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
422 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
425 (if (find-package 'mop)
426 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
427 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))