Permalink
Browse files

Decimal support for SQLite. #3171

  • Loading branch information...
1 parent e0eb8f8 commit c74c8d49a1eb94f935ef0ffecc558df2ccb26129 @uzyn uzyn committed Sep 28, 2013
@@ -73,6 +73,7 @@ class Sqlite extends DboSource {
'integer' => array('name' => 'integer', 'limit' => null, 'formatter' => 'intval'),
'biginteger' => array('name' => 'bigint', 'limit' => 20),
'float' => array('name' => 'float', 'formatter' => 'floatval'),
+ 'decimal' => array('name' => 'decimal', 'formatter' => 'floatval'),
'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
'time' => array('name' => 'time', 'format' => 'H:i:s', 'formatter' => 'date'),
@@ -278,7 +279,7 @@ public function column($real) {
return 'binary';
}
if (strpos($col, 'numeric') !== false || strpos($col, 'decimal') !== false) {
- return 'float';
+ return 'decimal';
}
return 'text';
}
@@ -363,6 +363,12 @@ public function testDatatypes() {
'default' => '',
'length' => '5,2',
),
+ 'decimal_field' => array(
+ 'type' => 'decimal',
+ 'null' => true,
+ 'default' => '0.000',
+ 'length' => '6,3',
+ ),
'huge_int' => array(
'type' => 'biginteger',
'null' => true,

0 comments on commit c74c8d4

Please sign in to comment.