DatabaseDriverInterface
interface DatabaseDriverInterface (View source)
Defines the database driver operations used by the framework database layer.
Methods
Determines whether a table is available in the current database schema.
Executes SQL through the active driver and returns a cursor only for result-producing statements.
Streams result rows without requiring the caller to work with a driver-specific cursor.
Executes a statement without binding values or returning a result cursor.
Provides this part of the database contract while preserving the object's current state and driver semantics.
Provides this part of the database contract while preserving the object's current state and driver semantics.
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
Provides this part of the database contract while preserving the object's current state and driver semantics.
Provides this part of the database contract while preserving the object's current state and driver semantics.
Provides this part of the database contract while preserving the object's current state and driver semantics.
Details
tableExists
bool
tableExists(string $table)
Determines whether a table is available in the current database schema.
query
DatabaseResultInterface|bool
query(string $sql, array|false $binds = false)
Executes SQL through the active driver and returns a cursor only for result-producing statements.
cursor
Generator
cursor(string $sql, array|false $binds = false)
Streams result rows without requiring the caller to work with a driver-specific cursor.
simple_query
bool
simple_query(string $sql)
Executes a statement without binding values or returning a result cursor.
affected_rows
int
affected_rows()
Provides this part of the database contract while preserving the object's current state and driver semantics.
insert_id
int|string|null
insert_id()
Provides this part of the database contract while preserving the object's current state and driver semantics.
escape
string
escape(mixed $value)
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
escape_str
string
escape_str(string $value, bool $like = false)
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
escape_like_str
string
escape_like_str(string $value)
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
escape_identifiers
string
escape_identifiers(string $item)
Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.
protect_identifiers
string
protect_identifiers(string $item, bool $prefixSingle = false, bool|null $protectIdentifiers = null, bool $fieldExists = true)
Provides this part of the database contract while preserving the object's current state and driver semantics.
platform
string
platform()
Provides this part of the database contract while preserving the object's current state and driver semantics.
version
string
version()
Provides this part of the database contract while preserving the object's current state and driver semantics.