projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9126: finish port test-basic to rt
[clsql.git]
/
sql
/
classes.lisp
diff --git
a/sql/classes.lisp
b/sql/classes.lisp
index 5a22584f5f3e304ae8cd7758af2a93984e2ad2f7..558127ae9bbd28d18e34d702bad90acac53d8a15 100644
(file)
--- a/
sql/classes.lisp
+++ b/
sql/classes.lisp
@@
-630,6
+630,9
@@
uninclusive, and the args from that keyword to the end."
:initform nil)
(modifiers
:initarg :modifiers
:initform nil)
(modifiers
:initarg :modifiers
+ :initform nil)
+ (transactions
+ :initarg :transactions
:initform nil))
(:documentation
"An SQL CREATE TABLE statement."))
:initform nil))
(:documentation
"An SQL CREATE TABLE statement."))
@@
-644,20
+647,21
@@
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)))
(when constraints
(write-string " " *sql-stream*)
(write-string constraints *sql-stream*)))))))
*sql-stream*)
(let ((constraints
(database-constraint-statement constraints database)))
(when constraints
(write-string " " *sql-stream*)
(write-string constraints *sql-stream*)))))))
- (with-slots (name columns modifiers)
+ (with-slots (name columns modifiers
transactions
)
stmt
(write-string "CREATE TABLE " *sql-stream*)
(output-sql name database)
stmt
(write-string "CREATE TABLE " *sql-stream*)
(output-sql name database)
@@
-672,7
+676,11
@@
uninclusive, and the args from that keyword to the end."
((null modifier))
(write-string ", " *sql-stream*)
(write-string (car modifier) *sql-stream*)))
((null modifier))
(write-string ", " *sql-stream*)
(write-string (car modifier) *sql-stream*)))
- (write-char #\) *sql-stream*)))
+ (write-char #\) *sql-stream*)
+ (when (and (eq :mysql (database-underlying-type database))
+ transactions
+ (db-type-transaction-capable? :mysql database))
+ (write-string " Type=InnoDB" *sql-stream*))))
t)
t)