2 define('WARAQ_ROOT', '..');
3 require_once WARAQ_ROOT
.'/ini.php';
9 $dbType = $this->getAttribute(PDO
::ATTR_DRIVER_NAME
);
10 if ('sqlite' == $dbType ||
'sqlite2' == $dbType) {
11 $query = "select name from sqlite_master where type='table'";
13 $query = "show tables";
15 $result = $this->query($query);
17 foreach ($result as $r) {
18 $tables []= new Table($r['name']);
30 function __construct($name, $columns = array())
33 $this->columns
= $columns;
36 function loadColumns($db)
39 $dbType = $db->getAttribute(PDO
::ATTR_DRIVER_NAME
);
40 if ('sqlite' == $dbType ||
'sqlite2' == $dbType) {
41 $result = $db->fetchColumnTypes($table);
42 foreach ($result as $column => $type) {
43 $this->columns
[]= new Column($column, $type);
46 $columns = $db->query("show columns from $table");
58 function __construct($name, $type = NULL)