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 #:db-type-use-fully-qualified-column-on-drop-index?
154 #:db-type-has-intersect?
155 #:db-type-has-except?
156 #:db-type-has-auto-increment?
157 #:database-underlying-type
158 #:database-get-type-specifier
160 #:database-output-sql-as-type
161 #:*loaded-database-types*
162 #:reload-database-types
166 #:database-create-large-object
167 #:database-write-large-object
168 #:database-read-large-object
169 #:database-delete-large-object
170 #:create-large-object
173 #:delete-large-object
175 ;; Prepared statments
177 #:database-run-prepared
178 #:database-bind-parameter
179 #:database-free-prepared
181 ;; accessors for database class
187 #:command-recording-stream
188 #:result-recording-stream
193 #:database-autocommit
200 #:symbol-name-default-case
201 #:convert-to-db-default-case
204 #:number-to-sql-string
205 #:float-to-sql-string
211 #:generic-postgresql-database
212 #:generic-odbc-database
214 ;; Subclasses of sql-expresssion (expressions.lisp)
218 #:sql-query-modifier-exp
225 #:sql-ident-attribute
230 ;; Shared exports for re-export by CLSQL package.
233 ;; foreign library loading
234 #:*foreign-library-search-paths*
237 ;; Condition system (conditions.lisp)
240 #:sql-database-data-error
241 #:sql-connection-error
242 #:sql-temporary-error
246 #:sql-error-secondary-error-id
247 #:sql-error-database-message
252 #:sql-database-warning
254 #:sql-error-database-type
255 #:sql-error-connection-spec
256 #:sql-error-expression
257 #:sql-warning-database
258 #:sql-user-error-message
259 #:*backend-warning-behavior*
261 ;; Connection/initialisation (base-classes.lisp, database.lisp,
263 #:*default-database-type*
265 #:*initialized-database-types*
266 #:initialize-database-type
269 #:*connect-if-exists*
270 #:connected-databases
277 #:database-name-from-spec
280 #:with-default-database
287 ;; I/O Recording (recording.lisp)
293 #:start-sql-recording
303 #:list-attribute-types
320 #:set-sequence-position
324 #:cache-table-queries
325 #:*cache-table-queries-default*
341 ;; Transaction handling (transaction.lisp)
346 #:add-transaction-commit-hook
347 #:add-transaction-rollback-hook
352 ;; OODDL (ooddl.lisp)
355 #:create-view-from-class
356 #:drop-view-from-class
363 #:generalized-boolean
367 #:*default-string-length*
369 ;; OODML (oodml.lisp)
371 #:update-objects-joins
372 #:*default-update-objects-max-len*
374 #:update-slot-from-record
375 #:update-instance-from-records
376 #:update-records-from-instance
377 #:update-record-from-slot
378 #:update-record-from-slots
379 #:delete-instance-records
382 #:write-instance-to-stream
383 #:read-instance-from-stream
385 ;; Symbolic SQL Syntax (syntax.lisp)
390 #:disable-sql-reader-syntax
391 #:enable-sql-reader-syntax
392 #:locally-disable-sql-reader-syntax
393 #:locally-enable-sql-reader-syntax
394 #:restore-sql-reader-syntax-state
396 ;; SQL operations (operations.lisp)
451 ;; Time handling (time.lisp)
476 #:duration-timestring
511 #:time-by-adding-duration
555 (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
560 (:import-from #:clsql-sys . #1#)
562 (:documentation "This is the user package with CLSQL symbols."))
564 (defpackage #:clsql-user
566 (:import-from #:clsql-sys . #1#)
568 (:documentation "This is the user package with CLSQL symbols."))
570 ;; This is from USQL's pcl-patch
571 #+(or clsql-sbcl-pcl clsql-cmucl-pcl)
573 ;; Note that this will no longer required for cmucl as of version 19a.
574 (in-package #+cmu :pcl #+sbcl :sb-pcl)
575 (defmacro pv-binding1 ((pv calls pv-table-symbol pv-parameters slot-vars)
577 `(pv-env (,pv ,calls ,pv-table-symbol ,pv-parameters)
578 (let (,@(mapcar #'(lambda (slot-var p) `(,slot-var (get-slots-or-nil ,p)))
579 slot-vars pv-parameters))
580 ,@(mapcar #'(lambda (slot-var) `(declare (ignorable ,slot-var))) slot-vars)
583 ;; see http://thread.gmane.org/gmane.lisp.lispworks.general/681
585 (setf *packages-for-warn-on-redefinition*
586 (delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
589 (if (find-package 'sb-mop)
590 (setq cl:*features* (delete :clsql-sbcl-mop cl:*features*))
591 (setq cl:*features* (delete :clsql-sbcl-pcl cl:*features*)))
594 (if (find-package 'mop)
595 (setq cl:*features* (delete :clsql-cmucl-mop cl:*features*))
596 (setq cl:*features* (delete :clsql-cmucl-pcl cl:*features*)))