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
42 #+openmcl #:openmcl-mop)
45 (:shadowing-import-from
48 (:shadowing-import-from
51 (:shadowing-import-from
54 (:shadowing-import-from
56 #:generic-function-lambda-list)
58 (:shadowing-import-from
62 #:class-of #:class-name #:class-slots #:find-class
65 #:slot-definition-name #:finalize-inheritance
66 #:standard-direct-slot-definition
67 #:standard-effective-slot-definition #:validate-superclass
68 #:direct-slot-definition-class #:compute-effective-slot-definition
69 #:effective-slot-definition-class
70 #:slot-value-using-class
71 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
72 #:make-method-lambda #:generic-function-lambda-list
73 #:class-precedence-list #:slot-definition-type
74 #:class-direct-superclasses
75 #:compute-class-precedence-list)
77 (:shadowing-import-from
79 #:generic-function-lambda-list)
81 (:shadowing-import-from
85 #:class-of #:class-name #:class-slots #:find-class #:standard-class
87 #:slot-definition-name #:finalize-inheritance
88 #:standard-direct-slot-definition #:standard-effective-slot-definition
89 #:validate-superclass #:direct-slot-definition-class
90 #:effective-slot-definition-class
91 #:compute-effective-slot-definition
92 #:slot-value-using-class
93 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
94 #:make-method-lambda #:generic-function-lambda-list
95 #:class-precedence-list #:slot-definition-type
96 #:class-direct-superclasses
97 #:compute-class-precedence-list)
99 (:shadowing-import-from
101 #:class-prototype ;; note: make-method-lambda is not fbound
105 ;; "Private" exports for use by interface packages
106 #:check-connection-spec
107 #:database-initialize-database-type
108 #:database-type-load-foreign
110 #:database-disconnect
113 #:database-execute-command
114 #:database-create-sequence
115 #:database-drop-sequence
116 #:database-sequence-next
117 #:database-set-sequence-position
118 #:database-query-result-set
119 #:database-dump-result-set
120 #:database-store-next-row
121 #:database-list-tables
122 #:database-list-tables-and-sequences
123 #:database-table-exists-p
124 #:database-list-views
125 #:database-view-exists-p
126 #:database-list-indexes
127 #:database-list-table-indexes
128 #:database-index-exists-p
129 #:database-list-sequences
130 #:database-sequence-last
131 #:database-sequence-exists-p
132 #:database-last-auto-increment-id
133 #:database-list-attributes
134 #:database-attribute-type
135 #:database-type-library-loaded
140 #:database-acquire-from-conn-pool
141 #:database-release-to-conn-pool
143 #:db-backend-has-create/destroy-db?
145 #:db-type-has-bigint?
147 #:db-type-has-prepared-stmt?
148 #:db-type-has-subqueries?
149 #:db-type-has-boolean-where?
150 #:db-type-transaction-capable?
151 #:db-type-has-fancy-math?
152 #:db-type-default-case
153 #:db-type-use-column-on-drop-index?
154 #:db-type-use-fully-qualified-column-on-drop-index?
155 #:db-type-has-intersect?
156 #:db-type-has-except?
157 #:db-type-has-auto-increment?
158 #:database-underlying-type
159 #:database-get-type-specifier
161 #:database-output-sql-as-type
162 #:*loaded-database-types*
163 #:reload-database-types
165 #:*db-pool-max-free-connections*
168 #:database-create-large-object
169 #:database-write-large-object
170 #:database-read-large-object
171 #:database-delete-large-object
172 #:create-large-object
175 #:delete-large-object
177 ;; Prepared statments
179 #:database-run-prepared
180 #:database-bind-parameter
181 #:database-free-prepared
183 ;; accessors for database class
189 #:command-recording-stream
190 #:result-recording-stream
195 #:database-autocommit
203 #:symbol-name-default-case
204 #:convert-to-db-default-case
207 #:number-to-sql-string
208 #:float-to-sql-string
213 ;; Command-object.lisp
219 #:reset-command-object
222 #:generic-postgresql-database
223 #:generic-odbc-database
225 ;; Subclasses of sql-expresssion (expressions.lisp)
229 #:sql-query-modifier-exp
236 #:sql-ident-attribute
241 ;; Shared exports for re-export by CLSQL package.
244 ;; foreign library loading
245 #:*foreign-library-search-paths*
248 ;; Condition system (conditions.lisp)
251 #:sql-database-data-error
252 #:sql-connection-error
253 #:sql-temporary-error
257 #:sql-error-secondary-error-id
258 #:sql-error-database-message
263 #:sql-database-warning
265 #:sql-error-database-type
266 #:sql-error-connection-spec
267 #:sql-error-expression
268 #:sql-warning-database
269 #:sql-user-error-message
270 #:*backend-warning-behavior*
272 ;; Connection/initialisation (base-classes.lisp, database.lisp,
274 #:*default-database-type*
276 #:*initialized-database-types*
277 #:initialize-database-type
280 #:*connect-if-exists*
281 #:connected-databases
288 #:database-name-from-spec
291 #:with-default-database
298 ;; I/O Recording (recording.lisp)
304 #:start-sql-recording
314 #:list-attribute-types
331 #:set-sequence-position
335 #:cache-table-queries
336 #:*cache-table-queries-default*
352 ;; Transaction handling (transaction.lisp)
357 #:add-transaction-commit-hook
358 #:add-transaction-rollback-hook
363 ;; OODDL (ooddl.lisp)
366 #:create-view-from-class
367 #:drop-view-from-class
374 #:generalized-boolean
378 #:*default-string-length*
380 ;; OODML (oodml.lisp)
382 #:update-objects-joins
383 #:*default-update-objects-max-len*
385 #:update-slot-from-record
386 #:update-instance-from-records
387 #:update-records-from-instance
388 #:update-record-from-slot
389 #:update-record-from-slots
390 #:delete-instance-records
393 #:write-instance-to-stream
394 #:read-instance-from-stream
396 ;; Symbolic SQL Syntax (syntax.lisp)
401 #:disable-sql-reader-syntax
402 #:enable-sql-reader-syntax
403 #:locally-disable-sql-reader-syntax
404 #:locally-enable-sql-reader-syntax
405 #:restore-sql-reader-syntax-state
406 #:file-enable-sql-reader-syntax
408 ;; SQL operations (operations.lisp)
463 ;; Time handling (time.lisp)
488 #:duration-timestring
523 #:time-by-adding-duration
567 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
572 (:import-from #:clsql-sys . #1#)
574 (:documentation "This is the user package with CLSQL symbols."))
576 (defpackage #:clsql-user
578 (:import-from #:clsql-sys . #1#)
580 (:documentation "This is the user package with CLSQL symbols."))
582 ;; This is from USQL's pcl-patch
583 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
585 ;; Note that this will no longer required for cmucl as of version 19a.
586 (in-package #+cmu :pcl #+sbcl :sb-pcl)
587 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
589 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
590 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
591 slot-vars pv-parameters))
592 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
595 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
597 (setf *packages-for-warn-on-redefinition*
598 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
601 (if (find-package 'sb-mop)
602 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
603 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
606 (if (find-package 'mop)
607 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
608 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))