projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Found and refactored a way some more eql specified methods of
[clsql.git]
/
db-mysql
/
mysql-objects.lisp
diff --git
a/db-mysql/mysql-objects.lisp
b/db-mysql/mysql-objects.lisp
index ae24cac37abd2910832c2cf1c528213f145e98ad..b3baf30c79a45dafdaa174f285118fbabde5b1d1 100644
(file)
--- a/
db-mysql/mysql-objects.lisp
+++ b/
db-mysql/mysql-objects.lisp
@@
-6,8
+6,6
@@
;;;; Purpose: CLSQL Object layer for MySQL
;;;; Created: May 2004
;;;;
;;;; Purpose: CLSQL Object layer for MySQL
;;;; Created: May 2004
;;;;
-;;;; $Id: mysql-sql.lisp 9403 2004-05-19 23:46:45Z kevin $
-;;;;
;;;; CLSQL users are granted the rights to distribute and use this software
;;;; as governed by the terms of the Lisp Lesser GNU Public License
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; CLSQL users are granted the rights to distribute and use this software
;;;; as governed by the terms of the Lisp Lesser GNU Public License
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
@@
-15,14
+13,26
@@
(in-package #:clsql-mysql)
(in-package #:clsql-mysql)
-(defmethod database-get-type-specifier ((type (eql 'wall-time)) args (database mysql-database))
- (declare (ignore args))
- "DATETIME")
+(defmethod database-get-type-specifier ((type symbol) args database
+ (db-type (eql :mysql)))
+ (declare (ignore args database db-type))
+ (case type
+ (wall-time "DATETIME")
+ (tinyint "TINYINT")
+ (smallint "SMALLINT")
+ (mediumint "MEDIUMINT")
+ (t (call-next-method))))
-(defmethod database-output-sql-as-type ((type (eql 'boolean)) val (database mysql-database))
- (if val 1 0))
+(defmethod read-sql-value (val (type (eql 'boolean)) database
+ (db-type (eql :mysql)))
+ (declare (ignore database))
+ (etypecase val
+ (string (if (string= "0" val) nil t))
+ (integer (if (zerop val) nil t))))
-(defmethod read-sql-value (val (type (eql 'boolean)) (database mysql-database))
+(defmethod read-sql-value (val (type (eql 'generalized-boolean)) database
+ (db-type (eql :mysql)))
+ (declare (ignore database))
(etypecase val
(string (if (string= "0" val) nil t))
(integer (if (zerop val) nil t))))
(etypecase val
(string (if (string= "0" val) nil t))
(integer (if (zerop val) nil t))))