PHP Class Zend_Db_Adapter_Pdo_Sqlite

Inheritance: extends Zend_Db_Adapter_Pdo_Abstract
ファイルを表示 Open project: kimai/kimai Class Usage Examples

Protected Properties

Property Type Description
$_numericDataTypes Values are: 0 = 32-bit integer 1 = 64-bit integer 2 = float or decimal
$_pdoType string PDO type

Public Methods

Method Description
__construct ( array $config = [] ) Constructor.
describeTable ( string $tableName, string $schemaName = null ) : array Returns the column descriptions for a table.
limit ( string $sql, integer $count, integer $offset ) : string Adds an adapter-specific LIMIT clause to the SELECT statement.
listTables ( ) : array Returns a list of the tables in the database.

Protected Methods

Method Description
_checkRequiredOptions ( array $config ) Check for config options that are mandatory.
_connect ( ) Special configuration for SQLite behavior: make sure that result sets contain keys like 'column' instead of 'table.column'.
_dsn ( ) DSN builder
_quote ( string $value ) : string Quote a raw string.

Method Details

__construct() public method

$config is an array of key/value pairs containing configuration options. Note that the SQLite options are different than most of the other PDO adapters in that no username or password are needed. Also, an extra config key "sqlite2" specifies compatibility mode. dbname => (string) The name of the database to user (required, use :memory: for memory-based database) sqlite2 => (boolean) PDO_SQLITE defaults to SQLite 3. For compatibility with an older SQLite 2 database, set this to TRUE.
public __construct ( array $config = [] )
$config array An array of configuration keys.

_checkRequiredOptions() protected method

Throw exceptions if any are missing.
protected _checkRequiredOptions ( array $config )
$config array

_connect() protected method

Special configuration for SQLite behavior: make sure that result sets contain keys like 'column' instead of 'table.column'.
protected _connect ( )

_dsn() protected method

DSN builder
protected _dsn ( )

_quote() protected method

Quote a raw string.
protected _quote ( string $value ) : string
$value string Raw string
return string Quoted string

describeTable() public method

The return value is an associative array keyed by the column name, as returned by the RDBMS. The value of each array element is an associative array with the following keys: SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMN_NAME => string; column name COLUMN_POSITION => number; ordinal position of column in table DATA_TYPE => string; SQL datatype name of column DEFAULT => string; default expression of column, null if none NULLABLE => boolean; true if column can have nulls LENGTH => number; length of CHAR/VARCHAR SCALE => number; scale of NUMERIC/DECIMAL PRECISION => number; precision of NUMERIC/DECIMAL UNSIGNED => boolean; unsigned property of an integer type PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key IDENTITY => integer; true if column is auto-generated with unique values
public describeTable ( string $tableName, string $schemaName = null ) : array
$tableName string
$schemaName string OPTIONAL
return array

limit() public method

Adds an adapter-specific LIMIT clause to the SELECT statement.
public limit ( string $sql, integer $count, integer $offset ) : string
$sql string
$count integer
$offset integer OPTIONAL
return string

listTables() public method

Returns a list of the tables in the database.
public listTables ( ) : array
return array

Property Details

$_numericDataTypes protected_oe property

Values are: 0 = 32-bit integer 1 = 64-bit integer 2 = float or decimal
protected $_numericDataTypes

$_pdoType protected_oe property

PDO type
protected string $_pdoType
return string