Backend
Backend
Interface for relational database driver backends.
interface BackendDefines the contract for database operations, error handling, attribute management, and query execution. Implementations must provide methods for creating databases, managing connections, executing queries, and handling driver-specific features.
Methods
createDatabase
Creates a new database with the specified name.
public createDatabase(string $name): boolParameters
| Parameter | Type | Description |
|---|---|---|
$name | string |
errorInfo
public errorInfo(false $): voidParameters
| Parameter | Type | Description |
|---|---|---|
$ | false |
errorCode
Returns the error code for the last database operation.
public errorCode(): stringsetTimezone
Sets the timezone for the database connection.
public setTimezone(string $tz): boolParameters
| Parameter | Type | Description |
|---|---|---|
$tz | string |
lastInsertId
Returns the ID of the last inserted row.
public lastInsertId(): stringgetAttribute
Retrieves the value of a driver-specific attribute.
public getAttribute(int $attribute): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$attribute | int |
setAttribute
Sets the value of a driver-specific attribute.
public setAttribute(int $attribute, mixed $value): boolParameters
| Parameter | Type | Description |
|---|---|---|
$attribute | int | |
$value | mixed |
exec
Executes an SQL statement and returns the number of affected rows or false on failure.
public exec(string $sql): intParameters
| Parameter | Type | Description |
|---|---|---|
$sql | string |
query
Executes a SQL query.
public query(string $sql, array $parameters): ResultParameters
| Parameter | Type | Description |
|---|---|---|
$sql | string | |
$parameters | array |
getQueryBuilder
Returns a query builder instance.
public getQueryBuilder(): QueryBuilderlastQueryString
Returns the last query string executed by the driver.
public lastQueryString(): stringGenerated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000