X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-mysql%2Fmysql-objects.lisp;h=ddd6af22452656810c5365a417148f8e7e82c3c6;hp=bbe52324fe2d0466849e51f49c741f5c02dac7ca;hb=d80d8b58af5e3074bca3e8830a04efb2578c2f11;hpb=7308bdf188da6424e615ca14096ef53cfb845a90 diff --git a/db-mysql/mysql-objects.lisp b/db-mysql/mysql-objects.lisp index bbe5232..ddd6af2 100644 --- a/db-mysql/mysql-objects.lisp +++ b/db-mysql/mysql-objects.lisp @@ -6,7 +6,7 @@ ;;;; Purpose: CLSQL Object layer for MySQL ;;;; Created: May 2004 ;;;; -;;;; $Id: mysql-sql.lisp 9403 2004-05-19 23:46:45Z kevin $ +;;;; $Id$ ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -20,14 +20,36 @@ (declare (ignore args database)) "DATETIME") +(defmethod database-get-type-specifier ((type (eql 'smallint)) args database + (db-type (eql :mysql))) + (declare (ignore args database)) + "SMALLINT") + +(defmethod database-get-type-specifier ((type (eql 'tinyint)) args database + (db-type (eql :mysql))) + (declare (ignore args database)) + "TINYINT") + (defmethod database-output-sql-as-type ((type (eql 'boolean)) val database (db-type (eql :mysql))) (declare (ignore database)) (if val 1 0)) +(defmethod database-output-sql-as-type ((type (eql 'generalized-boolean)) val database + (db-type (eql :mysql))) + (declare (ignore 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 '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))))