2 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
3 ;;;; *************************************************************************
4 ;;;; FILE IDENTIFICATION
6 ;;;; Name: package.lisp
7 ;;;; Purpose: Package definition for SQL interface
9 ;;;; This file is part of CLSQL.
11 ;;;; CLSQL users are granted the rights to distribute and use this software
12 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
13 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
14 ;;;; *************************************************************************
16 (in-package #:cl-user)
18 ;;;; This file makes the required package definitions for CLSQL's
21 (eval-when (:compile-toplevel :load-toplevel :execute)
23 (if (find-package 'sb-mop)
24 (pushnew :clsql-sbcl-mop cl:*features*)
25 (pushnew :clsql-sbcl-pcl cl:*features*))
28 (if (eq (symbol-package 'pcl:find-class)
29 (find-package 'common-lisp))
30 (pushnew :clsql-cmucl-mop cl:*features*)
31 (pushnew :clsql-cmucl-pcl cl:*features*)))
34 (eval-when (:compile-toplevel :load-toplevel :execute)
35 (defpackage #:clsql-sys
37 #+clsql-sbcl-mop #:sb-mop
38 #+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
215 #:generic-postgresql-database
216 #:generic-odbc-database
218 ;; Subclasses of sql-expresssion (expressions.lisp)
222 #:sql-query-modifier-exp
229 #:sql-ident-attribute
234 ;; Shared exports for re-export by CLSQL package.
237 ;; foreign library loading
238 #:*foreign-library-search-paths*
241 ;; Condition system (conditions.lisp)
244 #:sql-database-data-error
245 #:sql-connection-error
246 #:sql-temporary-error
250 #:sql-error-secondary-error-id
251 #:sql-error-database-message
256 #:sql-database-warning
258 #:sql-error-database-type
259 #:sql-error-connection-spec
260 #:sql-error-expression
261 #:sql-warning-database
262 #:sql-user-error-message
263 #:*backend-warning-behavior*
265 ;; Connection/initialisation (base-classes.lisp, database.lisp,
267 #:*default-database-type*
269 #:*initialized-database-types*
270 #:initialize-database-type
273 #:*connect-if-exists*
274 #:connected-databases
281 #:database-name-from-spec
284 #:with-default-database
291 ;; I/O Recording (recording.lisp)
297 #:start-sql-recording
307 #:list-attribute-types
324 #:set-sequence-position
328 #:cache-table-queries
329 #:*cache-table-queries-default*
345 ;; Transaction handling (transaction.lisp)
350 #:add-transaction-commit-hook
351 #:add-transaction-rollback-hook
356 ;; OODDL (ooddl.lisp)
359 #:create-view-from-class
360 #:drop-view-from-class
367 #:generalized-boolean
371 #:*default-string-length*
373 ;; OODML (oodml.lisp)
375 #:update-objects-joins
376 #:*default-update-objects-max-len*
378 #:update-slot-from-record
379 #:update-instance-from-records
380 #:update-records-from-instance
381 #:update-record-from-slot
382 #:update-record-from-slots
383 #:delete-instance-records
386 #:write-instance-to-stream
387 #:read-instance-from-stream
389 ;; Symbolic SQL Syntax (syntax.lisp)
394 #:disable-sql-reader-syntax
395 #:enable-sql-reader-syntax
396 #:locally-disable-sql-reader-syntax
397 #:locally-enable-sql-reader-syntax
398 #:restore-sql-reader-syntax-state
399 #:file-enable-sql-reader-syntax
401 ;; SQL operations (operations.lisp)
456 ;; Time handling (time.lisp)
481 #:duration-timestring
516 #:time-by-adding-duration
560 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
565 (:import-from #:clsql-sys . #1#)
567 (:documentation "This is the user package with CLSQL symbols."))
569 (defpackage #:clsql-user
571 (:import-from #:clsql-sys . #1#)
573 (:documentation "This is the user package with CLSQL symbols."))
575 ;; This is from USQL's pcl-patch
576 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
578 ;; Note that this will no longer required for cmucl as of version 19a.
579 (in-package #+cmu :pcl #+sbcl :sb-pcl)
580 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
582 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
583 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
584 slot-vars pv-parameters))
585 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
588 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
590 (setf *packages-for-warn-on-redefinition*
591 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
594 (if (find-package 'sb-mop)
595 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
596 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
599 (if (find-package 'mop)
600 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
601 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))