class Helpers

Database utility functions.

Properties

static $maxLength

maximum SQL length

Methods

static void
dumpResult(Result $result)

Displays result set as HTML table.

static string
dumpSql(SqlLiteral $query, Explorer|null $explorer = null)

Returns syntax highlighted SQL command.

static int
loadFromFile(Explorer $explorer, string $file, callable|null $onProgress = null)

Imports SQL dump from file.

static ConnectionPanel|null
createDebugPanel(Explorer $connection, bool $explain, string $name, Bar $bar, BlueScreen $blueScreen)

No description

static ConnectionPanel|null
initializeTracy(Explorer $connection, bool $addBarPanel = false, string $name = '', bool $explain = true, Bar|null $bar = null, BlueScreen|null $blueScreen = null)

No description

static array
toPairs(array $rows, string|int|Closure|null $key, string|int|null $value)

Converts rows to key-value pairs.

static array
parseColumnType(string $type)

No description

Details

at line 31
static void dumpResult(Result $result)

Displays result set as HTML table.

Parameters

Result $result

Return Value

void

at line 78
static string dumpSql(SqlLiteral $query, Explorer|null $explorer = null)

Returns syntax highlighted SQL command.

Parameters

SqlLiteral $query
Explorer|null $explorer

Return Value

string

at line 161
static int loadFromFile(Explorer $explorer, string $file, callable|null $onProgress = null)

Imports SQL dump from file.

Parameters

Explorer $explorer
string $file
callable|null $onProgress

Return Value

int

Number of executed commands

Exceptions

FileNotFoundException

at line 206
static ConnectionPanel|null createDebugPanel(Explorer $connection, bool $explain, string $name, Bar $bar, BlueScreen $blueScreen)

No description

Parameters

Explorer $connection
bool $explain
string $name
Bar $bar
BlueScreen $blueScreen

Return Value

ConnectionPanel|null

at line 220
static ConnectionPanel|null initializeTracy(Explorer $connection, bool $addBarPanel = false, string $name = '', bool $explain = true, Bar|null $bar = null, BlueScreen|null $blueScreen = null)

No description

Parameters

Explorer $connection
bool $addBarPanel
string $name
bool $explain
Bar|null $bar
BlueScreen|null $blueScreen

Return Value

ConnectionPanel|null

at line 238
static array toPairs(array $rows, string|int|Closure|null $key, string|int|null $value)

Converts rows to key-value pairs.

Parameters

array $rows
string|int|Closure|null $key
string|int|null $value

Return Value

array

at line 280
static array parseColumnType(string $type)

No description

Parameters

string $type

Return Value

array

Traits

StaticClass