class MySqlDriver implements Driver

Supplemental MySQL database driver.

Constants

ERROR_ACCESS_DENIED

ERROR_DUPLICATE_ENTRY

ERROR_DATA_TRUNCATED

Methods

void
initialize(Connection $connection, array $options)

Driver options:

convertException(PDOException $e)

Converts PDOException to DriverException or its descendant.

string
delimite(string $name)

Delimites identifier for use in a SQL statement.

string
formatDateTime(DateTimeInterface $value)

Formats date-time for use in a SQL statement.

string
formatDateInterval(DateInterval $value)

Formats date-time interval for use in a SQL statement.

string
formatLike(string $value, int $pos)

Encodes string for use in a LIKE statement.

void
applyLimit(string $sql, int|null $limit, int|null $offset)

Injects LIMIT/OFFSET to the SQL query.

array
getTables()

Returns list of tables as tuples [(string) name, (bool) view, [(string) fullName]]

array
getColumns(string $table)

Returns metadata for all columns in a table.

array
getIndexes(string $table)

Returns metadata for all indexes in a table.

array
getForeignKeys(string $table)

Returns metadata for all foreign keys in a table.

array
getColumnTypes(PDOStatement $statement)

Returns associative array of detected types (IStructure::FIELD_*) in result set.

bool
isSupported(string $item)

Cheks if driver supports specific property

Details

at line 36
void initialize(Connection $connection, array $options)

Driver options:

Parameters

Connection $connection
array $options

Return Value

void

at line 50
DriverException convertException(PDOException $e)

Converts PDOException to DriverException or its descendant.

Parameters

PDOException $e

Return Value

DriverException

at line 74
string delimite(string $name)

Delimites identifier for use in a SQL statement.

Parameters

string $name

Return Value

string

at line 81
string formatDateTime(DateTimeInterface $value)

Formats date-time for use in a SQL statement.

Parameters

DateTimeInterface $value

Return Value

string

at line 87
string formatDateInterval(DateInterval $value)

Formats date-time interval for use in a SQL statement.

Parameters

DateInterval $value

Return Value

string

at line 93
string formatLike(string $value, int $pos)

Encodes string for use in a LIKE statement.

Parameters

string $value
int $pos

Return Value

string

at line 101
void applyLimit(string $sql, int|null $limit, int|null $offset)

Injects LIMIT/OFFSET to the SQL query.

Parameters

string $sql

query that will be modified.

int|null $limit
int|null $offset

Return Value

void

at line 117
array getTables()

Returns list of tables as tuples [(string) name, (bool) view, [(string) fullName]]

Return Value

array

at line 130
array getColumns(string $table)

Returns metadata for all columns in a table.

As tuples [(string) name, (string) table, (string) nativetype, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (bool) primary, (array) vendor]]

Parameters

string $table

Return Value

array

at line 152
array getIndexes(string $table)

Returns metadata for all indexes in a table.

As tuples [(string) name, (string[]) columns, (bool) unique, (bool) primary]

Parameters

string $table

Return Value

array

at line 166
array getForeignKeys(string $table)

Returns metadata for all foreign keys in a table.

As tuples [(string) name, (string) local, (string) table, (string) foreign]

Parameters

string $table

Return Value

array

at line 184
array getColumnTypes(PDOStatement $statement)

Returns associative array of detected types (IStructure::FIELD_*) in result set.

Parameters

PDOStatement $statement

Return Value

array

at line 201
bool isSupported(string $item)

Cheks if driver supports specific property

Parameters

string $item

self::SUPPORT_* property

Return Value

bool

Traits

Strict class for better experience.