Support new security model in the formSubmit function - bug fix
[openemr.git] / library / adodb / datadict / datadict-sqlite.inc.php
blob0fcb8318eb8340c80086f00a7f78afd3ff438581
1 <?php
3 /**
4 V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
5 Released under both BSD license and Lesser GPL library license.
6 Whenever there is any discrepancy between the two licenses,
7 the BSD license will take precedence.
9 Set tabs to 4 for best viewing.
11 SQLite datadict Andrei Besleaga
15 // security - hide paths
16 if (!defined('ADODB_DIR')) die();
18 class ADODB2_sqlite extends ADODB_DataDict {
19 var $databaseType = 'sqlite';
20 var $seqField = false;
21 var $addCol=' ADD COLUMN';
22 var $dropTable = 'DROP TABLE IF EXISTS %s';
23 var $dropIndex = 'DROP INDEX IF EXISTS %s';
24 var $renameTable = 'ALTER TABLE %s RENAME TO %s';
28 function ActualType($meta)
30 switch(strtoupper($meta)) {
31 case 'C': return 'VARCHAR'; // TEXT , TEXT affinity
32 case 'XL':return 'LONGTEXT'; // TEXT , TEXT affinity
33 case 'X': return 'TEXT'; // TEXT , TEXT affinity
35 case 'C2': return 'VARCHAR'; // TEXT , TEXT affinity
36 case 'X2': return 'LONGTEXT'; // TEXT , TEXT affinity
38 case 'B': return 'LONGBLOB'; // TEXT , NONE affinity , BLOB
40 case 'D': return 'DATE'; // NUMERIC , NUMERIC affinity
41 case 'T': return 'DATETIME'; // NUMERIC , NUMERIC affinity
42 case 'L': return 'TINYINT'; // NUMERIC , INTEGER affinity
44 case 'R':
45 case 'I4':
46 case 'I': return 'INTEGER'; // NUMERIC , INTEGER affinity
47 case 'I1': return 'TINYINT'; // NUMERIC , INTEGER affinity
48 case 'I2': return 'SMALLINT'; // NUMERIC , INTEGER affinity
49 case 'I8': return 'BIGINT'; // NUMERIC , INTEGER affinity
51 case 'F': return 'DOUBLE'; // NUMERIC , REAL affinity
52 case 'N': return 'NUMERIC'; // NUMERIC , NUMERIC affinity
53 default:
54 return $meta;
58 // return string must begin with space
59 function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
61 $suffix = '';
62 if ($funsigned) $suffix .= ' UNSIGNED';
63 if ($fnotnull) $suffix .= ' NOT NULL';
64 if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
65 if ($fautoinc) $suffix .= ' AUTOINCREMENT';
66 if ($fconstraint) $suffix .= ' '.$fconstraint;
67 return $suffix;
70 function AlterColumnSQL($tabname, $flds)
72 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported natively by SQLite");
73 return array();
76 function DropColumnSQL($tabname, $flds)
78 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported natively by SQLite");
79 return array();
82 function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
84 if ($this->debug) ADOConnection::outp("RenameColumnSQL not supported natively by SQLite");
85 return array();