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
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
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
193 #:delete-large-object
197 ;; recording.lisp -- SQL I/O Recording
200 #:add-sql-stream ; recording xx
201 #:delete-sql-stream ; recording xx
202 #:list-sql-streams ; recording xx
203 #:sql-recording-p ; recording xx
204 #:sql-stream ; recording xx
205 #:start-sql-recording ; recording xx
206 #:stop-sql-recording ; recording xx
211 #:rollback-transaction
212 #:add-transaction-commit-hook
213 #:add-transaction-rollback-hook
214 #:commit ; transact xx
215 #:rollback ; transact xx
216 #:with-transaction ; transact xx .
217 #:start-transaction ; transact xx
218 #:in-transaction-p ; transact xx
219 #:database-start-transaction
220 #:database-abort-transaction
221 #:database-commit-transaction
226 ;; "Private" exports for use by interface packages
227 :check-connection-spec
228 :database-initialize-database-type
229 :database-type-load-foreign
230 :database-name-from-spec
233 :database-execute-command
234 :database-create-sequence
235 :database-drop-sequence
236 :database-sequence-next
237 :database-set-sequence-position
238 :database-query-result-set
239 :database-dump-result-set
240 :database-store-next-row
241 :database-get-type-specifier
242 :database-list-tables
243 :database-table-exists-p
245 :database-view-exists-p
246 :database-list-indexes
247 :database-index-exists-p
248 :database-list-sequences
249 :database-sequence-exists-p
250 :database-list-attributes
251 :database-attribute-type
254 ;; Shared exports for re-export by CLSQL.
255 ;; I = Implemented, D = Documented
257 ;;====================================================
258 #2=(;;------------------------------------------------
260 ;;------------------------------------------------
263 :cache-table-queries ;
264 :*cache-table-queries-default* ;
265 :delete-records ; sql xx
266 :insert-records ; sql xx
267 :update-records ; sql xx
268 :execute-command ; sql xx
270 :print-query ; sql xx
275 :create-table ; table xx
276 :drop-table ; table xx
277 :list-tables ; table xx
278 :table-exists-p ; table xx
279 :list-attributes ; table xx
280 :attribute-type ; table xx
281 :list-attribute-types ; table xx
282 :create-view ; table xx
283 :drop-view ; table xx
284 :create-index ; table xx
285 :drop-index ; table xx
287 :standard-db-object ; objects xx
288 :def-view-class ; objects xx
289 :create-view-from-class ; objects xx
290 :drop-view-from-class ; objects xx
292 :instance-refreshed ;
293 :update-object-joins ;
294 :*default-update-objects-max-len* ;
295 :update-slot-from-record ; objects xx
296 :update-instance-from-records ; objects xx
297 :update-records-from-instance ; objects xx
298 :update-record-from-slot ; objects xx
299 :update-record-from-slots ; objects xx
300 :list-classes ; objects xx
301 :delete-instance-records ; objects xx
302 ;;Symbolic SQL Syntax
304 :sql-expression ; syntax xx
305 :sql-operation ; syntax xx
306 :sql-operator ; syntax xx
307 :disable-sql-reader-syntax ; syntax xx
308 :enable-sql-reader-syntax ; syntax xx
309 :locally-disable-sql-reader-syntax ; syntax xx
310 :locally-enable-sql-reader-syntax ; syntax xx
311 :restore-sql-reader-syntax-state ; syntax xx
313 ;;------------------------------------------------
314 ;; Miscellaneous Extensions
315 ;;------------------------------------------------
317 :*loaded-database-types* ; clsql-base xx
318 :reload-database-types ; clsql-base xx
319 :closed-database ; database xx
320 :database-type ; database x
321 :in-schema ; classes x
323 :list-views ; table xx
324 :view-exists-p ; table xx
325 :list-indexes ; table xx
326 :index-exists-p ; table xx
327 :create-sequence ; table xx
328 :drop-sequence ; table xx
329 :list-sequences ; table xx
330 :sequence-exists-p ; table xx
331 :sequence-next ; table xx
332 :sequence-last ; table xx
333 :set-sequence-position ; table xx
335 :view-table ; metaclass x
336 :create-sequence-from-class ; objects x
337 :drop-sequence-from-class ; objects x
339 :add-to-relation ; objects x
340 :remove-from-relation ; objects x
341 :read-sql-value ; objects x
342 :database-output-sql-as-type ; objects x
343 :database-get-type-specifier ; objects x
344 :database-output-sql ; sql/class xx
346 ;;-----------------------------------------------
347 ;; Symbolic Sql Syntax
348 ;;-----------------------------------------------
390 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
393 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
395 (setf *packages-for-warn-on-redefinition*
396 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
400 (:import-from :clsql-sys . #2#)
402 (:documentation "This is the SQL-Interface package of CLSQL."))
404 ;; This is from USQL's pcl-patch
405 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
407 ;; Note that this will no longer required for cmucl as of version 19a.
408 (in-package #+cmu :pcl #+sbcl :sb-pcl)
409 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
411 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
412 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
413 slot-vars pv-parameters))
414 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
419 (if (find-package 'sb-mop)
420 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
421 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
424 (if (find-package 'mop)
425 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
426 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))