From d80d8b58af5e3074bca3e8830a04efb2578c2f11 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 12 Jul 2004 02:43:12 +0000 Subject: [PATCH] r9756: add tinyint type --- ChangeLog | 3 +++ db-mysql/mysql-objects.lisp | 5 +++++ doc/ref-ooddl.xml | 4 ++++ sql/generic-postgresql.lisp | 5 +++++ sql/oodml.lisp | 8 ++++++++ sql/package.lisp | 1 + 6 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index 29bd732..a425d88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +11 Jul 2004 Kevin Rosenberg + * sql/oodml.lisp, sql/package.lisp, doc/ref-ooddl.lisp, db-mysql/mysql-objects.lisp: Add tinyint type + 10 Jul 2004 Kevin Rosenberg * Version 2.11.14 * doc/*.xml: documentation additionals and fixes so diff --git a/db-mysql/mysql-objects.lisp b/db-mysql/mysql-objects.lisp index 5ddad8b..ddd6af2 100644 --- a/db-mysql/mysql-objects.lisp +++ b/db-mysql/mysql-objects.lisp @@ -25,6 +25,11 @@ (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)) diff --git a/doc/ref-ooddl.xml b/doc/ref-ooddl.xml index 28fe579..3114dcf 100644 --- a/doc/ref-ooddl.xml +++ b/doc/ref-ooddl.xml @@ -406,6 +406,10 @@ number (number n) (number n p) + + tinyint - An integer column 8-bits + wide. [not supported by all database backends] + smallint - An integer column 16-bits wide. [not supported by all database backends] diff --git a/sql/generic-postgresql.lisp b/sql/generic-postgresql.lisp index 43a9201..5149bb0 100644 --- a/sql/generic-postgresql.lisp +++ b/sql/generic-postgresql.lisp @@ -34,6 +34,11 @@ (format nil "CHAR(~A)" (car args)) "VARCHAR")) +(defmethod database-get-type-specifier ((type (eql 'tinyint)) args database + (db-type (eql :postgresql))) + (declare (ignore args database)) + "INT2") + (defmethod database-get-type-specifier ((type (eql 'smallint)) args database (db-type (eql :postgresql))) (declare (ignore args database)) diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 499a4ed..78fd886 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -317,6 +317,14 @@ (format nil "INT(~A)" (car args)) "INT")) +(deftype tinyint () + "An 8-bit integer, this width may vary by SQL implementation." + 'integer) + +(defmethod database-get-type-specifier ((type (eql 'tinyint)) args database db-type) + (declare (ignore args database db-type)) + "INT") + (deftype smallint () "An integer smaller than a 32-bit integer, this width may vary by SQL implementation." 'integer) diff --git a/sql/package.lisp b/sql/package.lisp index 8d5c33d..750ab90 100644 --- a/sql/package.lisp +++ b/sql/package.lisp @@ -349,6 +349,7 @@ #:varchar #:generalized-boolean #:smallint + #:tinyint #:*default-string-length* ;; OODML (oodml.lisp) -- 2.34.1