class Helpers

Database helpers.

Properties

static $maxLength

maximum SQL length

static $typePatterns

Methods

static void
dumpResult(ResultSet $result)

Displays complete result set as HTML table for debug purposes.

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

Returns syntax highlighted SQL command.

static array
detectTypes(PDOStatement $statement)

Common column type detection.

static string
detectType(string $type) deprecated

No description

static array
normalizeRow(array $row, ResultSet $resultSet) deprecated

No description

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

Import SQL dump from file - extremely fast.

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

No description

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

No description

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

Reformat source to key -> value pairs.

static string
findDuplicates(ResultDriver $result)

Finds duplicate columns in select statement

Details

at line 32
static void dumpResult(ResultSet $result)

Displays complete result set as HTML table for debug purposes.

Parameters

ResultSet $result

Return Value

void

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

Returns syntax highlighted SQL command.

Parameters

string $sql
array|null $params
Connection|null $connection

Return Value

string

at line 158
static array detectTypes(PDOStatement $statement)

Common column type detection.

Parameters

PDOStatement $statement

Return Value

array

at line 174
static string detectType(string $type) deprecated

deprecated use RowNormalizer::detectType()

No description

Parameters

string $type

Return Value

string

at line 181
static array normalizeRow(array $row, ResultSet $resultSet) deprecated

deprecated use RowNormalizer

No description

Parameters

array $row
ResultSet $resultSet

Return Value

array

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

Import SQL dump from file - extremely fast.

Parameters

Connection $connection
string $file
callable|null $onProgress

Return Value

int

count of commands

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

deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize()

No description

Parameters

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

Return Value

ConnectionPanel|null

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

deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize()

No description

Parameters

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

Return Value

ConnectionPanel|null

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

Reformat source to key -> value pairs.

Parameters

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

Return Value

array

at line 305
static string findDuplicates(ResultDriver $result)

Finds duplicate columns in select statement

Parameters

ResultDriver $result

Return Value

string

Traits

StaticClass