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
41 #+openmcl #:openmcl-mop)
44 (:shadowing-import-from
47 (:shadowing-import-from
50 (:shadowing-import-from
52 #:generic-function-lambda-list)
54 (:shadowing-import-from
58 #:class-of #:class-name #:class-slots #:find-class
61 #:slot-definition-name #:finalize-inheritance
62 #:standard-direct-slot-definition
63 #:standard-effective-slot-definition #:validate-superclass
64 #:direct-slot-definition-class #:compute-effective-slot-definition
65 #:effective-slot-definition-class
66 #:slot-value-using-class
67 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
68 #:make-method-lambda #:generic-function-lambda-list
69 #:class-precedence-list #:slot-definition-type
70 #:class-direct-superclasses
71 #:compute-class-precedence-list)
73 (:shadowing-import-from
75 #:generic-function-lambda-list)
77 (:shadowing-import-from
81 #:class-of #:class-name #:class-slots #:find-class #:standard-class
83 #:slot-definition-name #:finalize-inheritance
84 #:standard-direct-slot-definition #:standard-effective-slot-definition
85 #:validate-superclass #:direct-slot-definition-class
86 #:effective-slot-definition-class
87 #:compute-effective-slot-definition
88 #:slot-value-using-class
89 #:class-prototype #:generic-function-method-class #:intern-eql-specializer
90 #:make-method-lambda #:generic-function-lambda-list
91 #:class-precedence-list #:slot-definition-type
92 #:class-direct-superclasses
93 #:compute-class-precedence-list)
95 (:shadowing-import-from
97 #:class-prototype ;; note: make-method-lambda is not fbound
101 ;; "Private" exports for use by interface packages
102 #:check-connection-spec
103 #:database-initialize-database-type
104 #:database-type-load-foreign
105 #:database-name-from-spec
107 #:database-disconnect
109 #:database-execute-command
110 #:database-create-sequence
111 #:database-drop-sequence
112 #:database-sequence-next
113 #:database-set-sequence-position
114 #:database-query-result-set
115 #:database-dump-result-set
116 #:database-store-next-row
117 #:database-list-tables
118 #:database-list-tables-and-sequences
119 #:database-table-exists-p
120 #:database-list-views
121 #:database-view-exists-p
122 #:database-list-indexes
123 #:database-list-table-indexes
124 #:database-index-exists-p
125 #:database-list-sequences
126 #:database-sequence-last
127 #:database-sequence-exists-p
128 #:database-list-attributes
129 #:database-attribute-type
130 #:database-describe-table
131 #:database-type-library-loaded
137 #:db-backend-has-create/destroy-db?
139 #:db-type-has-bigint?
141 #:db-type-has-subqueries?
142 #:db-type-has-boolean-where?
143 #:db-type-transaction-capable?
144 #:db-type-has-fancy-math?
145 #:db-type-default-case
146 #:db-type-use-column-on-drop-index?
147 #:database-underlying-type
148 #:database-get-type-specifier
150 #:database-output-sql-as-type
151 #:*loaded-database-types*
152 #:reload-database-types
156 #:database-create-large-object
157 #:database-write-large-object
158 #:database-read-large-object
159 #:database-delete-large-object
160 #:create-large-object
163 #:delete-large-object
165 ;; accessors for database class
171 #:command-recording-stream
172 #:result-recording-stream
184 #:symbol-name-default-case
185 #:convert-to-db-default-case
188 #:number-to-sql-string
189 #:float-to-sql-string
194 #:generic-postgresql-database
195 #:generic-odbc-database
199 ;; Shared exports for re-export by CLSQL package.
202 ;; Condition system (conditions.lisp)
205 #:sql-database-data-error
206 #:sql-connection-error
207 #:sql-temporary-error
211 #:sql-error-secondary-error-id
212 #:sql-error-database-message
217 #:sql-database-warning
218 #:*backend-warning-behavior*
220 ;; Connection/initialisation (base-classes.lisp, database.lisp,
222 #:*default-database-type*
224 #:*initialized-database-types*
225 #:initialize-database-type
228 #:*connect-if-exists*
229 #:connected-databases
237 #:with-default-database
245 ;; I/O Recording (recording.lisp)
251 #:start-sql-recording
264 #:list-attribute-types
265 #:*cache-table-queries-default*
283 #:set-sequence-position
287 #:cache-table-queries
288 #:*cache-table-queries-default*
301 ;; Transaction handling (transaction.lisp)
307 #:rollback-transaction
308 #:add-transaction-commit-hook
309 #:add-transaction-rollback-hook
312 #:database-start-transaction
313 #:database-abort-transaction
314 #:database-commit-transaction
318 ;; OODDL (ooddl.lisp)
321 #:create-view-from-class
322 #:drop-view-from-class
329 ;; OODML (oodml.lisp)
331 #:update-objects-joins
332 #:*default-update-objects-max-len*
333 #:update-slot-from-record
334 #:update-instance-from-records
335 #:update-records-from-instance
336 #:update-record-from-slot
337 #:update-record-from-slots
338 #:delete-instance-records
342 ;; Symbolic SQL Syntax (syntax.lisp)
347 #:disable-sql-reader-syntax
348 #:enable-sql-reader-syntax
349 #:locally-disable-sql-reader-syntax
350 #:locally-enable-sql-reader-syntax
351 #:restore-sql-reader-syntax-state
353 ;; SQL operations (operations.lisp)
405 ;; Time handling (time.lisp)
428 #:duration-timestring
459 #:time-by-adding-duration
485 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
490 (:import-from #:clsql-sys . #1#)
492 (:documentation "This is the user package with CLSQL symbols."))
494 (defpackage #:clsql-user
496 (:import-from #:clsql-sys . #1#)
498 (:documentation "This is the user package with CLSQL symbols."))
500 ;; This is from USQL's pcl-patch
501 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
503 ;; Note that this will no longer required for cmucl as of version 19a.
504 (in-package #+cmu :pcl #+sbcl :sb-pcl)
505 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
507 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
508 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
509 slot-vars pv-parameters))
510 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
513 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
515 (setf *packages-for-warn-on-redefinition*
516 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
519 (if (find-package 'sb-mop)
520 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
521 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
524 (if (find-package 'mop)
525 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
526 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))