Helpers
class Helpers
Database utility functions.
Properties
| static | $maxLength | maximum SQL length |
|
| static array<string,string> | $typePatterns |
Methods
Returns syntax-highlighted SQL query as an HTML string.
Detects column types from a PDO statement using column metadata.
Maps a native column type string to an IStructure::FIELD_* constant.
No description
Imports SQL dump from file.
No description
No description
No description
Returns a human-readable string listing duplicate column names in the result set.
Parses a SQL column type string into its components.
Details
at line 43
static void
dumpResult(ResultSet $result)
Displays result set as HTML table.
at line 91
static string
dumpSql(string $sql, array|null $params = null, Connection|null $connection = null)
Returns syntax-highlighted SQL query as an HTML string.
at line 171
static array
detectTypes(PDOStatement $statement)
Detects column types from a PDO statement using column metadata.
at line 190
static string
detectType(string $type)
| internal |
Maps a native column type string to an IStructure::FIELD_* constant.
at line 213
static array
normalizeRow(array $row, ResultSet $resultSet, string $dateTimeClass = Nette\Utils\DateTime::class)
No description
at line 261
static int
loadFromFile(Connection $connection, string $file, callable|null $onProgress = null)
Imports SQL dump from file.
at line 307
static ConnectionPanel|null
createDebugPanel(Connection $connection, bool $explain, string $name, Bar $bar, BlueScreen $blueScreen)
deprecated
deprecated
No description
at line 320
static ConnectionPanel|null
initializeTracy(Connection $connection, bool $addBarPanel = false, string $name = '', bool $explain = true, Bar|null $bar = null, BlueScreen|null $blueScreen = null)
deprecated
deprecated
No description
at line 340
static array
toPairs(array $rows, string|int|Closure|null $key, string|int|null $value)
No description
at line 384
static string
findDuplicates(PDOStatement $statement)
Returns a human-readable string listing duplicate column names in the result set.
at line 412
static array
parseColumnType(string $type)
Parses a SQL column type string into its components.