SQL
Less than 1 minute
SQL
Trait providing SQL-related utility methods for database drivers.
trait SQLIncludes query builder initialization, database creation, privilege management, and type/value helpers.
Properties
schemaName
public string $schemaNameMethods
initQueryBuilder
Initializes the query builder with an optional schema name.
public initQueryBuilder(?string $schemaName): voidParameters
| Parameter | Type | Description |
|---|---|---|
$schemaName | string | the schema name to use for queries |
getQueryBuilder
Returns a new SQL query builder instance, optionally setting reserved words.
public getQueryBuilder(): QueryBuildercreateDatabase
Creates a new database with the given name.
public createDatabase(string $name): boolParameters
| Parameter | Type | Description |
|---|---|---|
$name | string | the name of the database to create |
grant
public grant(string $privilege, string $to, string $object): boolParameters
| Parameter | Type | Description |
|---|---|---|
$privilege | string | |
$to | string | |
$object | string |
revoke
public revoke(string $privilege, string $object, string $from): boolParameters
| Parameter | Type | Description |
|---|---|---|
$privilege | string | |
$object | string | |
$from | string |
fixValue
Fixes or transforms a value before using it in SQL queries.
protected fixValue(mixed $value): mixedOverride in implementing classes to provide custom value handling.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed | the value to fix or transform |
type
Returns the SQL data type string, optionally with length and array notation.
protected type(?string $dataType, ?int $length): stringParameters
| Parameter | Type | Description |
|---|---|---|
$dataType | string | the base data type |
$length | int | the length for the data type, if applicable |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000