ae24cac37abd2910832c2cf1c528213f145e98ad
[clsql.git] / db-mysql / mysql-objects.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:     mysql-objects.lisp
6 ;;;; Purpose:  CLSQL Object layer for MySQL
7 ;;;; Created:  May 2004
8 ;;;;
9 ;;;; $Id: mysql-sql.lisp 9403 2004-05-19 23:46:45Z kevin $
10 ;;;;
11 ;;;; CLSQL users are granted the rights to distribute and use this software
12 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
13 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
14 ;;;; *************************************************************************
15
16 (in-package #:clsql-mysql)
17
18 (defmethod database-get-type-specifier ((type (eql 'wall-time)) args (database mysql-database))
19   (declare (ignore args))
20   "DATETIME")
21
22 (defmethod database-output-sql-as-type ((type (eql 'boolean)) val (database mysql-database))
23   (if val 1 0))
24
25 (defmethod read-sql-value (val (type (eql 'boolean)) (database mysql-database))
26   (etypecase val
27     (string (if (string= "0" val) nil t))
28     (integer (if (zerop val) nil t))))