1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
6 ;;;; Package definitions for CLSQL.
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 (eval-when (:compile-toplevel :load-toplevel :execute)
20 (if (find-package 'sb-mop)
21 (pushnew :clsql-sbcl-mop cl:*features*)
22 (pushnew :clsql-sbcl-pcl cl:*features*))
25 (if (eq (symbol-package 'pcl:find-class)
26 (find-package 'common-lisp))
27 (pushnew :clsql-cmucl-mop cl:*features*)
28 (pushnew :clsql-cmucl-pcl cl:*features*)))
31 (eval-when (:compile-toplevel :load-toplevel :execute)
32 (defpackage #:clsql-sys
33 (:use #:common-lisp #:clsql-base-sys
34 #+clsql-sbcl-mop #:sb-mop
35 #+clsql-cmucl-mop #:mop
39 #+openmcl #:openmcl-mop)
42 (:shadowing-import-from
45 (:shadowing-import-from
48 (:shadowing-import-from
50 #:generic-function-lambda-list)
52 (:shadowing-import-from
56 #:class-of #:class-name #:class-slots #:find-class
59 #:slot-definition-name #:finalize-inheritance
60 #:standard-direct-slot-definition
61 #:standard-effective-slot-definition #:validate-superclass
62 #:direct-slot-definition-class #:compute-effective-slot-definition
63 #:effective-slot-definition-class
64 #:slot-value-using-class
65 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
66 #:make-method-lambda #:generic-function-lambda-list
67 #:class-precedence-list #:slot-definition-type
68 #:class-direct-superclasses)
70 (:shadowing-import-from
72 #:generic-function-lambda-list)
74 (:shadowing-import-from
78 #:class-of #:class-name #:class-slots #:find-class #:standard-class
80 #:slot-definition-name #:finalize-inheritance
81 #:standard-direct-slot-definition #:standard-effective-slot-definition
82 #:validate-superclass #:direct-slot-definition-class
83 #:effective-slot-definition-class
84 #:compute-effective-slot-definition
85 #:slot-value-using-class
86 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
87 #:make-method-lambda #:generic-function-lambda-list
88 #:class-precedence-list #:slot-definition-type
89 #:class-direct-superclasses)
91 (:shadowing-import-from
93 #:class-prototype ;; note: make-method-lambda is not fbound
105 #:clsql-simple-warning
106 #:clsql-invalid-spec-error
107 #:clsql-invalid-spec-error-connection-spec
108 #:clsql-invalid-spec-error-database-type
109 #:clsql-invalid-spec-error-template
110 #:clsql-connect-error
111 #:clsql-connect-error-database-type
112 #:clsql-connect-error-connection-spec
113 #:clsql-connect-error-errno
114 #:clsql-connect-error-error
116 #:clsql-sql-error-database
117 #:clsql-sql-error-expression
118 #:clsql-sql-error-errno
119 #:clsql-sql-error-error
120 #:clsql-database-warning
121 #:clsql-database-warning-database
122 #:clsql-database-warning-message
123 #:clsql-exists-condition
124 #:clsql-exists-condition-new-db
125 #:clsql-exists-condition-old-db
126 #:clsql-exists-warning
129 #:clsql-closed-error-database
131 #:clsql-sql-syntax-error
134 #:check-connection-spec
135 #:database-initialize-database-type
136 #:database-type-load-foreign
137 #:database-name-from-spec
138 #:database-create-sequence
139 #:database-drop-sequence
140 #:database-sequence-next
141 #:database-set-sequence-position
142 #:database-query-result-set
143 #:database-dump-result-set
144 #:database-store-next-row
145 #:database-get-type-specifier
146 #:database-list-tables
147 #:database-list-views
148 #:database-list-indexes
149 #:database-list-sequences
150 #:database-list-attributes
151 #:database-attribute-type
152 #:database-add-attribute
155 #:*loaded-database-types*
156 #:reload-database-types
157 #:*default-database-type*
158 #:*initialized-database-types*
159 #:initialize-database-type
164 #:command-recording-stream
165 #:result-recording-stream
166 #:database-view-classes
173 ;; database.lisp -- Connection
174 #:*default-database-type* ; clsql-base xx
175 #:*default-database* ; classes xx
176 #:connect ; database xx
177 #:*connect-if-exists* ; database xx
178 #:connected-databases ; database xx
179 #:database ; database xx
180 #:database-name ; database xx
181 #:disconnect ; database xx
182 #:reconnect ; database
183 #:find-database ; database xx
184 #:status ; database xx
186 #:with-default-database
196 #:delete-large-object
200 ;; recording.lisp -- SQL I/O Recording
203 #:add-sql-stream ; recording xx
204 #:delete-sql-stream ; recording xx
205 #:list-sql-streams ; recording xx
206 #:sql-recording-p ; recording xx
207 #:sql-stream ; recording xx
208 #:start-sql-recording ; recording xx
209 #:stop-sql-recording ; recording xx
214 #:rollback-transaction
215 #:add-transaction-commit-hook
216 #:add-transaction-rollback-hook
217 #:commit ; transact xx
218 #:rollback ; transact xx
219 #:with-transaction ; transact xx .
220 #:start-transaction ; transact xx
221 #:in-transaction-p ; transact xx
222 #:database-start-transaction
223 #:database-abort-transaction
224 #:database-commit-transaction
229 ;; "Private" exports for use by interface packages
230 #:check-connection-spec
231 #:database-initialize-database-type
232 #:database-type-load-foreign
233 #:database-name-from-spec
236 #:database-execute-command
237 #:database-create-sequence
238 #:database-drop-sequence
239 #:database-sequence-next
240 #:database-set-sequence-position
241 #:database-query-result-set
242 #:database-dump-result-set
243 #:database-store-next-row
244 #:database-get-type-specifier
245 #:database-list-tables
246 #:database-table-exists-p
247 #:database-list-views
248 #:database-view-exists-p
249 #:database-list-indexes
250 #:database-index-exists-p
251 #:database-list-sequences
252 #:database-sequence-exists-p
253 #:database-list-attributes
254 #:database-attribute-type
257 ;; Shared exports for re-export by CLSQL.
258 ;; I = Implemented, D = Documented
260 ;;====================================================
261 #2=(;;------------------------------------------------
263 ;;------------------------------------------------
265 #:select ; objects xx
266 #:cache-table-queries ;
267 #:*cache-table-queries-default* ;
268 #:delete-records ; sql xx
269 #:insert-records ; sql xx
270 #:update-records ; sql xx
271 #:execute-command ; sql xx
273 #:print-query ; sql xx
278 #:create-table ; table xx
279 #:drop-table ; table xx
280 #:list-tables ; table xx
281 #:table-exists-p ; table xx
282 #:list-attributes ; table xx
283 #:attribute-type ; table xx
284 #:list-attribute-types ; table xx
285 #:create-view ; table xx
286 #:drop-view ; table xx
287 #:create-index ; table xx
288 #:drop-index ; table xx
290 #:standard-db-object ; objects xx
291 #:def-view-class ; objects xx
292 #:create-view-from-class ; objects xx
293 #:drop-view-from-class ; objects xx
295 #:instance-refreshed ;
296 #:update-object-joins ;
297 #:*default-update-objects-max-len* ;
298 #:update-slot-from-record ; objects xx
299 #:update-instance-from-records ; objects xx
300 #:update-records-from-instance ; objects xx
301 #:update-record-from-slot ; objects xx
302 #:update-record-from-slots ; objects xx
303 #:list-classes ; objects xx
304 #:delete-instance-records ; objects xx
305 ;;Symbolic SQL Syntax
307 #:sql-expression ; syntax xx
308 #:sql-operation ; syntax xx
309 #:sql-operator ; syntax xx
310 #:disable-sql-reader-syntax ; syntax xx
311 #:enable-sql-reader-syntax ; syntax xx
312 #:locally-disable-sql-reader-syntax ; syntax xx
313 #:locally-enable-sql-reader-syntax ; syntax xx
314 #:restore-sql-reader-syntax-state ; syntax xx
316 ;;------------------------------------------------
317 ;; Miscellaneous Extensions
318 ;;------------------------------------------------
320 #:*loaded-database-types* ; clsql-base xx
321 #:reload-database-types ; clsql-base xx
322 #:closed-database ; database xx
323 #:database-type ; database x
324 #:in-schema ; classes x
326 #:list-views ; table xx
327 #:view-exists-p ; table xx
328 #:list-indexes ; table xx
329 #:index-exists-p ; table xx
330 #:create-sequence ; table xx
331 #:drop-sequence ; table xx
332 #:list-sequences ; table xx
333 #:sequence-exists-p ; table xx
334 #:sequence-next ; table xx
335 #:sequence-last ; table xx
336 #:set-sequence-position ; table xx
338 #:view-table ; metaclass x
339 #:create-sequence-from-class ; objects x
340 #:drop-sequence-from-class ; objects x
342 #:add-to-relation ; objects x
343 #:remove-from-relation ; objects x
344 #:read-sql-value ; objects x
345 #:database-output-sql-as-type ; objects x
346 #:database-get-type-specifier ; objects x
347 #:database-output-sql ; sql/class xx
349 ;;-----------------------------------------------
350 ;; Symbolic Sql Syntax
351 ;;-----------------------------------------------
393 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
396 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
398 (setf *packages-for-warn-on-redefinition*
399 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
403 (:import-from #:clsql-sys . #2#)
405 (:documentation "This is the SQL-Interface package of CLSQL."))
407 (defpackage #:clsql-user
409 (:import-from #:clsql-sys . #2#)
411 (:documentation "This is the user package with CLSQL symbols."))
413 ;; This is from USQL's pcl-patch
414 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
416 ;; Note that this will no longer required for cmucl as of version 19a.
417 (in-package #+cmu :pcl #+sbcl :sb-pcl)
418 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
420 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
421 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
422 slot-vars pv-parameters))
423 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
428 (if (find-package 'sb-mop)
429 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
430 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
433 (if (find-package 'mop)
434 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
435 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))