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
44 #+openmcl
#:openmcl-mop
)
47 (:shadowing-import-from
50 (:shadowing-import-from
53 (:shadowing-import-from
56 (:shadowing-import-from
58 #:generic-function-lambda-list
)
60 (:shadowing-import-from
64 #:class-of
#:class-name
#:class-slots
#:find-class
67 #:slot-definition-name
#:finalize-inheritance
68 #:standard-direct-slot-definition
69 #:standard-effective-slot-definition
#:validate-superclass
70 #:direct-slot-definition-class
#:compute-effective-slot-definition
71 #:effective-slot-definition-class
72 #:slot-value-using-class
73 #:class-prototype
#:generic-function-method-class
#:intern-eql-specializer
74 #:make-method-lambda
#:generic-function-lambda-list
75 #:class-precedence-list
#:slot-definition-type
76 #:class-direct-superclasses
77 #:compute-class-precedence-list
)
79 (:shadowing-import-from
81 #:generic-function-lambda-list
)
83 (:shadowing-import-from
87 #:class-of
#:class-name
#:class-slots
#:find-class
#:standard-class
89 #:slot-definition-name
#:finalize-inheritance
90 #:standard-direct-slot-definition
#:standard-effective-slot-definition
91 #:validate-superclass
#:direct-slot-definition-class
92 #:effective-slot-definition-class
93 #:compute-effective-slot-definition
94 #:slot-value-using-class
95 #:class-prototype
#:generic-function-method-class
#:intern-eql-specializer
96 #:make-method-lambda
#:generic-function-lambda-list
97 #:class-precedence-list
#:slot-definition-type
98 #:class-direct-superclasses
99 #:compute-class-precedence-list
)
101 (:shadowing-import-from
103 #:class-prototype
;; note: make-method-lambda is not fbound
107 ;; "Private" exports for use by interface packages
108 #:check-connection-spec
109 #:database-initialize-database-type
110 #:database-type-load-foreign
112 #:database-disconnect
115 #:database-execute-command
116 #:database-create-sequence
117 #:database-drop-sequence
118 #:database-sequence-next
119 #:database-set-sequence-position
120 #:database-query-result-set
121 #:database-dump-result-set
122 #:database-store-next-row
123 #:database-list-tables
124 #:database-list-tables-and-sequences
125 #:database-table-exists-p
126 #:database-list-views
127 #:database-view-exists-p
128 #:database-list-indexes
129 #:database-list-table-indexes
130 #:database-index-exists-p
131 #:database-list-sequences
132 #:database-sequence-last
133 #:database-sequence-exists-p
134 #:database-list-attributes
135 #:database-attribute-type
136 #:database-type-library-loaded
142 #:db-backend-has-create
/destroy-db?
144 #:db-type-has-bigint?
146 #:db-type-has-prepared-stmt?
147 #:db-type-has-subqueries?
148 #:db-type-has-boolean-where?
149 #:db-type-transaction-capable?
150 #:db-type-has-fancy-math?
151 #:db-type-default-case
152 #:db-type-use-column-on-drop-index?
153 #:database-underlying-type
154 #:database-get-type-specifier
156 #:database-output-sql-as-type
157 #:*loaded-database-types
*
158 #:reload-database-types
162 #:database-create-large-object
163 #:database-write-large-object
164 #:database-read-large-object
165 #:database-delete-large-object
166 #:create-large-object
169 #:delete-large-object
171 ;; Prepared statments
173 #:database-run-prepared
174 #:database-bind-parameter
175 #:database-free-prepared
177 ;; accessors for database class
183 #:command-recording-stream
184 #:result-recording-stream
189 #:database-autocommit
196 #:symbol-name-default-case
197 #:convert-to-db-default-case
200 #:number-to-sql-string
201 #:float-to-sql-string
207 #:generic-postgresql-database
208 #:generic-odbc-database
210 ;; Subclasses of sql-expresssion (expressions.lisp)
214 #:sql-query-modifier-exp
221 #:sql-ident-attribute
226 ;; Shared exports for re-export by CLSQL package.
229 ;; foreign library loading
230 #:*foreign-library-search-paths
*
233 ;; Condition system (conditions.lisp)
236 #:sql-database-data-error
237 #:sql-connection-error
238 #:sql-temporary-error
242 #:sql-error-secondary-error-id
243 #:sql-error-database-message
248 #:sql-database-warning
250 #:sql-error-database-type
251 #:sql-error-connection-spec
252 #:sql-error-expression
253 #:sql-warning-database
254 #:sql-user-error-message
255 #:*backend-warning-behavior
*
257 ;; Connection/initialisation (base-classes.lisp, database.lisp,
259 #:*default-database-type
*
261 #:*initialized-database-types
*
262 #:initialize-database-type
265 #:*connect-if-exists
*
266 #:connected-databases
273 #:database-name-from-spec
276 #:with-default-database
283 ;; I/O Recording (recording.lisp)
289 #:start-sql-recording
299 #:list-attribute-types
316 #:set-sequence-position
320 #:cache-table-queries
321 #:*cache-table-queries-default
*
337 ;; Transaction handling (transaction.lisp)
342 #:add-transaction-commit-hook
343 #:add-transaction-rollback-hook
348 ;; OODDL (ooddl.lisp)
351 #:create-view-from-class
352 #:drop-view-from-class
359 #:generalized-boolean
363 #:*default-string-length
*
365 ;; OODML (oodml.lisp)
367 #:update-objects-joins
368 #:*default-update-objects-max-len
*
370 #:update-slot-from-record
371 #:update-instance-from-records
372 #:update-records-from-instance
373 #:update-record-from-slot
374 #:update-record-from-slots
375 #:delete-instance-records
378 #:write-instance-to-stream
379 #:read-instance-from-stream
381 ;; Symbolic SQL Syntax (syntax.lisp)
386 #:disable-sql-reader-syntax
387 #:enable-sql-reader-syntax
388 #:locally-disable-sql-reader-syntax
389 #:locally-enable-sql-reader-syntax
390 #:restore-sql-reader-syntax-state
392 ;; SQL operations (operations.lisp)
447 ;; Time handling (time.lisp)
472 #:duration-timestring
507 #:time-by-adding-duration
550 (:documentation
"This is the INTERNAL SQL-Interface package of CLSQL."))
555 (:import-from
#:clsql-sys .
#1#)
557 (:documentation
"This is the user package with CLSQL symbols."))
559 (defpackage #:clsql-user
561 (:import-from
#:clsql-sys .
#1#)
563 (:documentation
"This is the user package with CLSQL symbols."))
565 ;; This is from USQL's pcl-patch
566 #+(or clsql-sbcl-pcl clsql-cmucl-pcl
)
568 ;; Note that this will no longer required for cmucl as of version 19a.
569 (in-package #+cmu
:pcl
#+sbcl
:sb-pcl
)
570 (defmacro pv-binding1
((pv calls pv-table-symbol pv-parameters slot-vars
)
572 `(pv-env (,pv
,calls
,pv-table-symbol
,pv-parameters
)
573 (let (,@(mapcar #'(lambda (slot-var p
) `(,slot-var
(get-slots-or-nil ,p
)))
574 slot-vars pv-parameters
))
575 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var
))) slot-vars
)
578 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
580 (setf *packages-for-warn-on-redefinition
*
581 (delete "SQL" *packages-for-warn-on-redefinition
* :test
'string
=))
584 (if (find-package 'sb-mop
)
585 (setq cl
:*features
* (delete :clsql-sbcl-mop cl
:*features
*))
586 (setq cl
:*features
* (delete :clsql-sbcl-pcl cl
:*features
*)))
589 (if (find-package 'mop
)
590 (setq cl
:*features
* (delete :clsql-cmucl-mop cl
:*features
*))
591 (setq cl
:*features
* (delete :clsql-cmucl-pcl cl
:*features
*)))