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-subqueries?
144 #:db-type-has-boolean-where?
145 #:db-type-transaction-capable?
146 #:db-type-has-fancy-math?
147 #:db-type-default-case
148 #:db-type-use-column-on-drop-index?
149 #:database-underlying-type
150 #:database-get-type-specifier
152 #:database-output-sql-as-type
153 #:*loaded-database-types*
154 #:reload-database-types
158 #:database-create-large-object
159 #:database-write-large-object
160 #:database-read-large-object
161 #:database-delete-large-object
162 #:create-large-object
165 #:delete-large-object
167 ;; accessors for database class
173 #:command-recording-stream
174 #:result-recording-stream
186 #:symbol-name-default-case
187 #:convert-to-db-default-case
190 #:number-to-sql-string
191 #:float-to-sql-string
197 #:generic-postgresql-database
198 #:generic-odbc-database
202 ;; Shared exports for re-export by CLSQL package.
205 ;; Condition system (conditions.lisp)
208 #:sql-database-data-error
209 #:sql-connection-error
210 #:sql-temporary-error
214 #:sql-error-secondary-error-id
215 #:sql-error-database-message
220 #:sql-database-warning
221 #:*backend-warning-behavior*
223 ;; Connection/initialisation (base-classes.lisp, database.lisp,
225 #:*default-database-type*
227 #:*initialized-database-types*
228 #:initialize-database-type
231 #:*connect-if-exists*
232 #:connected-databases
240 #:with-default-database
248 ;; I/O Recording (recording.lisp)
254 #:start-sql-recording
267 #:list-attribute-types
268 #:*cache-table-queries-default*
286 #:set-sequence-position
290 #:cache-table-queries
291 #:*cache-table-queries-default*
304 ;; Transaction handling (transaction.lisp)
310 #:rollback-transaction
311 #:add-transaction-commit-hook
312 #:add-transaction-rollback-hook
315 #:database-start-transaction
316 #:database-abort-transaction
317 #:database-commit-transaction
321 ;; OODDL (ooddl.lisp)
324 #:create-view-from-class
325 #:drop-view-from-class
332 ;; OODML (oodml.lisp)
334 #:update-objects-joins
335 #:*default-update-objects-max-len*
336 #:update-slot-from-record
337 #:update-instance-from-records
338 #:update-records-from-instance
339 #:update-record-from-slot
340 #:update-record-from-slots
341 #:delete-instance-records
345 ;; Symbolic SQL Syntax (syntax.lisp)
350 #:disable-sql-reader-syntax
351 #:enable-sql-reader-syntax
352 #:locally-disable-sql-reader-syntax
353 #:locally-enable-sql-reader-syntax
354 #:restore-sql-reader-syntax-state
356 ;; SQL operations (operations.lisp)
408 ;; Time handling (time.lisp)
431 #:duration-timestring
462 #:time-by-adding-duration
488 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
493 (:import-from #:clsql-sys . #1#)
495 (:documentation "This is the user package with CLSQL symbols."))
497 (defpackage #:clsql-user
499 (:import-from #:clsql-sys . #1#)
501 (:documentation "This is the user package with CLSQL symbols."))
503 ;; This is from USQL's pcl-patch
504 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
506 ;; Note that this will no longer required for cmucl as of version 19a.
507 (in-package #+cmu :pcl #+sbcl :sb-pcl)
508 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
510 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
511 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
512 slot-vars pv-parameters))
513 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
516 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
518 (setf *packages-for-warn-on-redefinition*
519 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
522 (if (find-package 'sb-mop)
523 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
524 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
527 (if (find-package 'mop)
528 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
529 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))