Interface for database driver.
string 'cte'
Common Table Expressions (with clause) support.
string 'disable-constraint-without-transaction'
Disabling constraints without being in transaction support.
string 'json'
Native JSON data type support.
string 'quote'
PDO::quote() support.
string 'savepoint'
Transaction savepoint support.
string 'truncate-with-constraints'
Truncate with foreign keys attached support.
string 'window'
Window function support (all or partial clauses).
Starts a transaction.
Commits a transaction.
Transforms the passed query to this Driver's dialect and returns an instance of the transformed query and the full compiled SQL string.
Establishes a connection to the database server.
Disable auto quoting of identifiers in queries.
Get the SQL for disabling foreign keys.
Disconnects from database server.
Sets whether this driver should automatically quote identifiers in queries.
Get the SQL for enabling foreign keys.
Returns whether php is able to use this driver for connecting to database.
Returns the number of connection retry attempts made.
Returns correct connection resource or object that is internally used.
Returns the maximum alias length allowed.
Returns whether a transaction is active.
Returns whether this driver should automatically quote identifiers in queries.
Checks whether the driver is connected.
Returns last id generated for a table or sequence in database.
Returns an instance of a QueryCompiler.
Constructs new TableSchema.
Prepares a sql statement to be executed.
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.
Returns a value in a safe representation to be used in a query string
Quotes a database identifier (a column name, table name, etc..) to be used safely in queries without the risk of using reserved words.
Get the SQL for releasing a save point.
Get the SQL for rollingback a save point.
Rollbacks a transaction.
Get the SQL for creating a save point.
Returns the schema name that's being used.
Get the schema dialect.
Escapes values for use in schema definitions.
Set the internal connection object.
Checks whether a feature is supported by the driver.
Returns whether the driver supports adding or dropping constraints to already created tables.
Checks if the driver supports quoting.
Returns whether this driver supports save points for nested transactions.
beginTransaction(): bool
Starts a transaction.
boolcommitTransaction(): bool
Commits a transaction.
boolcompileQuery(Cake\Database\Query $query, Cake\Database\ValueBinder $binder): array
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 $binder The value binder to use.
arrayconnect(): bool
Establishes a connection to the database server.
boolCake\Database\Exception\MissingConnectionExceptiondisableAutoQuoting(): $this
Disable auto quoting of identifiers in queries.
$thisdisableForeignKeySQL(): string
Get the SQL for disabling foreign keys.
stringdisconnect(): void
Disconnects from database server.
voidenableAutoQuoting(bool $enable = true): $this
Sets whether this driver should automatically quote identifiers in queries.
bool $enable optional Whether to enable auto quoting
$thisenableForeignKeySQL(): string
Get the SQL for enabling foreign keys.
stringenabled(): bool
Returns whether php is able to use this driver for connecting to database.
boolgetConnectRetries(): int
Returns the number of connection retry attempts made.
intgetConnection(): object
Returns correct connection resource or object that is internally used.
objectgetMaxAliasLength(): int|null
Returns the maximum alias length allowed.
int|nullinTransaction(): bool
Returns whether a transaction is active.
boolisAutoQuotingEnabled(): bool
Returns whether this driver should automatically quote identifiers in queries.
boolisConnected(): bool
Checks whether the driver is connected.
boollastInsertId(string|null $table = null, string|null $column = null): string|int
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|intnewCompiler(): Cake\Database\QueryCompiler
Returns an instance of a QueryCompiler.
Cake\Database\QueryCompilernewTableSchema(string $table, array $columns = []): Cake\Database\Schema\TableSchema
Constructs new TableSchema.
string $table The table name.
array $columns optional The list of columns for the schema.
Cake\Database\Schema\TableSchemaprepare(Cake\Database\Query|string $query): Cake\Database\StatementInterface
Prepares a sql statement to be executed.
Cake\Database\Query|string $query The query to turn into a prepared statement.
Cake\Database\StatementInterfacequeryTranslator(string $type): Closure
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).
Closurequote(mixed $value, int $type): string
Returns a value in a safe representation to be used in a query string
mixed $value The value to quote.
int $type Must be one of the \PDO::PARAM_* constants
stringquoteIdentifier(string $identifier): string
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 expression to quote.
stringreleaseSavePointSQL(string|int $name): string
Get the SQL for releasing a save point.
string|int $name Save point name or id
stringrollbackSavePointSQL(string|int $name): string
Get the SQL for rollingback a save point.
string|int $name Save point name or id
stringrollbackTransaction(): bool
Rollbacks a transaction.
boolsavePointSQL(string|int $name): string
Get the SQL for creating a save point.
string|int $name Save point name or id
stringschema(): string
Returns the schema name that's being used.
stringschemaDialect(): Cake\Database\Schema\SchemaDialect
Get the schema dialect.
Used by {@link \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\SchemaDialectschemaValue(mixed $value): string
Escapes values for use in schema definitions.
mixed $value The value to escape.
stringsetConnection(object $connection): $this
Set the internal connection object.
object $connection The connection instance.
$thissupports(string $feature): bool
Checks whether a feature is supported by the driver.
string $feature boolsupportsDynamicConstraints(): bool
Returns whether the driver supports adding or dropping constraints to already created tables.
boolsupportsQuoting(): bool
Checks if the driver supports quoting.
boolsupportsSavePoints(): bool
Returns whether this driver supports save points for nested transactions.
bool
© 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.4/interface-Cake.Database.DriverInterface.html