1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: package.lisp
6 ;;;; Purpose: Package definition for SQL interface
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 ;;;; This file makes the required package definitions for CLSQL's
20 (eval-when (:compile-toplevel :load-toplevel :execute)
22 (if (find-package 'sb-mop)
23 (pushnew :clsql-sbcl-mop cl:*features*)
24 (pushnew :clsql-sbcl-pcl cl:*features*))
27 (if (eq (symbol-package 'pcl:find-class)
28 (find-package 'common-lisp))
29 (pushnew :clsql-cmucl-mop cl:*features*)
30 (pushnew :clsql-cmucl-pcl cl:*features*)))
33 (eval-when (:compile-toplevel :load-toplevel :execute)
34 (defpackage #:clsql-sys
36 #+clsql-sbcl-mop #:sb-mop
37 #+clsql-cmucl-mop #:mop
43 #+openmcl #:openmcl-mop)
46 (:shadowing-import-from
49 (:shadowing-import-from
52 (:shadowing-import-from
55 (:shadowing-import-from
57 #:generic-function-lambda-list)
59 (:shadowing-import-from
63 #:class-of #:class-name #:class-slots #:find-class
66 #:slot-definition-name #:finalize-inheritance
67 #:standard-direct-slot-definition
68 #:standard-effective-slot-definition #:validate-superclass
69 #:direct-slot-definition-class #:compute-effective-slot-definition
70 #:effective-slot-definition-class
71 #:slot-value-using-class
72 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
73 #:make-method-lambda #:generic-function-lambda-list
74 #:class-precedence-list #:slot-definition-type
75 #:class-direct-superclasses
76 #:compute-class-precedence-list)
78 (:shadowing-import-from
80 #:generic-function-lambda-list)
82 (:shadowing-import-from
86 #:class-of #:class-name #:class-slots #:find-class #:standard-class
88 #:slot-definition-name #:finalize-inheritance
89 #:standard-direct-slot-definition #:standard-effective-slot-definition
90 #:validate-superclass #:direct-slot-definition-class
91 #:effective-slot-definition-class
92 #:compute-effective-slot-definition
93 #:slot-value-using-class
94 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
95 #:make-method-lambda #:generic-function-lambda-list
96 #:class-precedence-list #:slot-definition-type
97 #:class-direct-superclasses
98 #:compute-class-precedence-list)
100 (:shadowing-import-from
102 #:class-prototype ;; note: make-method-lambda is not fbound
106 ;; "Private" exports for use by interface packages
107 #:check-connection-spec
108 #:database-initialize-database-type
109 #:database-type-load-foreign
111 #: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-last-auto-increment-id
134 #:database-list-attributes
135 #:database-attribute-type
136 #:database-type-library-loaded
141 #:database-acquire-from-conn-pool
142 #:database-release-to-conn-pool
144 #:db-backend-has-create/destroy-db?
146 #:db-type-has-bigint?
148 #:db-type-has-prepared-stmt?
149 #:db-type-has-subqueries?
150 #:db-type-has-boolean-where?
151 #:db-type-transaction-capable?
152 #:db-type-has-fancy-math?
153 #:db-type-default-case
154 #:db-type-use-column-on-drop-index?
155 #:db-type-use-fully-qualified-column-on-drop-index?
156 #:db-type-has-intersect?
157 #:db-type-has-except?
158 #:db-type-has-auto-increment?
159 #:database-underlying-type
160 #:database-get-type-specifier
162 #:database-output-sql-as-type
163 #:*loaded-database-types*
164 #:reload-database-types
166 #:*db-pool-max-free-connections*
169 #:database-create-large-object
170 #:database-write-large-object
171 #:database-read-large-object
172 #:database-delete-large-object
173 #:create-large-object
176 #:delete-large-object
178 ;; Prepared statments
180 #:database-run-prepared
181 #:database-bind-parameter
182 #:database-free-prepared
184 ;; accessors for database class
190 #:command-recording-stream
191 #:result-recording-stream
196 #:database-autocommit
204 #:symbol-name-default-case
205 #:convert-to-db-default-case
208 #:number-to-sql-string
209 #:float-to-sql-string
214 ;; Command-object.lisp
217 #:prepare-sql-parameter
221 #:reset-command-object
224 #:generic-postgresql-database
225 #:generic-odbc-database
227 ;; Subclasses of sql-expresssion (expressions.lisp)
231 #:sql-query-modifier-exp
238 #:sql-ident-attribute
243 ;; Shared exports for re-export by CLSQL package.
246 ;; foreign library loading
247 #:*foreign-library-search-paths*
250 ;; Condition system (conditions.lisp)
253 #:sql-database-data-error
254 #:sql-connection-error
255 #:sql-temporary-error
259 #:sql-error-secondary-error-id
260 #:sql-error-database-message
265 #:sql-database-warning
267 #:sql-error-database-type
268 #:sql-error-connection-spec
269 #:sql-error-expression
270 #:sql-warning-database
271 #:sql-user-error-message
272 #:*backend-warning-behavior*
274 ;; Connection/initialisation (base-classes.lisp, database.lisp,
276 #:*default-database-type*
278 #:*initialized-database-types*
279 #:initialize-database-type
282 #:*connect-if-exists*
283 #:connected-databases
290 #:database-name-from-spec
293 #:with-default-database
300 ;; I/O Recording (recording.lisp)
306 #:start-sql-recording
316 #:list-attribute-types
333 #:set-sequence-position
334 #:*old-sequence-names*
338 #:cache-table-queries
339 #:*cache-table-queries-default*
355 ;; Transaction handling (transaction.lisp)
360 #:add-transaction-commit-hook
361 #:add-transaction-rollback-hook
366 ;; OODDL (ooddl.lisp)
369 #:create-view-from-class
370 #:drop-view-from-class
379 #:generalized-boolean
383 #:*default-string-length*
385 ;; OODML (oodml.lisp)
392 #:update-objects-joins
393 #:*default-update-objects-max-len*
395 #:update-slot-from-record
396 #:update-instance-from-records
397 #:update-records-from-instance
398 #:update-record-from-slot
399 #:update-record-from-slots
400 #:delete-instance-records
403 #:write-instance-to-stream
404 #:read-instance-from-stream
406 ;; Symbolic SQL Syntax (syntax.lisp)
411 #:disable-sql-reader-syntax
412 #:enable-sql-reader-syntax
413 #:locally-disable-sql-reader-syntax
414 #:locally-enable-sql-reader-syntax
415 #:restore-sql-reader-syntax-state
416 #:file-enable-sql-reader-syntax
418 ;; SQL operations (operations.lisp)
473 ;; Time handling (time.lisp)
498 #:duration-timestring
533 #:time-by-adding-duration
577 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
582 (:import-from #:clsql-sys . #1#)
584 (:documentation "This is the user package with CLSQL symbols."))
586 (defpackage #:clsql-user
588 (:import-from #:clsql-sys . #1#)
590 (:documentation "This is the user package with CLSQL symbols."))
592 ;; This is from USQL's pcl-patch
593 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
595 ;; Note that this will no longer required for cmucl as of version 19a.
596 (in-package #+cmu :pcl #+sbcl :sb-pcl)
597 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
599 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
600 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
601 slot-vars pv-parameters))
602 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
605 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
607 (setf *packages-for-warn-on-redefinition*
608 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
611 (if (find-package 'sb-mop)
612 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
613 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
616 (if (find-package 'mop)
617 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
618 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))