PHP Class Spot\Adapter\Sqlite

Inheritance: extends Spot\Adapter\PDO\BaseAbstract, implements Spot\Adapter\AdapterInterface
Datei anzeigen Open project: vlucas/spot

Protected Properties

Property Type Description
$_charset not supported
$_collate only UTF_8 supported
$_engine Driver-Specific settings
$_fieldTypeMap @todo Have to improve this to allow custom types, callbacks, and validation
$_format_date Format for date columns, formatted for PHP's date() function
$_format_datetime
$_format_time

Public Methods

Method Description
connection ( ) : object Get database connection
escapeField ( $field ) Escape/quote direct user input
migrate ( String $table, array $fields, array $options = [] ) Migrate table structure changes to database
migrateSyntaxFieldCreate ( string $fieldName, array $fieldInfo ) : string Syntax for each column in CREATE TABLE command
migrateSyntaxFieldUpdate ( string $fieldName, array $fieldInfo, $add = false ) : string Syntax for each column in CREATE TABLE command
migrateSyntaxTableCreate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : string Syntax for CREATE TABLE with given fields and column syntax
migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : string Syntax for ALTER TABLE with given fields and column syntax
truncateDatasource ( $datasource ) Truncate a database table Should delete all rows and reset serial/auto_increment keys to 0

Protected Methods

Method Description
getColumnsForTable ( String $table, string $source ) : Array Get columns for current table
shouldUpdateMigrateField ( $formattedField, $columnInfo )

Method Details

connection() public method

Get database connection
public connection ( ) : object
return object PDO

escapeField() public method

Escape/quote direct user input
public escapeField ( $field )

getColumnsForTable() protected method

Get columns for current table
protected getColumnsForTable ( String $table, string $source ) : Array
$table String Table name
$source string
return Array

migrate() public method

Migrate table structure changes to database
public migrate ( String $table, array $fields, array $options = [] )
$table String Table name
$fields array Fields and their attributes as defined in the mapper
$options array Options that may affect migrations or how tables are setup

migrateSyntaxFieldCreate() public method

Syntax for each column in CREATE TABLE command
public migrateSyntaxFieldCreate ( string $fieldName, array $fieldInfo ) : string
$fieldName string Field name
$fieldInfo array Array of field settings
return string SQL syntax

migrateSyntaxFieldUpdate() public method

Syntax for each column in CREATE TABLE command
public migrateSyntaxFieldUpdate ( string $fieldName, array $fieldInfo, $add = false ) : string
$fieldName string Field name
$fieldInfo array Array of field settings
return string SQL syntax

migrateSyntaxTableCreate() public method

Syntax for CREATE TABLE with given fields and column syntax
public migrateSyntaxTableCreate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : string
$table string Table name
$formattedFields array Array of fields with all settings
$columnsSyntax array Array of SQL syntax of columns produced by 'migrateSyntaxFieldCreate' function
$options array Options that may affect migrations or how tables are setup
return string SQL syntax

migrateSyntaxTableUpdate() public method

Syntax for ALTER TABLE with given fields and column syntax
public migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : string
$table string Table name
$formattedFields array Array of fields with all settings
$columnsSyntax array Array of SQL syntax of columns produced by 'migrateSyntaxFieldUpdate' function
$options array
return string SQL syntax

shouldUpdateMigrateField() protected method

protected shouldUpdateMigrateField ( $formattedField, $columnInfo )

truncateDatasource() public method

Truncate a database table Should delete all rows and reset serial/auto_increment keys to 0
public truncateDatasource ( $datasource )

Property Details

$_charset protected_oe property

not supported
protected $_charset

$_collate protected_oe property

only UTF_8 supported
protected $_collate

$_engine protected_oe property

Driver-Specific settings
protected $_engine

$_fieldTypeMap protected_oe property

@todo Have to improve this to allow custom types, callbacks, and validation
protected $_fieldTypeMap

$_format_date protected_oe property

Format for date columns, formatted for PHP's date() function
protected $_format_date

$_format_datetime protected_oe property

protected $_format_datetime

$_format_time protected_oe property

protected $_format_time