Use :verbose nil for asdf:operate invocation
[clsql/s11.git] / sql / package.lisp
blobfbb67b42a6a1cc0f69a8bad9ea50b4eb16ca7bb0
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name: package.lisp
6 ;;;; Purpose: Package definition for SQL interface
7 ;;;;
8 ;;;; $Id$
9 ;;;;
10 ;;;; This file is part of CLSQL.
11 ;;;;
12 ;;;; CLSQL users are granted the rights to distribute and use this software
13 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
14 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15 ;;;; *************************************************************************
17 (in-package #:cl-user)
19 ;;;; This file makes the required package definitions for CLSQL's
20 ;;;; core packages.
22 (eval-when (:compile-toplevel :load-toplevel :execute)
23 #+sbcl
24 (if (find-package 'sb-mop)
25 (pushnew :clsql-sbcl-mop cl:*features*)
26 (pushnew :clsql-sbcl-pcl cl:*features*))
28 #+cmu
29 (if (eq (symbol-package 'pcl:find-class)
30 (find-package 'common-lisp))
31 (pushnew :clsql-cmucl-mop cl:*features*)
32 (pushnew :clsql-cmucl-pcl cl:*features*)))
35 (eval-when (:compile-toplevel :load-toplevel :execute)
36 (defpackage #:clsql-sys
37 (:use #:common-lisp
38 #+clsql-sbcl-mop #:sb-mop
39 #+clsql-cmucl-mop #:mop
40 #+allegro #:mop
41 #+clisp #:clos
42 #+lispworks #:clos
43 #+scl #:clos
44 #+openmcl #:openmcl-mop)
46 #+allegro
47 (:shadowing-import-from
48 #:excl)
49 #+clisp
50 (:shadowing-import-from
51 #:clos)
52 #+lispworks
53 (:shadowing-import-from
54 #:clos)
55 #+clsql-sbcl-mop
56 (:shadowing-import-from
57 #:sb-pcl
58 #:generic-function-lambda-list)
59 #+clsql-sbcl-pcl
60 (:shadowing-import-from
61 #:sb-pcl
62 #:name
63 #:class-direct-slots
64 #:class-of #:class-name #:class-slots #:find-class
65 #:slot-boundp
66 #:standard-class
67 #:slot-definition-name #:finalize-inheritance
68 #:standard-direct-slot-definition
69 #:standard-effective-slot-definition #:validate-superclass
70 #:direct-slot-definition-class #:compute-effective-slot-definition
71 #:effective-slot-definition-class
72 #:slot-value-using-class
73 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
74 #:make-method-lambda #:generic-function-lambda-list
75 #:class-precedence-list #:slot-definition-type
76 #:class-direct-superclasses
77 #:compute-class-precedence-list)
78 #+clsql-cmucl-mop
79 (:shadowing-import-from
80 #:pcl
81 #:generic-function-lambda-list)
82 #+clsql-cmucl-pcl
83 (:shadowing-import-from
84 #:pcl
85 #:class-direct-slots
86 #:name
87 #:class-of #:class-name #:class-slots #:find-class #:standard-class
88 #:slot-boundp
89 #:slot-definition-name #:finalize-inheritance
90 #:standard-direct-slot-definition #:standard-effective-slot-definition
91 #:validate-superclass #:direct-slot-definition-class
92 #:effective-slot-definition-class
93 #:compute-effective-slot-definition
94 #:slot-value-using-class
95 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
96 #:make-method-lambda #:generic-function-lambda-list
97 #:class-precedence-list #:slot-definition-type
98 #:class-direct-superclasses
99 #:compute-class-precedence-list)
100 #+scl
101 (:shadowing-import-from
102 #:clos
103 #:class-prototype ;; note: make-method-lambda is not fbound
106 (:export
107 ;; "Private" exports for use by interface packages
108 #:check-connection-spec
109 #:database-initialize-database-type
110 #:database-type-load-foreign
111 #:database-connect
112 #:database-disconnect
113 #:database-reconnect
114 #:database-query
115 #:database-execute-command
116 #:database-create-sequence
117 #:database-drop-sequence
118 #:database-sequence-next
119 #:database-set-sequence-position
120 #:database-query-result-set
121 #:database-dump-result-set
122 #:database-store-next-row
123 #:database-list-tables
124 #:database-list-tables-and-sequences
125 #:database-table-exists-p
126 #:database-list-views
127 #:database-view-exists-p
128 #:database-list-indexes
129 #:database-list-table-indexes
130 #:database-index-exists-p
131 #:database-list-sequences
132 #:database-sequence-last
133 #:database-sequence-exists-p
134 #:database-list-attributes
135 #:database-attribute-type
136 #:database-type-library-loaded
137 #:database-create
138 #:database-destroy
139 #:database-probe
140 #:database-list
142 #:db-backend-has-create/destroy-db?
143 #:db-type-has-views?
144 #:db-type-has-bigint?
145 #:db-type-has-union?
146 #:db-type-has-prepared-stmt?
147 #:db-type-has-subqueries?
148 #:db-type-has-boolean-where?
149 #:db-type-transaction-capable?
150 #:db-type-has-fancy-math?
151 #:db-type-default-case
152 #:db-type-use-column-on-drop-index?
153 #:db-type-use-fully-qualified-column-on-drop-index?
154 #:db-type-has-intersect?
155 #:db-type-has-except?
156 #:database-underlying-type
157 #:database-get-type-specifier
158 #:read-sql-value
159 #:database-output-sql-as-type
160 #:*loaded-database-types*
161 #:reload-database-types
162 #:is-database-open
164 ;; Large objects
165 #:database-create-large-object
166 #:database-write-large-object
167 #:database-read-large-object
168 #:database-delete-large-object
169 #:create-large-object
170 #:write-large-object
171 #:read-large-object
172 #:delete-large-object
174 ;; Prepared statments
175 #:database-prepare
176 #:database-run-prepared
177 #:database-bind-parameter
178 #:database-free-prepared
180 ;; accessors for database class
181 #:name
182 #:connection-spec
183 #:transaction
184 #:transaction-level
185 #:conn-pool
186 #:command-recording-stream
187 #:result-recording-stream
188 #:record-caches
189 #:view-classes
190 #:database-state
191 #:attribute-cache
192 #:database-autocommit
194 ;; utils.lisp
195 #:without-interrupts
196 #:make-process-lock
197 #:with-process-lock
198 #:command-output
199 #:symbol-name-default-case
200 #:convert-to-db-default-case
201 #:ensure-keyword
202 #:getenv
203 #:number-to-sql-string
204 #:float-to-sql-string
205 #:sql-escape-quotes
206 #:sql-escape
207 #:in
209 ;; Generic backends
210 #:generic-postgresql-database
211 #:generic-odbc-database
213 ;; Subclasses of sql-expresssion (expressions.lisp)
214 #:sql-function-exp
215 #:sql-value-exp
216 #:sql-set-exp
217 #:sql-query-modifier-exp
218 #:sql-relational-exp
219 #:sql-upcase-like
220 #:sql-assignment-exp
221 #:sql-typecast-exp
222 #:sql-between-exp
223 #:sql-ident
224 #:sql-ident-attribute
225 #:sql-ident-table
229 ;; Shared exports for re-export by CLSQL package.
230 #1=(
232 ;; foreign library loading
233 #:*foreign-library-search-paths*
234 #:push-library-path
236 ;; Condition system (conditions.lisp)
237 #:sql-user-error
238 #:sql-database-error
239 #:sql-database-data-error
240 #:sql-connection-error
241 #:sql-temporary-error
242 #:sql-timeout-error
243 #:sql-fatal-error
244 #:sql-error-error-id
245 #:sql-error-secondary-error-id
246 #:sql-error-database-message
247 ;; CLSQL Extensions
248 #:sql-condition
249 #:sql-error
250 #:sql-warning
251 #:sql-database-warning
252 #:sql-error-database
253 #:sql-error-database-type
254 #:sql-error-connection-spec
255 #:sql-error-expression
256 #:sql-warning-database
257 #:sql-user-error-message
258 #:*backend-warning-behavior*
260 ;; Connection/initialisation (base-classes.lisp, database.lisp,
261 ;; initialize.lisp)
262 #:*default-database-type*
263 #:*default-database*
264 #:*initialized-database-types*
265 #:initialize-database-type
266 #:connect
267 #:disconnect
268 #:*connect-if-exists*
269 #:connected-databases
270 #:database
271 #:database-name
272 #:reconnect
273 #:find-database
274 #:status
275 ;; CLSQL Extensions
276 #:database-name-from-spec
277 #:database-type
278 #:with-database
279 #:with-default-database
280 #:disconnect-pooled
281 #:list-databases
282 #:create-database
283 #:destroy-database
284 #:probe-database
286 ;; I/O Recording (recording.lisp)
287 #:add-sql-stream
288 #:delete-sql-stream
289 #:list-sql-streams
290 #:sql-recording-p
291 #:sql-stream
292 #:start-sql-recording
293 #:stop-sql-recording
295 ;; FDDL (fddl.lisp)
296 #:create-table
297 #:drop-table
298 #:list-tables
299 #:table-exists-p
300 #:list-attributes
301 #:attribute-type
302 #:list-attribute-types
303 #:create-view
304 #:drop-view
305 #:create-index
306 #:drop-index
307 ;; CLSQL Extensions
308 #:truncate-database
309 #:list-views
310 #:view-exists-p
311 #:list-indexes
312 #:index-exists-p
313 #:create-sequence
314 #:drop-sequence
315 #:list-sequences
316 #:sequence-exists-p
317 #:sequence-next
318 #:sequence-last
319 #:set-sequence-position
321 ;; FDML (fdml.lisp)
322 #:select
323 #:cache-table-queries
324 #:*cache-table-queries-default*
325 #:delete-records
326 #:insert-records
327 #:update-records
328 #:execute-command
329 #:query
330 #:print-query
331 #:do-query
332 #:map-query
333 #:loop
334 ;; CLSQL Extensions
335 #:prepare-sql
336 #:bind-parameter
337 #:run-prepared-sql
338 #:free-prepared-sql
340 ;; Transaction handling (transaction.lisp)
341 #:with-transaction
342 #:commit
343 #:rollback
344 ;; CLSQL Extensions
345 #:add-transaction-commit-hook
346 #:add-transaction-rollback-hook
347 #:start-transaction
348 #:in-transaction-p
349 #:set-autocommit
351 ;; OODDL (ooddl.lisp)
352 #:standard-db-object
353 #:def-view-class
354 #:create-view-from-class
355 #:drop-view-from-class
356 #:list-classes
357 #:universal-time
358 ;; CLSQL Extensions
359 #:view-table
360 #:bigint
361 #:varchar
362 #:generalized-boolean
363 #:mediumint
364 #:smallint
365 #:tinyint
366 #:*default-string-length*
368 ;; OODML (oodml.lisp)
369 #:instance-refreshed
370 #:update-objects-joins
371 #:*default-update-objects-max-len*
372 #:*default-caching*
373 #:update-slot-from-record
374 #:update-instance-from-records
375 #:update-records-from-instance
376 #:update-record-from-slot
377 #:update-record-from-slots
378 #:delete-instance-records
379 ;; CLSQL Extensions
380 #:*db-auto-sync*
381 #:write-instance-to-stream
382 #:read-instance-from-stream
384 ;; Symbolic SQL Syntax (syntax.lisp)
385 #:sql
386 #:sql-expression
387 #:sql-operation
388 #:sql-operator
389 #:disable-sql-reader-syntax
390 #:enable-sql-reader-syntax
391 #:locally-disable-sql-reader-syntax
392 #:locally-enable-sql-reader-syntax
393 #:restore-sql-reader-syntax-state
395 ;; SQL operations (operations.lisp)
396 #:sql-query
397 #:sql-object-query
398 #:sql-any
399 #:sql-some
400 #:sql-all
401 #:sql-not
402 #:sql-union
403 #:sql-intersect
404 #:sql-minus
405 #:sql-except
406 #:sql-order-by
407 #:sql-null
408 #:sql-*
409 #:sql-+
410 #:sql-/
411 #:sql--
412 #:sql-like
413 #:sql-and
414 #:sql-or
415 #:sql-in
416 #:sql-substr
417 #:sql-concat-op
418 #:sql-=
419 #:sql-<
420 #:sql->
421 #:sql->=
422 #:sql-<=
423 #:sql-<>
424 #:sql-count
425 #:sql-max
426 #:sql-min
427 #:sql-avg
428 #:sql-sum
429 #:sql-function
430 #:sql-between
431 #:sql-distinct
432 #:sql-nvl
433 #:sql-slot-value
434 #:sql-userenv
435 ;; CLSQL Extensions
436 #:sql-concat
437 #:sql-substring
438 #:sql-limit
439 #:sql-group-by
440 #:sql-having
441 #:sql-not-null
442 #:sql-exists
443 #:sql-uplike
444 #:sql-is
445 #:sql-==
446 #:sql-the
447 #:sql-coalesce
448 #:sql-view-class
450 ;; Time handling (time.lisp)
451 #:bad-component
452 #:current-day
453 #:current-month
454 #:current-year
455 #:day-duration
456 #:db-timestring
457 #:db-datestring
458 #:decode-duration
459 #:decode-time
460 #:decode-date
461 #:duration
462 #:duration+
463 #:duration<
464 #:duration<=
465 #:duration=
466 #:duration>
467 #:duration>=
468 #:duration-day
469 #:duration-hour
470 #:duration-minute
471 #:duration-month
472 #:duration-second
473 #:duration-year
474 #:duration-reduce
475 #:duration-timestring
476 #:extract-roman
477 #:format-duration
478 #:format-time
479 #:format-date
480 #:get-time
481 #:get-date
482 #:utime->time
483 #:interval-clear
484 #:interval-contained
485 #:interval-data
486 #:interval-edit
487 #:interval-end
488 #:interval-match
489 #:interval-push
490 #:interval-relation
491 #:interval-start
492 #:interval-type
493 #:make-duration
494 #:make-interval
495 #:make-time
496 #:make-date
497 #:merged-time
498 #:midnight
499 #:month-name
500 #:parse-date-time
501 #:parse-timestring
502 #:parse-datestring
503 #:parse-yearstring
504 #:print-date
505 #:roll
506 #:roll-to
507 #:time
508 #:time+
509 #:time-
510 #:time-by-adding-duration
511 #:time-compare
512 #:time-difference
513 #:time-dow
514 #:time-element
515 #:time-max
516 #:time-min
517 #:time-mjd
518 #:time-msec
519 #:time-p
520 #:time-sec
521 #:time-well-formed
522 #:time-ymd
523 #:time<
524 #:time<=
525 #:time=
526 #:time>
527 #:time>=
528 #:date
529 #:date+
530 #:date-
531 #:date-difference
532 #:date-compare
533 #:date-dow
534 #:date-element
535 #:date-max
536 #:date-min
537 #:date-mjd
538 #:date-p
539 #:date-ymd
540 #:date<
541 #:date<=
542 #:date=
543 #:date>
544 #:date>=
545 #:timezone
546 #:universal-time
547 #:wall-time
548 #:wall-timestring
549 #:week-containing
550 #:gregorian-to-mjd
551 #:mjd-to-gregorian
552 #:iso-timestring
554 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
557 (defpackage #:clsql
558 (:use #:common-lisp)
559 (:import-from #:clsql-sys . #1#)
560 (:export . #1#)
561 (:documentation "This is the user package with CLSQL symbols."))
563 (defpackage #:clsql-user
564 (:use #:common-lisp)
565 (:import-from #:clsql-sys . #1#)
566 (:export . #1#)
567 (:documentation "This is the user package with CLSQL symbols."))
569 ;; This is from USQL's pcl-patch
570 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
571 (progn
572 ;; Note that this will no longer required for cmucl as of version 19a.
573 (in-package #+cmu :pcl #+sbcl :sb-pcl)
574 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
575 &body body)
576 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
577 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
578 slot-vars pv-parameters))
579 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
580 ,@body))))
582 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
583 #+lispworks
584 (setf *packages-for-warn-on-redefinition*
585 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
587 #+sbcl
588 (if (find-package 'sb-mop)
589 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
590 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
592 #+cmu
593 (if (find-package 'mop)
594 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
595 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))
597 ) ;eval-when