1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: package.lisp
6 ;;;; Purpose: Package definition for SQL interface
10 ;;;; This file is part of CLSQL.
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
22 (eval-when (:compile-toplevel :load-toplevel :execute)
24 (if (find-package 'sb-mop)
25 (pushnew :clsql-sbcl-mop cl:*features*)
26 (pushnew :clsql-sbcl-pcl cl:*features*))
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
38 #+clsql-sbcl-mop #:sb-mop
39 #+clsql-cmucl-mop #:mop
44 #+openmcl #:openmcl-mop)
47 (:shadowing-import-from
50 (:shadowing-import-from
53 (:shadowing-import-from
56 (:shadowing-import-from
58 #:generic-function-lambda-list)
60 (:shadowing-import-from
64 #:class-of #:class-name #:class-slots #:find-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)
79 (:shadowing-import-from
81 #:generic-function-lambda-list)
83 (:shadowing-import-from
87 #:class-of #:class-name #:class-slots #:find-class #:standard-class
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)
101 (:shadowing-import-from
103 #:class-prototype ;; note: make-method-lambda is not fbound
107 ;; "Private" exports for use by interface packages
108 #:check-connection-spec
109 #:database-initialize-database-type
110 #:database-type-load-foreign
112 #:database-disconnect
114 #:database-execute-command
115 #:database-create-sequence
116 #:database-drop-sequence
117 #:database-sequence-next
118 #:database-set-sequence-position
119 #:database-query-result-set
120 #:database-dump-result-set
121 #:database-store-next-row
122 #:database-list-tables
123 #:database-list-tables-and-sequences
124 #:database-table-exists-p
125 #:database-list-views
126 #:database-view-exists-p
127 #:database-list-indexes
128 #:database-list-table-indexes
129 #:database-index-exists-p
130 #:database-list-sequences
131 #:database-sequence-last
132 #:database-sequence-exists-p
133 #:database-list-attributes
134 #:database-attribute-type
135 #:database-type-library-loaded
141 #:db-backend-has-create/destroy-db?
143 #:db-type-has-bigint?
145 #:db-type-has-prepared-stmt?
146 #:db-type-has-subqueries?
147 #:db-type-has-boolean-where?
148 #:db-type-transaction-capable?
149 #:db-type-has-fancy-math?
150 #:db-type-default-case
151 #:db-type-use-column-on-drop-index?
152 #:database-underlying-type
153 #:database-get-type-specifier
155 #:database-output-sql-as-type
156 #:*loaded-database-types*
157 #:reload-database-types
161 #:database-create-large-object
162 #:database-write-large-object
163 #:database-read-large-object
164 #:database-delete-large-object
165 #:create-large-object
168 #:delete-large-object
170 ;; Prepared statments
172 #:database-run-prepared
173 #:database-bind-parameter
174 #:database-free-prepared
176 ;; accessors for database class
182 #:command-recording-stream
183 #:result-recording-stream
188 #:database-autocommit
195 #:symbol-name-default-case
196 #:convert-to-db-default-case
199 #:number-to-sql-string
200 #:float-to-sql-string
206 #:generic-postgresql-database
207 #:generic-odbc-database
209 ;; Subclasses of sql-expresssion (expressions.lisp)
213 #:sql-query-modifier-exp
220 #:sql-ident-attribute
225 ;; Shared exports for re-export by CLSQL package.
228 ;; Condition system (conditions.lisp)
231 #:sql-database-data-error
232 #:sql-connection-error
233 #:sql-temporary-error
237 #:sql-error-secondary-error-id
238 #:sql-error-database-message
243 #:sql-database-warning
245 #:sql-error-database-type
246 #:sql-error-connection-spec
247 #:sql-error-expression
248 #:sql-warning-database
249 #:sql-user-error-message
250 #:*backend-warning-behavior*
252 ;; Connection/initialisation (base-classes.lisp, database.lisp,
254 #:*default-database-type*
256 #:*initialized-database-types*
257 #:initialize-database-type
260 #:*connect-if-exists*
261 #:connected-databases
268 #:database-name-from-spec
271 #:with-default-database
278 ;; I/O Recording (recording.lisp)
284 #:start-sql-recording
294 #:list-attribute-types
311 #:set-sequence-position
315 #:cache-table-queries
316 #:*cache-table-queries-default*
332 ;; Transaction handling (transaction.lisp)
337 #:add-transaction-commit-hook
338 #:add-transaction-rollback-hook
343 ;; OODDL (ooddl.lisp)
346 #:create-view-from-class
347 #:drop-view-from-class
354 #:generalized-boolean
357 #:*default-string-length*
359 ;; OODML (oodml.lisp)
361 #:update-objects-joins
362 #:*default-update-objects-max-len*
363 #:update-slot-from-record
364 #:update-instance-from-records
365 #:update-records-from-instance
366 #:update-record-from-slot
367 #:update-record-from-slots
368 #:delete-instance-records
371 #:write-instance-to-stream
372 #:read-instance-from-stream
374 ;; Symbolic SQL Syntax (syntax.lisp)
379 #:disable-sql-reader-syntax
380 #:enable-sql-reader-syntax
381 #:locally-disable-sql-reader-syntax
382 #:locally-enable-sql-reader-syntax
383 #:restore-sql-reader-syntax-state
385 ;; SQL operations (operations.lisp)
440 ;; Time handling (time.lisp)
463 #:duration-timestring
494 #:time-by-adding-duration
520 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
525 (:import-from #:clsql-sys . #1#)
527 (:documentation "This is the user package with CLSQL symbols."))
529 (defpackage #:clsql-user
531 (:import-from #:clsql-sys . #1#)
533 (:documentation "This is the user package with CLSQL symbols."))
535 ;; This is from USQL's pcl-patch
536 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
538 ;; Note that this will no longer required for cmucl as of version 19a.
539 (in-package #+cmu :pcl #+sbcl :sb-pcl)
540 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
542 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
543 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
544 slot-vars pv-parameters))
545 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
548 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
550 (setf *packages-for-warn-on-redefinition*
551 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
554 (if (find-package 'sb-mop)
555 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
556 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
559 (if (find-package 'mop)
560 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
561 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))