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
43 #+openmcl #:openmcl-mop)
46 (:shadowing-import-from
49 (:shadowing-import-from
52 (:shadowing-import-from
54 #:generic-function-lambda-list)
56 (:shadowing-import-from
60 #:class-of #:class-name #:class-slots #:find-class
63 #:slot-definition-name #:finalize-inheritance
64 #:standard-direct-slot-definition
65 #:standard-effective-slot-definition #:validate-superclass
66 #:direct-slot-definition-class #:compute-effective-slot-definition
67 #:effective-slot-definition-class
68 #:slot-value-using-class
69 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
70 #:make-method-lambda #:generic-function-lambda-list
71 #:class-precedence-list #:slot-definition-type
72 #:class-direct-superclasses
73 #:compute-class-precedence-list)
75 (:shadowing-import-from
77 #:generic-function-lambda-list)
79 (:shadowing-import-from
83 #:class-of #:class-name #:class-slots #:find-class #:standard-class
85 #:slot-definition-name #:finalize-inheritance
86 #:standard-direct-slot-definition #:standard-effective-slot-definition
87 #:validate-superclass #:direct-slot-definition-class
88 #:effective-slot-definition-class
89 #:compute-effective-slot-definition
90 #:slot-value-using-class
91 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
92 #:make-method-lambda #:generic-function-lambda-list
93 #:class-precedence-list #:slot-definition-type
94 #:class-direct-superclasses
95 #:compute-class-precedence-list)
97 (:shadowing-import-from
99 #:class-prototype ;; note: make-method-lambda is not fbound
103 ;; "Private" exports for use by interface packages
104 #:check-connection-spec
105 #:database-initialize-database-type
106 #:database-type-load-foreign
107 #:database-name-from-spec
109 #:database-disconnect
111 #:database-execute-command
112 #:database-create-sequence
113 #:database-drop-sequence
114 #:database-sequence-next
115 #:database-set-sequence-position
116 #:database-query-result-set
117 #:database-dump-result-set
118 #:database-store-next-row
119 #:database-list-tables
120 #:database-list-tables-and-sequences
121 #:database-table-exists-p
122 #:database-list-views
123 #:database-view-exists-p
124 #:database-list-indexes
125 #:database-list-table-indexes
126 #:database-index-exists-p
127 #:database-list-sequences
128 #:database-sequence-last
129 #:database-sequence-exists-p
130 #:database-list-attributes
131 #:database-attribute-type
132 #:database-describe-table
133 #:database-type-library-loaded
139 #:db-backend-has-create/destroy-db?
141 #:db-type-has-bigint?
143 #:db-type-has-prepared-stmt?
144 #:db-type-has-subqueries?
145 #:db-type-has-boolean-where?
146 #:db-type-transaction-capable?
147 #:db-type-has-fancy-math?
148 #:db-type-default-case
149 #:db-type-use-column-on-drop-index?
150 #:database-underlying-type
151 #:database-get-type-specifier
153 #:database-output-sql-as-type
154 #:*loaded-database-types*
155 #:reload-database-types
159 #:database-create-large-object
160 #:database-write-large-object
161 #:database-read-large-object
162 #:database-delete-large-object
163 #:create-large-object
166 #:delete-large-object
168 ;; Prepared statments
170 #:database-run-prepared
171 #:database-bind-parameter
172 #:database-free-prepared
174 ;; accessors for database class
180 #:command-recording-stream
181 #:result-recording-stream
187 #:database-autocommit
194 #:symbol-name-default-case
195 #:convert-to-db-default-case
198 #:number-to-sql-string
199 #:float-to-sql-string
205 #:generic-postgresql-database
206 #:generic-odbc-database
210 ;; Shared exports for re-export by CLSQL package.
213 ;; Condition system (conditions.lisp)
216 #:sql-database-data-error
217 #:sql-connection-error
218 #:sql-temporary-error
222 #:sql-error-secondary-error-id
223 #:sql-error-database-message
228 #:sql-database-warning
229 #:*backend-warning-behavior*
231 ;; Connection/initialisation (base-classes.lisp, database.lisp,
233 #:*default-database-type*
235 #:*initialized-database-types*
236 #:initialize-database-type
239 #:*connect-if-exists*
240 #:connected-databases
248 #:with-default-database
256 ;; I/O Recording (recording.lisp)
262 #:start-sql-recording
275 #:list-attribute-types
276 #:*cache-table-queries-default*
294 #:set-sequence-position
298 #:cache-table-queries
299 #:*cache-table-queries-default*
316 ;; Transaction handling (transaction.lisp)
322 #:rollback-transaction
323 #:add-transaction-commit-hook
324 #:add-transaction-rollback-hook
327 #:database-start-transaction
328 #:database-abort-transaction
329 #:database-commit-transaction
334 ;; OODDL (ooddl.lisp)
337 #:create-view-from-class
338 #:drop-view-from-class
345 #:*default-varchar-length*
347 ;; OODML (oodml.lisp)
349 #:update-objects-joins
350 #:*default-update-objects-max-len*
351 #:update-slot-from-record
352 #:update-instance-from-records
353 #:update-records-from-instance
354 #:update-record-from-slot
355 #:update-record-from-slots
356 #:delete-instance-records
360 ;; Symbolic SQL Syntax (syntax.lisp)
365 #:disable-sql-reader-syntax
366 #:enable-sql-reader-syntax
367 #:locally-disable-sql-reader-syntax
368 #:locally-enable-sql-reader-syntax
369 #:restore-sql-reader-syntax-state
371 ;; SQL operations (operations.lisp)
423 ;; Time handling (time.lisp)
446 #:duration-timestring
477 #:time-by-adding-duration
503 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
508 (:import-from #:clsql-sys . #1#)
510 (:documentation "This is the user package with CLSQL symbols."))
512 (defpackage #:clsql-user
514 (:import-from #:clsql-sys . #1#)
516 (:documentation "This is the user package with CLSQL symbols."))
518 ;; This is from USQL's pcl-patch
519 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
521 ;; Note that this will no longer required for cmucl as of version 19a.
522 (in-package #+cmu :pcl #+sbcl :sb-pcl)
523 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
525 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
526 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
527 slot-vars pv-parameters))
528 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
531 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
533 (setf *packages-for-warn-on-redefinition*
534 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
537 (if (find-package 'sb-mop)
538 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
539 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
542 (if (find-package 'mop)
543 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
544 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))