Class Sqlite
int|null
null
int[]
[]
bool
Indicates whether or not the driver is doing automatic identifier quoting for all queries
array
Base configuration settings for Sqlite driver
array
Configuration data.
\PDO
Instance of PDO.
array
Mapping of date parts.
string
String used to end a database identifier quoting to make it safe
\Cake\Database\Schema\SqliteSchemaDialect
The schema dialect class for this driver
string
String used to start a database identifier quoting to make it safe
bool|null
Whether or not the connected server supports window functions.
string|null
The server version
int
The last number of connection retry attempts.
bool|null
Whether or not the server supports common table expressions.
Returns an array that can be used to describe the internal state of this object.
Returns an associative array of methods that will transform Expression objects to conform with the specific SQL dialect. Keys are class names and values a method in this class.
Returns the passed query after rewriting the DISTINCT clause, so that drivers that do not support the "ON" part can provide the actual way it should be done
Receives a TupleExpression and changes it so that it conforms to this SQL dialect.
Transforms the passed query to this Driver's dialect and returns an instance of the transformed query and the full compiled SQL string.
Sets whether or not this driver should automatically quote identifiers in queries.
Returns whether or not this driver should automatically quote identifiers in queries.
Returns a callable function that will be used to transform a passed Query object.
Quotes a database identifier (a column name, table name, etc..) to be used safely in queries without the risk of using reserved words
Returns whether the driver supports adding or dropping constraints to already created tables.
Returns whether this driver supports save points for nested transactions.
__construct(array $config)
Constructor
array
$config optional The configuration for the driver.
InvalidArgumentException
__debugInfo()
Returns an array that can be used to describe the internal state of this object.
array
__destruct()
Destructor
_connect(string $dsn, array $config)
Establishes a connection to the database server
string
$dsn A Driver-specific PDO-DSN
array
$config configuration to be used for creating connection
bool
true on success
_deleteQueryTranslator(\Cake\Database\Query $query)
Apply translation steps to delete queries.
Chops out aliases on delete query conditions as most database dialects do not support aliases in delete queries. This also removes aliases in table names as they frequently don't work either.
We are intentionally not supporting deletes with joins as they have even poorer support.
\Cake\Database\Query
$query The query to translate
\Cake\Database\Query
The modified query
_expressionTranslators()
Returns an associative array of methods that will transform Expression objects to conform with the specific SQL dialect. Keys are class names and values a method in this class.
string[]
_insertQueryTranslator(\Cake\Database\Query $query)
Apply translation steps to insert queries.
\Cake\Database\Query
$query The query to translate
\Cake\Database\Query
The modified query
_removeAliasesFromConditions(\Cake\Database\Query $query)
Removes aliases from the WHERE
clause of a query.
\Cake\Database\Query
$query The query to process.
\Cake\Database\Query
The modified query.
RuntimeException
_selectQueryTranslator(\Cake\Database\Query $query)
Apply translation steps to select queries.
\Cake\Database\Query
$query The query to translate
\Cake\Database\Query
The modified query
_transformDistinct(\Cake\Database\Query $query)
Returns the passed query after rewriting the DISTINCT clause, so that drivers that do not support the "ON" part can provide the actual way it should be done
\Cake\Database\Query
$query The query to be transformed
\Cake\Database\Query
_transformFunctionExpression(\Cake\Database\Expression\FunctionExpression $expression)
\Cake\Database\Expression\FunctionExpression
$expression _transformTupleComparison(\Cake\Database\Expression\TupleComparison $expression, \Cake\Database\Query $query)
Receives a TupleExpression and changes it so that it conforms to this SQL dialect.
It transforms expressions looking like '(a, b) IN ((c, d), (e, f))' into an equivalent expression of the form '((a = c) AND (b = d)) OR ((a = e) AND (b = f))'.
It can also transform transform expressions where the right hand side is a query selecting the same amount of columns as the elements in the left hand side of the expression:
(a, b) IN (SELECT c, d FROM a_table) is transformed into
1 = (SELECT 1 FROM a_table WHERE (a = c) AND (b = d))
\Cake\Database\Expression\TupleComparison
$expression The expression to transform
\Cake\Database\Query
$query The query to update.
_updateQueryTranslator(\Cake\Database\Query $query)
Apply translation steps to update queries.
Chops out aliases on update query conditions as not all database dialects do support aliases in update queries.
Just like for delete queries, joins are currently not supported for update queries.
\Cake\Database\Query
$query The query to translate
\Cake\Database\Query
The modified query
beginTransaction()
Starts a transaction.
bool
True on success, false otherwise.
commitTransaction()
Commits a transaction.
bool
True on success, false otherwise.
compileQuery(\Cake\Database\Query $query, \Cake\Database\ValueBinder $generator)
Transforms the passed query to this Driver's dialect and returns an instance of the transformed query and the full compiled SQL string.
\Cake\Database\Query
$query The query to compile.
\Cake\Database\ValueBinder
$generator The value binder to use.
array
containing 2 entries. The first entity is the transformed query and the second one the compiled SQL.
connect()
Establishes a connection to the database server
bool
true on success
disableAutoQuoting()
Disable auto quoting of identifiers in queries.
$this
disableForeignKeySQL()
Get the SQL for disabling foreign keys.
string
disconnect()
Disconnects from database server.
enableAutoQuoting(bool $enable)
Sets whether or not this driver should automatically quote identifiers in queries.
bool
$enable optional Whether to enable auto quoting
$this
enableForeignKeySQL()
Get the SQL for enabling foreign keys.
string
enabled()
Returns whether php is able to use this driver for connecting to database
bool
true if it is valid to use this driver
getConnectRetries()
Returns the number of connection retry attempts made.
int
getConnection()
Get the internal PDO connection instance.
\PDO
getMaxAliasLength()
Returns the maximum alias length allowed.
This can be different than the maximum identifier length for columns.
int|null
Maximum alias length or null if no limit
isAutoQuotingEnabled()
Returns whether or not this driver should automatically quote identifiers in queries.
bool
isConnected()
Checks whether or not the driver is connected.
bool
lastInsertId(?string $table, ?string $column)
Returns last id generated for a table or sequence in database.
string|null
$table optional table name or sequence to get last insert value from.
string|null
$column optional the name of the column representing the primary key.
string|int
newCompiler()
Returns an instance of a QueryCompiler.
\Cake\Database\QueryCompiler
newTableSchema(string $table, array $columns)
Constructs new TableSchema.
string
$table The table name.
array
$columns optional The list of columns for the schema.
\Cake\Database\Schema\TableSchema
prepare(mixed $query)
Prepares a sql statement to be executed
string|\Cake\Database\Query
$query The query to prepare.
\Cake\Database\StatementInterface
queryTranslator(string $type)
Returns a callable function that will be used to transform a passed Query object.
This function, in turn, will return an instance of a Query object that has been transformed to accommodate any specificities of the SQL dialect in use.
string
$type the type of query to be transformed (select, insert, update, delete)
\Closure
quote(mixed $value, mixed $type)
Returns a value in a safe representation to be used in a query string
mixed
$value The value to quote.
int
$type optional Type to be used for determining kind of quoting to perform.
string
quoteIdentifier(string $identifier)
Quotes a database identifier (a column name, table name, etc..) to be used safely in queries without the risk of using reserved words
string
$identifier The identifier to quote.
string
releaseSavePointSQL(mixed $name)
Returns a SQL snippet for releasing a previously created save point
string|int
$name save point name
string
rollbackSavePointSQL(mixed $name)
Returns a SQL snippet for rollbacking a previously created save point
string|int
$name save point name
string
rollbackTransaction()
Rollbacks a transaction.
bool
True on success, false otherwise.
savePointSQL(mixed $name)
Returns a SQL snippet for creating a new transaction savepoint
string|int
$name save point name
string
schema()
Returns the schema name that's being used.
string
schemaDialect()
Get the schema dialect.
Used by Cake\Database\Schema package to reflect schema and generate schema.
If all the tables that use this Driver specify their own schemas, then this may return null.
\Cake\Database\Schema\SchemaDialect
schemaValue(mixed $value)
Escapes values for use in schema definitions.
mixed
$value The value to escape.
string
String for use in schema definitions.
setConnection(mixed $connection)
Set the internal PDO connection instance.
\PDO
$connection PDO instance.
$this
supportsCTEs()
Returns true if the server supports common table expressions.
bool
supportsDynamicConstraints()
Returns whether the driver supports adding or dropping constraints to already created tables.
bool
True if driver supports dynamic constraints.
supportsQuoting()
Checks if the driver supports quoting, as PDO_ODBC does not support it.
bool
supportsSavePoints()
Returns whether this driver supports save points for nested transactions.
bool
True if save points are supported, false otherwise.
supportsWindowFunctions()
Returns true if the connected server supports window functions.
bool
version()
Returns connected server version.
string
Indicates whether or not the driver is doing automatic identifier quoting for all queries
bool
Base configuration settings for Sqlite driver
mask
The mask used for created databasearray
Configuration data.
array
Instance of PDO.
\PDO
Mapping of date parts.
array
String used to end a database identifier quoting to make it safe
string
The schema dialect class for this driver
\Cake\Database\Schema\SqliteSchemaDialect
String used to start a database identifier quoting to make it safe
string
Whether or not the connected server supports window functions.
bool|null
The server version
string|null
The last number of connection retry attempts.
int
Whether or not the server supports common table expressions.
bool|null
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Database.Driver.Sqlite.html