$tablename;
9 private bool$nullable;
12 private bool$deferred;
13 private bool$deferrable;
14 private?
string$conname;
15 private bool$has_default;
30pg_get_expr(adbin, adrelid) AS adsrc,
31COALESCE(condeferred, FALSE) AS deferred,
32COALESCE(condeferrable, FALSE) AS deferrable,
33CASE WHEN typname =
'int2'THEN
'smallint' 34WHEN typname =
'int4'THEN
'integer' 35WHEN typname =
'int8'THEN
'bigint' 36WHEN typname =
'bpchar'THEN
'char' 37ELSE typname END AS typname
39JOIN pg_namespace n ON (n.oid = c.relnamespace)
40JOIN pg_attribute a ON (a.attrelid = c.oid)
41JOIN pg_type t ON (t.oid = a.atttypid)
42LEFT JOIN pg_constraint o ON (o.conrelid = c.oid AND a.attnum = ANY(o.conkey) AND o.contype =
'f')
43LEFT JOIN pg_attrdef d on c.oid=d.adrelid and a.attnum=d.adnum
59$row = $res->fetchObject();
64$n->
type= $row->typname;
65$n->nullable = !$row->attnotnull;
67$n->tablename = $table;
68$n->max_length = $row->attlen;
69$n->deferrable = (bool)$row->deferrable;
70$n->deferred = (bool)$row->deferred;
71$n->conname = $row->conname;
72$n->has_default = (bool)$row->atthasdef;
73$n->default = $row->adsrc;
88 return$this->tablename;
98 return$this->nullable;
105 return$this->max_length;
112 return$this->deferrable;
119 return$this->deferred;
126 return$this->conname;
134 if( $this->has_default ) {
135 return$this->default;
Postgres database abstraction layer.
getCoreSchemas()
Return schema names for temporary tables and core application tables.
addQuotes( $s)
Escape and quote a raw value string for use in a SQL query.string
type()
Database type.string
tableName()
Name of table this field belongs to.string
isNullable()
Whether this field can store NULL values.bool
static fromText(DatabasePostgres $db, $table, $field)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4