Provides utilities methods for a database
| package |
jelix |
|---|---|
| subpackage |
db_driver |
__construct(\jDbConnection $connector = null)
encloseName(string $fieldName) : string
| since | 1.2 |
|---|
stringthe field name
stringthe enclosed field name
escapeValue(string $unifiedType, mixed $value, $checkNull = false, $toPhpSource = false) : string
| since | 1.2 |
|---|
stringthe unified type name
mixedthe value
stringthe value which is ready to include a SQL query string
execSQLScript( $file)
extractDateConverter( $parametersString)
getBooleanValue(string|boolean $value) : string
| since | 1.2 |
|---|
string|booleana value which is a boolean
stringthe string value representing a boolean in SQL
getFieldList(string $tableName, string $sequence = '', string $schemaName = '') : array<mixed,\jDbFieldProperties>
stringthe name of the table
stringthe sequence used to auto increment the primary key
stringthe name of the schema (only for PostgreSQL)
array<mixed,\jDbFieldProperties>keys are field names
getNativeSQLFunction(string $name, string|null $parametersString = null) : string
stringa SQL function, maybe a SQL function of another database type
string|nullparameters given to the function. Null if no parenthesis
stringthe SQL expression, possibly with a native SQL function corresponding to the given foreign SQL function
getSQLColumnsList(array<mixed,string> $columns) : string
| since | 1.6.16 |
|---|
array<mixed,string>list of column names
stringthe list in SQL
getTableList() : array
| Throws |
|
|---|
arraylist of table names
getTypeInfo(string $nativeType) : array
| since | 1.2 |
|---|
stringthe SQL type
arrayan array which contains characteristics of the type array ( 'nativetype', 'corresponding unifiedtype', minvalue, maxvalue, minlength, maxlength) minvalue, maxvalue, minlength, maxlength can be null.
insertBulkData(string $tableName, array<mixed,string> $columns, array<mixed,mixed[]> $data, string|array<mixed,string>|null $primaryKey = null, integer $options) : integer
| since | 1.6.16 |
|---|
string
array<mixed,string>the column names in which data will be inserted
array<mixed,mixed[]>the data. each row is an array of values. Values are in the same order as $columns
string|array<mixed,string>|nullthe column names that are the primary key. Don't give the primary key if it is an autoincrement field, or if option is not IBD_*_IF_EXIST
integerone of IDB_* const
integernumber of records inserted/updated
parseCREATETABLE( $createTableStatement) : array|boolean
| since | 1.6.16 |
|---|
array|booleanfalse if parsing has failed. Else an array : 'name' => the schema/table name, 'temporary'=> true if there is the temporary keywork , 'ifnotexists' => true if there is the IF NOT EXISTS statement, 'columns' => list of columns definitions, 'constraints' => list of table constraints definitions, 'options' => all options at the end of the CREATE TABLE statement.
parseSQLFunctionAndConvert( $expression)
parseSQLType(string $type) : array
..
string
array[$realtype, $length, $precision, $scale, $otherTypeDef]
stringToPhpValue(string $unifiedType, string $value, $checkNull = false) : string
| since | 1.2 |
|---|
stringthe unified type name
stringthe value
stringthe php value corresponding to the type
unifiedToPHPType(string $unifiedType) : string
| since | 1.2 |
|---|---|
| Throws |
|
string
stringthe php type
IBD_NO_CHECK
IBD_EMPTY_TABLE_BEFORE
IBD_INSERT_ONLY_IF_TABLE_IS_EMPTY
IBD_IGNORE_IF_EXIST
IBD_UPDATE_IF_EXIST
trueValue :
falseValue :
typesInfo :
keywordNameCorrespondence :
functionNameCorrespondence :
unifiedToPhp :
dbmsStyle :