r1801: Added transaction code
[clsql.git] / sql / package.cl
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          package.cl
6 ;;;; Purpose:       Package definition for high-level SQL interface
7 ;;;; Programmers:   Kevin M. Rosenberg based on
8 ;;;;                Original code by Pierre R. Mai 
9 ;;;; Date Started:  Feb 2002
10 ;;;;
11 ;;;; $Id: package.cl,v 1.9 2002/04/27 21:48:08 kevin Exp $
12 ;;;;
13 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
15 ;;;;
16 ;;;; CLSQL users are granted the rights to distribute and use this software
17 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
18 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
19 ;;;; *************************************************************************
20
21 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
22 (in-package :cl-user)
23
24 ;;;; This file makes the required package definitions for CLSQL's
25 ;;;; core packages.
26 ;;;; 
27
28 (eval-when (:compile-toplevel :load-toplevel :execute)
29 (defpackage :clsql-sys
30   (:use :common-lisp)
31   (:export
32      ;; "Private" exports for use by interface packages
33      #:check-connection-spec
34      #:database-type-load-foreign
35      #:database-type-library-loaded ;; KMR - Tests if foreign library okay
36      #:database-initialize-database-type
37      #:database-connect
38      #:database-disconnect
39      #:database-query
40      #:database-execute-command
41      #:database-query-result-set
42      #:database-dump-result-set
43      #:database-store-next-row
44      
45      ;; For UncommonSQL support
46      #:database-list-tables
47      #:database-list-attributes
48      #:database-attribute-type
49      #:database-create-sequence 
50      #:database-drop-sequence
51      #:database-sequence-next
52     
53      #:sql-escape
54      
55      ;; Large objects (Marc B)
56      #:database-create-large-object
57      #:database-write-large-object
58      #:database-read-large-object
59      #:database-delete-large-object
60      
61      ;; Shared exports for re-export by CLSQL
62      .
63      #1=(#:clsql-condition
64          #:clsql-error
65          #:clsql-simple-error
66          #:clsql-warning
67          #:clsql-simple-warning
68          #:clsql-invalid-spec-error
69          #:clsql-invalid-spec-error-connection-spec
70          #:clsql-invalid-spec-error-database-type
71          #:clsql-invalid-spec-error-template
72          #:clsql-connect-error
73          #:clsql-connect-error-database-type
74          #:clsql-connect-error-connection-spec
75          #:clsql-connect-error-errno
76          #:clsql-connect-error-error
77          #:clsql-sql-error
78          #:clsql-sql-error-database
79          #:clsql-sql-error-expression
80          #:clsql-sql-error-errno
81          #:clsql-sql-error-error
82          #:clsql-database-warning
83          #:clsql-database-warning-database
84          #:clsql-database-warning-message
85          #:clsql-exists-condition
86          #:clsql-exists-condition-new-db
87          #:clsql-exists-condition-old-db
88          #:clsql-exists-warning
89          #:clsql-exists-error
90          #:clsql-closed-error
91          #:clsql-closed-error-database
92          #:*loaded-database-types*
93          #:reload-database-types
94          #:*default-database-type*
95          #:*initialized-database-types*
96          #:initialize-database-type
97          #:*connect-if-exists*
98          #:*default-database*
99          #:connected-databases
100          #:database
101          #:database-name
102          #:closed-database
103          #:find-database
104          #:database-name-from-spec
105          #:connect
106          #:disconnect
107          #:query
108          #:execute-command
109          #:map-query
110          #:do-query
111
112          ;; functional.cl
113
114          #:insert-records
115          #:delete-records
116          #:update-records
117          #:with-database
118          
119          ;; utils.cl
120          #:number-to-sql-string
121          #:float-to-sql-string
122          #:sql-escape-quotes
123          
124          ;; For UncommonSQL support
125          #:sql-ident
126          #:list-tables
127          #:list-attributes
128          #:attribute-type
129          #:create-sequence 
130          #:drop-sequence
131          #:sequence-next
132          #:transaction-start
133          #:transaction-commit
134          #:transaction-abort
135          
136          ;; Pooled connections
137          #:disconnect-pooled
138
139          ;; Transactions
140          #:with-transaction
141
142          ;; Large objects (Marc B)
143          #:create-large-object
144          #:write-large-object
145          #:read-large-object
146          #:delete-large-object
147          ))
148     (:documentation "This is the INTERNAL SQL-Interface package of CLSQL."))
149
150 (defpackage #:clsql
151     (:import-from #:clsql-sys . #1#)
152     (:export . #1#)
153     (:documentation "This is the SQL-Interface package of CLSQL."))
154 );eval-when
155
156 (defpackage #:clsql-user
157     (:use #:common-lisp #:clsql)
158     (:documentation "This is the user package for experimenting with CLSQL."))