Свойство | Тип | Описание | |
---|---|---|---|
$_columns | array | PostgreSQL column type definitions. | |
$_constraints | array | Column contraints | |
$_metas | array | Column/table metas By default 'escape' is false and 'join' is ' ' | |
$_quotes | array | Pair of opening and closing quote characters used for quoting identifiers in queries. |
Метод | Описание | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. Constructs the PostgreSQL adapter and sets the default port to 5432. | |
alias ( $alias, $context ) | ||
conditions ( string $conditions, string $context, array $options = [] ) : string | ||
connect ( ) : boolean | Connects to the database by constructing DSN string and creating a PDO intance using the parent class. Will set specific options on the connection as provided (timezone, schema). | |
describe ( mixed $entity, array $fields = [], array $meta = [] ) : array | Gets the column schema for a given PostgreSQL table. | |
enabled ( string $feature = null ) : boolean | Check for required PHP extension, or supported database feature. | |
encoding ( $encoding = null ) : mixed | Gets or sets the encoding for the connection. | |
error ( ) : array | Retrieves database error message and error code. | |
searchPath ( $searchPath ) : mixed | Gets or sets the search path for the connection. | |
sources ( string $model = null ) : array | Returns the list of tables in the currently-connected database. | |
timezone ( $timezone = null ) : mixed | Gets or sets the time zone for the connection | |
value ( mixed $value, array $schema = [] ) : mixed | Converts a given value into the proper type based on a given schema definition. |
Метод | Описание | |
---|---|---|
_buildColumn ( array $field ) : string | Helper for Database::column(). | |
_column ( string $real ) : array | Converts database-layer column types to basic types. | |
_distinctExport ( object $query ) : array | Helper method for PostgreSql::_queryExport() to export data for use in distinct query. | |
_execute ( string $sql, array $options = [] ) : |
Execute a given query. | |
_formatters ( ) | Provide an associative array of Closures to be used as the "formatter" key inside of the Database::$_columns specification. | |
_insertId ( object $query ) : mixed | Gets the last auto-generated ID from the query that inserted a new record. | |
_queryExport ( object $query ) : array | Helper method for Database::read() to export query while handling additional joins when using relationships and limited result sets. Filters conditions on subsequent queries to just the ones applying to the relation. |
public __construct ( array $config = [] ) : void | ||
$config | array | The available configuration options are the following. Further options are inherited from the parent classes. Typically, these parameters are set in `Connections::add()`, when adding the adapter to the list of active connections. - `'host'` _string_: Defaults to `'localhost:5432'`. - `'schema'` _string_: The name of the database schema to use. Defaults to `'public'`. - `'timezone'` _string_: The timezone to use. Defaults to `'null'` |
Результат | void |
protected _buildColumn ( array $field ) : string | ||
$field | array | A field array. |
Результат | string | SQL column string. |
protected _distinctExport ( object $query ) : array | ||
$query | object | The query object. |
Результат | array | Returns an array with the fields as the first value and the orders as the second value. |
protected _formatters ( ) |
protected _queryExport ( object $query ) : array | ||
$query | object | The query object. |
Результат | array | The exported query returned by reference. |
public describe ( mixed $entity, array $fields = [], array $meta = [] ) : array | ||
$entity | mixed | Specifies the table name for which the schema should be returned, or the class name of the model object requesting the schema, in which case the model class will be queried for the correct table name. |
$fields | array | Any schema data pre-defined by the model. |
$meta | array | |
Результат | array | Returns an associative array describing the given table's schema, where the array keys are the available fields, and the values are arrays describing each field, containing the following keys: - `'type'`: The field type name |
public searchPath ( $searchPath ) : mixed | ||
$searchPath | ||
Результат | mixed | If setting the searchPath; returns ture on success, else false When getting, returns the searchPath |
protected array $_columns | ||
Результат | array |
protected array $_metas | ||
Результат | array |
protected array $_quotes | ||
Результат | array |