1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Informix datadict driver: added some sql clauses for future use

This commit is contained in:
zYne 2006-11-14 21:47:08 +00:00
parent 8b5cf30ef8
commit 2459f8f593

View File

@ -29,4 +29,26 @@ Doctrine::autoload('Doctrine_DataDict');
* @link www.phpdoctrine.com
* @since 1.0
*/
class Doctrine_DataDict_Informix extends Doctrine_DataDict { }
class Doctrine_DataDict_Informix extends Doctrine_DataDict {
protected static $sql = array(
'listTables' => "SELECT tabname,tabtype FROM systables WHERE tabtype IN ('T','V') AND owner != 'informix'",
'listColumns' => "SELECT c.colname, c.coltype, c.collength, d.default, c.colno
FROM syscolumns c, systables t,outer sysdefaults d
WHERE c.tabid = t.tabid AND d.tabid = t.tabid AND d.colno = c.colno
AND tabname='%s' ORDER BY c.colno",
'listPk' => "SELECT part1, part2, part3, part4, part5, part6, part7, part8 FROM
systables t, sysconstraints s, sysindexes i WHERE t.tabname='%s'
AND s.tabid=t.tabid AND s.constrtype='P'
AND i.idxname=s.idxname",
'listForeignKeys' => "SELECT tr.tabname,updrule,delrule,
i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4,
i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8
from systables t,sysconstraints s,sysindexes i,
sysreferences r,systables tr,sysconstraints s2,sysindexes i2
where t.tabname='%s'
and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid
and i.idxname=s.idxname and tr.tabid=r.ptabid
and s2.constrid=r.primary and i2.idxname=s2.idxname",
);
}