From 0094e39a9edaf69bbe72aaf05fd94d5134becd11 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Mon, 8 Mar 2010 21:57:47 +0000 Subject: [PATCH] API CHANGE: dbDataType function created --- code/SQLite3Database.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index 31eed42..c53d99f 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -821,6 +821,21 @@ class SQLite3Database extends SS_Database { return 'random()'; } + /* + * This is a lookup table for data types. + * For instance, Postgres uses 'INT', while MySQL uses 'UNSIGNED' + * So this is a DB-specific list of equivalents. + */ + function dbDataType($type){ + $values=Array( + 'unsigned integer'=>'INT' + ); + + if(isset($values[$type])) + return $values[$type]; + else return ''; + } + /* * This will return text which has been escaped in a database-friendly manner */