Property | Type | Description | |
---|---|---|---|
$_schemaSearchPath | string | The active schema search path. | |
$_version | integer | Cached version. |
Method | Description | |
---|---|---|
addColumn ( string $tableName, string $columnName, string $type, array $options = [] ) | Adds a new column to a table. | |
addOrderByForAssociationLimiting ( string $sql, array $options ) : string | Adds an ORDER BY clause to an existing query. | |
buildClause ( string $lhs, string $op, string $rhs, boolean $bind = false, array $params = [] ) : string | array | Returns an expression using the specified operator. | |
changeColumn ( string $tableName, string $columnName, string $type, array $options = [] ) | Changes an existing column's definition. | |
changeColumnDefault ( string $tableName, string $columnName, mixed $default ) | Sets a new default value for a column. | |
changeColumnNull ( string $tableName, string $columnName, boolean $null, mixed $default = null ) | Sets whether a column allows NULL values. | |
columns ( string $tableName, string $name = null ) : array | Returns a list of table columns. | |
createDatabase ( string $name, array $options = [] ) | Creates a database. | |
currentDatabase ( ) : string | Returns the name of the currently selected database. | |
defaultSequenceName ( string $tableName, string $pk = null ) : string | Returns the sequence name for a table's primary key or some other specified key. | |
distinct ( string $columns, string $orderBy = null ) : string | Generates a DISTINCT clause for SELECT queries. | |
dropDatabase ( string $name ) | Drops a database. | |
encoding ( ) : string | Returns the current database's encoding format. | |
getClientMinMessages ( ) : string | Returns the current client log message level. | |
indexes ( string $tableName, string $name = null ) : array | Returns a list of tables indexes. | |
interval ( string $interval, string $precision ) : string | Generates an INTERVAL clause for SELECT queries. | |
makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true ) : Horde_Db_Adapter_Postgresql_Column | Factory for Column objects. | |
modifyDate ( string $reference, string $operator, integer $amount, string $interval ) : string | Generates a modified date for SELECT queries. | |
nativeDatabaseTypes ( ) : array | Returns a hash of mappings from the abstract data types to the native database types. | |
pkAndSequenceFor ( $table ) : array | Returns a table's primary key and the key's sequence. | |
postgresqlVersion ( ) : integer | Returns the version of the connected PostgreSQL server. | |
primaryKey ( string $tableName, string $name = null ) : Horde_Db_Adapter_Base_Index | Returns a table's primary key. | |
quote ( mixed $value, object $column = null ) : string | Quotes the column value to help prevent SQL injection attacks. | |
quoteBinary ( $value ) : string | Returns a quoted binary value. | |
quoteFalse ( ) : string | Returns a quoted boolean false. | |
quoteSequenceName ( string $name ) : string | Returns a quoted sequence name. | |
quoteTrue ( ) : string | Returns a quoted boolean true. | |
removeIndex ( string $tableName, string | array $options = [] ) | Removes an index from a table. | |
removePrimaryKey ( string $tableName ) | Removes a primary key from a table. | |
renameColumn ( string $tableName, string $columnName, string $newColumnName ) | Renames a column. | |
renameTable ( string $name, string $newName ) | Renames a table. | |
resetPkSequence ( $table, string $pk = null, string $sequence = null ) : integer | Resets the sequence of a table's primary key to the maximum value. | |
setClientMinMessages ( string $level ) | Sets the client log message level. | |
setSchemaSearchPath ( string $schemaCsv ) | Sets the schema search path to a string of comma-separated schema names. | |
tableAliasLength ( ) : integer | Returns the maximum length a table alias can have. | |
tables ( ) : array | Returns a list of all tables in the schema search path. | |
typeToSql ( string $type, integer $limit = null, integer $precision = null, integer $scale = null, boolean $unsigned = null ) : string | Generates the SQL definition for a column type. |
Method | Description | |
---|---|---|
_columnDefinitions ( $tableName, $name = null ) | Returns the list of a table's column names, data types, and default values. | |
_quoteBinaryCallback ( array $matches ) : string | Callback function for quoteBinary(). |
protected _columnDefinitions ( $tableName, $name = null ) |
protected _quoteBinaryCallback ( array $matches ) : string | ||
$matches | array | Matches from preg_replace(). |
return | string | Escaped/encoded binary value. |
public buildClause ( string $lhs, string $op, string $rhs, boolean $bind = false, array $params = [] ) : string | array | ||
$lhs | string | The column or expression to test. |
$op | string | The operator. |
$rhs | string | The comparison value. |
$bind | boolean | If true, the method returns the query and a list of values suitable for binding as an array. |
$params | array | Any additional parameters for the operator. |
return | string | array | The SQL test fragment, or an array containing the query and a list of values if $bind is true. |
public createDatabase ( string $name, array $options = [] ) | ||
$name | string | A database name. |
$options | array | Database options: owner, template, charset, tablespace, and connection_limit. |
public currentDatabase ( ) : string | ||
return | string | The database name. |
$connection->distinct('posts.id', 'posts.created_at DESC')
public dropDatabase ( string $name ) | ||
$name | string | A database name. |
public getClientMinMessages ( ) : string | ||
return | string | The current client log message level. |
public makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true ) : Horde_Db_Adapter_Postgresql_Column | ||
$name | string | The column's name, such as "supplier_id" in "supplier_id int(11)". |
$default | string | The type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'". |
$sqlType | string | Used to extract the column's type, length and signed status, if necessary. For example "varchar" and "60" in "company_name varchar(60)" or "unsigned => true" in "int(10) UNSIGNED". |
$null | boolean | Whether this column allows NULL values. |
return | Horde_Db_Adapter_Postgresql_Column | A column object. |
public modifyDate ( string $reference, string $operator, integer $amount, string $interval ) : string | ||
$reference | string | The reference date - this is a column referenced in the SELECT. |
$operator | string | Add or subtract time? (+/-) |
$amount | integer | The shift amount (number of days if $interval is DAY, etc). |
$interval | string | The interval (SECOND, MINUTE, HOUR, DAY, MONTH, YEAR). |
return | string | The generated INTERVAL clause. |
public nativeDatabaseTypes ( ) : array | ||
return | array | A database type map. |
public pkAndSequenceFor ( $table ) : array | ||
return | array | Array with two values: the primary key name and the key's sequence name. |
public postgresqlVersion ( ) : integer | ||
return | integer | Zero padded PostgreSQL version, e.g. 80108 for 8.1.8. |
public primaryKey ( string $tableName, string $name = null ) : Horde_Db_Adapter_Base_Index | ||
$tableName | string | A table name. |
$name | string | (can be removed?) |
return | Horde_Db_Adapter_Base_Index | The primary key index object. |
public quoteBinary ( $value ) : string | ||
return | string | The quoted binary value. |
public quoteFalse ( ) : string | ||
return | string | The quoted boolean false. |
public quoteSequenceName ( string $name ) : string | ||
$name | string | A sequence name. |
return | string | The quoted sequence name. |
public removePrimaryKey ( string $tableName ) | ||
$tableName | string | A table name. |
public renameTable ( string $name, string $newName ) | ||
$name | string | A table name. |
$newName | string | The new table name. |
public resetPkSequence ( $table, string $pk = null, string $sequence = null ) : integer | ||
$pk | string | A primary key name. Defaults to the existing primary key. |
$sequence | string | A sequence name. Defaults to the sequence name of the existing primary key. |
return | integer | The (next) sequence value if a primary key and a sequence exist. |
public setClientMinMessages ( string $level ) | ||
$level | string | The client log message level. One of DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, LOG, NOTICE, WARNING, ERROR, FATAL, or PANIC. |
public setSchemaSearchPath ( string $schemaCsv ) | ||
$schemaCsv | string | A comma-separated schema name list. |
public tableAliasLength ( ) : integer | ||
return | integer | The maximum table alias length. |
public typeToSql ( string $type, integer $limit = null, integer $precision = null, integer $scale = null, boolean $unsigned = null ) : string | ||
$type | string | A column type. |
$limit | integer | Maximum column length (non decimal type only) |
$precision | integer | The number precision (decimal type only). |
$scale | integer | The number scaling (decimal columns only). |
$unsigned | boolean | Whether the column is an unsigned number (non decimal columns only). |
return | string | The SQL definition. If $type is not one of the internally supported types, $type is returned unchanged. |
protected string $_schemaSearchPath | ||
return | string |