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
69 #:compute-class-precedence-list)
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
91 #:compute-class-precedence-list)
93 (:shadowing-import-from
95 #:class-prototype ;; note: make-method-lambda is not fbound
107 #:clsql-simple-warning
108 #:clsql-invalid-spec-error
109 #:clsql-invalid-spec-error-connection-spec
110 #:clsql-invalid-spec-error-database-type
111 #:clsql-invalid-spec-error-template
113 #:clsql-access-error-database-type
114 #:clsql-access-error-connection-spec
115 #:clsql-access-error-error
116 #:clsql-connect-error
117 #:clsql-connect-error-errno
119 #:clsql-sql-error-database
120 #:clsql-sql-error-expression
121 #:clsql-sql-error-errno
122 #:clsql-sql-error-error
123 #:clsql-database-warning
124 #:clsql-database-warning-database
125 #:clsql-database-warning-message
126 #:clsql-exists-condition
127 #:clsql-exists-condition-new-db
128 #:clsql-exists-condition-old-db
129 #:clsql-exists-warning
132 #:clsql-closed-error-database
134 #:clsql-sql-syntax-error
137 #:check-connection-spec
138 #:database-initialize-database-type
139 #:database-type-load-foreign
140 #:database-name-from-spec
141 #:database-create-sequence
142 #:database-drop-sequence
143 #:database-sequence-next
144 #:database-set-sequence-position
145 #:database-query-result-set
146 #:database-dump-result-set
147 #:database-store-next-row
148 #:database-get-type-specifier
149 #:database-list-tables
150 #:database-list-views
151 #:database-list-indexes
152 #:database-list-sequences
153 #:database-list-attributes
154 #:database-attribute-type
155 #:database-add-attribute
159 #:*loaded-database-types*
160 #:reload-database-types
161 #:*default-database-type*
162 #:*initialized-database-types*
163 #:initialize-database-type
167 #:command-recording-stream
168 #:result-recording-stream
169 #:database-view-classes
175 ;; database.lisp -- Connection
176 #:*default-database-type* ; clsql-base xx
177 #:*default-database* ; classes xx
178 #:connect ; database xx
179 #:*connect-if-exists* ; database xx
180 #:connected-databases ; database xx
181 #:database ; database xx
182 #:database-name ; database xx
183 #:disconnect ; database xx
184 #:reconnect ; database
185 #:find-database ; database xx
186 #:status ; database xx
188 #:with-default-database
201 #:delete-large-object
207 ;; recording.lisp -- SQL I/O Recording
209 #:add-sql-stream ; recording xx
210 #:delete-sql-stream ; recording xx
211 #:list-sql-streams ; recording xx
212 #:sql-recording-p ; recording xx
213 #:sql-stream ; recording xx
214 #:start-sql-recording ; recording xx
215 #:stop-sql-recording ; recording xx
220 #:rollback-transaction
221 #:add-transaction-commit-hook
222 #:add-transaction-rollback-hook
223 #:commit ; transact xx
224 #:rollback ; transact xx
225 #:with-transaction ; transact xx .
226 #:start-transaction ; transact xx
227 #:in-transaction-p ; transact xx
228 #:database-start-transaction
229 #:database-abort-transaction
230 #:database-commit-transaction
235 ;; "Private" exports for use by interface packages
236 #:check-connection-spec
237 #:database-initialize-database-type
238 #:database-type-load-foreign
239 #:database-name-from-spec
242 #:database-execute-command
243 #:database-create-sequence
244 #:database-drop-sequence
245 #:database-sequence-next
246 #:database-set-sequence-position
247 #:database-query-result-set
248 #:database-dump-result-set
249 #:database-store-next-row
250 #:database-get-type-specifier
251 #:database-list-tables
252 #:database-table-exists-p
253 #:database-list-views
254 #:database-view-exists-p
255 #:database-list-indexes
256 #:database-index-exists-p
257 #:database-list-sequences
258 #:database-sequence-exists-p
259 #:database-list-attributes
260 #:database-attribute-type
261 #:database-describe-table
264 ;; Shared exports for re-export by CLSQL.
265 ;; I = Implemented, D = Documented
267 ;;====================================================
268 #2=(;;------------------------------------------------
270 ;;------------------------------------------------
272 #:select ; objects xx
273 #:cache-table-queries ;
274 #:*cache-table-queries-default* ;
275 #:delete-records ; sql xx
276 #:insert-records ; sql xx
277 #:update-records ; sql xx
278 #:execute-command ; sql xx
280 #:print-query ; sql xx
285 #:create-table ; table xx
286 #:drop-table ; table xx
287 #:list-tables ; table xx
288 #:table-exists-p ; table xx
289 #:list-attributes ; table xx
290 #:attribute-type ; table xx
291 #:list-attribute-types ; table xx
292 #:create-view ; table xx
293 #:drop-view ; table xx
294 #:create-index ; table xx
295 #:drop-index ; table xx
298 #:standard-db-object ; objects xx
299 #:def-view-class ; objects xx
300 #:create-view-from-class ; objects xx
301 #:drop-view-from-class ; objects xx
303 #:instance-refreshed ;
304 #:update-object-joins ;
305 #:*default-update-objects-max-len* ;
306 #:update-slot-from-record ; objects xx
307 #:update-instance-from-records ; objects xx
308 #:update-records-from-instance ; objects xx
309 #:update-record-from-slot ; objects xx
310 #:update-record-from-slots ; objects xx
311 #:list-classes ; objects xx
312 #:delete-instance-records ; objects xx
313 ;;Symbolic SQL Syntax
315 #:sql-expression ; syntax xx
316 #:sql-operation ; syntax xx
317 #:sql-operator ; syntax xx
318 #:disable-sql-reader-syntax ; syntax xx
319 #:enable-sql-reader-syntax ; syntax xx
320 #:locally-disable-sql-reader-syntax ; syntax xx
321 #:locally-enable-sql-reader-syntax ; syntax xx
322 #:restore-sql-reader-syntax-state ; syntax xx
324 ;;------------------------------------------------
325 ;; Miscellaneous Extensions
326 ;;------------------------------------------------
328 #:*loaded-database-types* ; clsql-base xx
329 #:reload-database-types ; clsql-base xx
330 #:database-type ; database x
333 #:list-views ; table xx
334 #:view-exists-p ; table xx
335 #:list-indexes ; table xx
336 #:index-exists-p ; table xx
337 #:create-sequence ; table xx
338 #:drop-sequence ; table xx
339 #:list-sequences ; table xx
340 #:sequence-exists-p ; table xx
341 #:sequence-next ; table xx
342 #:sequence-last ; table xx
343 #:set-sequence-position ; table xx
345 #:view-table ; metaclass x
346 #:create-sequence-from-class ; objects x
347 #:drop-sequence-from-class ; objects x
349 #:add-to-relation ; objects x
350 #:remove-from-relation ; objects x
351 #:read-sql-value ; objects x
352 #:database-output-sql-as-type ; objects x
353 #:database-get-type-specifier ; objects x
354 #:database-output-sql ; sql/class xx
356 ;;-----------------------------------------------
357 ;; Symbolic Sql Syntax
358 ;;-----------------------------------------------
400 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
403 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
405 (setf *packages-for-warn-on-redefinition*
406 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
410 (:import-from #:clsql-sys . #2#)
412 (:documentation "This is the SQL-Interface package of CLSQL."))
414 (defpackage #:clsql-user
416 (:import-from #:clsql-sys . #2#)
418 (:documentation "This is the user package with CLSQL symbols."))
420 ;; This is from USQL's pcl-patch
421 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
423 ;; Note that this will no longer required for cmucl as of version 19a.
424 (in-package #+cmu :pcl #+sbcl :sb-pcl)
425 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
427 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
428 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
429 slot-vars pv-parameters))
430 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
435 (if (find-package 'sb-mop)
436 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
437 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
440 (if (find-package 'mop)
441 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
442 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))