Zeta Components Manual :: Docs For Class ezcDbSchemaPgsqlReader
DatabaseSchema::ezcDbSchemaPgsqlReader
Class ezcDbSchemaPgsqlReader
Handler for PostgreSQL connections representing a DB schema.
Source for this file: /DatabaseSchema/src/handlers/pgsql/reader.php
Implements interfaces:
ezcDbSchemaCommonSqlReader | --ezcDbSchemaPgsqlReader
Version: | //autogentag// |
Method Summary
public static string |
convertToGenericType(
$typeString
, &$typeLength
, &$typePrecision
)
Converts the native PostgreSQL type in $typeString to a generic DbSchema type. |
protected ezcDbSchema |
fetchSchema(
)
Loops over all the tables in the database and extracts schema information. |
protected array(string=>ezcDbSchemaField) |
fetchTableFields(
$tableName
)
Fetch fields definition for the table $tableName |
protected array(string=>ezcDbSchemaIndex) |
fetchTableIndexes(
$tableName
)
Loops over all the indexes in the table $table and extracts information. |
Inherited Methods
From ezcDbSchemaCommonSqlReader | |
---|---|
public int |
ezcDbSchemaCommonSqlReader::getReaderType()
Returns what type of schema reader this class implements. |
public ezcDbSchema |
ezcDbSchemaCommonSqlReader::loadFromDb()
Returns an ezcDbSchema created from the database schema in the database referenced by $db |
protected ezcDbSchema |
ezcDbSchemaCommonSqlReader::processSchema()
Loops over all the table names in the array and extracts schema information. |
Methods
convertToGenericType
Converts the native PostgreSQL type in $typeString to a generic DbSchema type.
This method converts a string like "float(5,10)" to the generic DbSchema type and uses the by-reference parameters $typeLength and $typePrecision to communicate the optional length and precision of the field's type.
Parameters:
Name | Type | Description |
---|---|---|
$typeString |
string | |
&$typeLength |
int | |
&$typePrecision |
int |
fetchSchema
Loops over all the tables in the database and extracts schema information.
This method extracts information about a database's schema from the database itself and returns this schema as an ezcDbSchema object.
fetchTableFields
Fetch fields definition for the table $tableName
This method loops over all the fields in the table $tableName and returns an array with the field specification. The key in the returned array is the name of the field.
Parameters:
Name | Type | Description |
---|---|---|
$tableName |
string |
fetchTableIndexes
Loops over all the indexes in the table $table and extracts information.
This method extracts information about the table $tableName's indexes from the database and returns this schema as an array of ezcDbSchemaIndex objects. The key in the array is the index' name.
Parameters:
Name | Type | Description |
---|---|---|
$tableName |
string |