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 query as an HTML string.

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)

No description

static array
parseColumnType(string $type)

Parses a SQL column type string into its components.

Details

at line 29
static void dumpResult(Result $result)

Displays result set as HTML table.

Parameters

Result $result

Return Value

void

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

Returns syntax-highlighted SQL query as an HTML string.

Parameters

SqlLiteral $query
Explorer|null $explorer

Return Value

string

at line 160
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 205
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 219
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 241
static array toPairs(array $rows, string|int|Closure|null $key, string|int|null $value)

No description

Parameters

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

Return Value

array

at line 286
static array parseColumnType(string $type)

Parses a SQL column type string into its components.

Parameters

string $type

Return Value

array

Traits

StaticClass