class Helpers

Database helpers.

Traits

Static class.

Properties

static int $maxLength
static array $typePatterns

Methods

static void
dumpResult(ResultSet $result)

Displays complete result set as HTML table for debug purposes.

static string
dumpSql(string $sql, array $params = null, Connection $connection = null)

Returns syntax highlighted SQL command.

static array
detectTypes(PDOStatement $statement)

Common column type detection.

static string
detectType(string $type)

Heuristic column type detection.

static int
loadFromFile(Connection $connection, string $file, callable $onProgress = null)

Import SQL dump from file - extremely fast.

static ConnectionPanel
createDebugPanel($connection, bool $explain = true, string $name = null)

No description

static array
toPairs(array $rows, $key = null, $value = null)

Reformat source to key -> value pairs.

static string
findDuplicates(PDOStatement $statement)

Finds duplicate columns in select statement

Details

at line 42
static void dumpResult(ResultSet $result)

Displays complete result set as HTML table for debug purposes.

Parameters

ResultSet $result

Return Value

void

at line 84
static string dumpSql(string $sql, array $params = null, Connection $connection = null)

Returns syntax highlighted SQL command.

Parameters

string $sql
array $params
Connection $connection

Return Value

string

at line 152
static array detectTypes(PDOStatement $statement)

Common column type detection.

Parameters

PDOStatement $statement

Return Value

array

at line 170
static string detectType(string $type)

Heuristic column type detection.

Parameters

string $type

Return Value

string

at line 190
static int loadFromFile(Connection $connection, string $file, callable $onProgress = null)

Import SQL dump from file - extremely fast.

Parameters

Connection $connection
string $file
callable $onProgress

Return Value

int count of commands

at line 234
static ConnectionPanel createDebugPanel($connection, bool $explain = true, string $name = null)

Parameters

$connection
bool $explain
string $name

Return Value

ConnectionPanel

at line 247
static array toPairs(array $rows, $key = null, $value = null)

Reformat source to key -> value pairs.

Parameters

array $rows
$key
$value

Return Value

array

at line 283
static string findDuplicates(PDOStatement $statement)

Finds duplicate columns in select statement

Parameters

PDOStatement $statement

Return Value

string