PHP Class Nette\Database\Helpers

Author: David Grudl
ファイルを表示 Open project: nette/database Class Usage Examples

Public Properties

Property Type Description
$maxLength maximum SQL length
$typePatterns array

Public Methods

Method Description
createDebugPanel ( $connection, $explain = TRUE, $name = NULL )
detectType ( $type ) : string Heuristic column type detection.
detectTypes ( PDOStatement $statement ) : array Common column type detection.
dumpResult ( ResultSet $result ) : void Displays complete result set as HTML table for debug purposes.
dumpSql ( $sql, array $params = NULL, Connection $connection = NULL ) : string Returns syntax highlighted SQL command.
findDuplicates ( PDOStatement $statement ) : string Finds duplicate columns in select statement
loadFromFile ( Connection $connection, $file ) : integer Import SQL dump from file - extremely fast.
toPairs ( array $rows, $key = NULL, $value = NULL ) : array Reformat source to key -> value pairs.

Method Details

createDebugPanel() public static method

public static createDebugPanel ( $connection, $explain = TRUE, $name = NULL )

detectType() public static method

Heuristic column type detection.
public static detectType ( $type ) : string
return string

detectTypes() public static method

Common column type detection.
public static detectTypes ( PDOStatement $statement ) : array
$statement PDOStatement
return array

dumpResult() public static method

Displays complete result set as HTML table for debug purposes.
public static dumpResult ( ResultSet $result ) : void
$result ResultSet
return void

dumpSql() public static method

Returns syntax highlighted SQL command.
public static dumpSql ( $sql, array $params = NULL, Connection $connection = NULL ) : string
$params array
$connection Connection
return string

findDuplicates() public static method

Finds duplicate columns in select statement
public static findDuplicates ( PDOStatement $statement ) : string
$statement PDOStatement
return string

loadFromFile() public static method

Import SQL dump from file - extremely fast.
public static loadFromFile ( Connection $connection, $file ) : integer
$connection Connection
return integer count of commands

toPairs() public static method

Reformat source to key -> value pairs.
public static toPairs ( array $rows, $key = NULL, $value = NULL ) : array
$rows array
return array

Property Details

$maxLength public_oe static_oe property

maximum SQL length
public static $maxLength

$typePatterns public_oe static_oe property

public static array $typePatterns
return array