'tables' => 'SELECT table_name as name,LOWER(CASE table_type WHEN \'BASE TABLE\' THEN \'TABLE\' ELSE table_type END) as type,table_type FROM information_schema.tables WHERE table_type in(\'BASE TABLE\',\'VIEW\') AND table_schema NOT IN (\'pg_catalog\', \'information_schema\')',
+'create' => function(&$field) {
+ $r = array(
+ '/datetime/i' => 'timestamp',
+ );
+ $field->type = preg_replace(array_keys($r),array_values($r),$field->type);
+},
+
'table.sql' => 'SELECT CASE c.relkind::char WHEN \'r\' THEN (
SELECT
\'CREATE TABLE \'||sql.table||\'(