projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9115: new deb package
[clsql.git]
/
sql
/
classes.lisp
diff --git
a/sql/classes.lisp
b/sql/classes.lisp
index a2ca8577727d6ac81a996514b935a30cb4b09639..7098ca2c81eafb294522578b648d896f0f20782f 100644
(file)
--- a/
sql/classes.lisp
+++ b/
sql/classes.lisp
@@
-22,14
+22,6
@@
(defvar *sql-stream* nil
"stream which accumulates SQL output")
(defvar *sql-stream* nil
"stream which accumulates SQL output")
-(defvar *default-schema* "UNCOMMONSQL")
-
-(defvar *object-schemas* (make-hash-table :test #'equal)
- "Hash of schema name to class constituent lists.")
-
-(defun in-schema (schemaname)
- (setf *default-schema* schemaname))
-
(defun sql-output (sql-expr &optional database)
(progv '(*sql-stream*)
`(,(make-string-output-stream))
(defun sql-output (sql-expr &optional database)
(progv '(*sql-stream*)
`(,(make-string-output-stream))
@@
-652,13
+644,14
@@
uninclusive, and the args from that keyword to the end."
(defmethod output-sql ((stmt sql-create-table) &optional
(database *default-database*))
(flet ((output-column (column-spec)
(defmethod output-sql ((stmt sql-create-table) &optional
(database *default-database*))
(flet ((output-column (column-spec)
- (destructuring-bind (name type &rest constraints)
+ (destructuring-bind (name type &
optional db-type &
rest constraints)
column-spec
(let ((type (listify type)))
(output-sql name database)
(write-char #\Space *sql-stream*)
(write-string
column-spec
(let ((type (listify type)))
(output-sql name database)
(write-char #\Space *sql-stream*)
(write-string
- (database-get-type-specifier (car type) (cdr type) database)
+ (if (stringp db-type) db-type ; override definition
+ (database-get-type-specifier (car type) (cdr type) database))
*sql-stream*)
(let ((constraints
(database-constraint-statement constraints database)))
*sql-stream*)
(let ((constraints
(database-constraint-statement constraints database)))