interface DatabaseDriverInterface (View source)

Defines the database driver operations used by the framework database layer.

Methods

bool
tableExists(string $table)

Determines whether a table is available in the current database schema.

bool
query(string $sql, array|false $binds = false)

Executes SQL through the active driver and returns a cursor only for result-producing statements.

cursor(string $sql, array|false $binds = false)

Streams result rows without requiring the caller to work with a driver-specific cursor.

bool
simple_query(string $sql)

Executes a statement without binding values or returning a result cursor.

bool
int

Provides this part of the database contract while preserving the object's current state and driver semantics.

int
int|string|null

Provides this part of the database contract while preserving the object's current state and driver semantics.

int|string|null
string
escape(mixed $value)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

string
string
escape_str(string $value, bool $like = false)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

string
string
escape_like_str(string $value)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

string
string
escape_identifiers(string $item)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

string
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.

string
string

Provides this part of the database contract while preserving the object's current state and driver semantics.

string
string

Provides this part of the database contract while preserving the object's current state and driver semantics.

string

Details

tableExists

bool tableExists(string $table)

Determines whether a table is available in the current database schema.

Parameters

string $table

Return Value

bool

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.

Parameters

string $sql
array|false $binds

Return Value

DatabaseResultInterface|bool

cursor

Generator cursor(string $sql, array|false $binds = false)

Streams result rows without requiring the caller to work with a driver-specific cursor.

Parameters

string $sql
array|false $binds

Return Value

Generator

simple_query

bool simple_query(string $sql)

Executes a statement without binding values or returning a result cursor.

Parameters

string $sql

Return Value

bool

affected_rows

int affected_rows()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

int

insert_id

int|string|null insert_id()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

int|string|null

escape

string escape(mixed $value)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

Parameters

mixed $value

Return Value

string

escape_str

string escape_str(string $value, bool $like = false)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

Parameters

string $value
bool $like

Return Value

string

escape_like_str

string escape_like_str(string $value)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

Parameters

string $value

Return Value

string

escape_identifiers

string escape_identifiers(string $item)

Escapes the supplied value or identifier for safe inclusion in driver-generated SQL.

Parameters

string $item

Return Value

string

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.

Parameters

string $item
bool $prefixSingle
bool|null $protectIdentifiers
bool $fieldExists

Return Value

string

platform

string platform()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string

version

string version()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string