Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe JDatabaseDriverPostgresql
+ Graphe d'héritage de JDatabaseDriverPostgresql:

Fonctions membres publiques

 __construct ($options)
 
 connect ()
 
 disconnect ()
 
 escape ($text, $extra=false)
 
 connected ()
 
 dropTable ($tableName, $ifExists=true)
 
 getAffectedRows ()
 
 getCollation ()
 
 getConnectionCollation ()
 
 getNumRows ($cur=null)
 
 getQuery ($new=false, $asObj=false)
 
 getTableCreate ($tables)
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableKeys ($table)
 
 getTableList ()
 
 getTableSequences ($table)
 
 getVersion ()
 
 insertid ()
 
 lockTable ($tableName)
 
 execute ()
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 select ($database)
 
 setUtf ()
 
 sqlValue ($columns, $fieldName, $fieldValue)
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 insertObject ($table, &$object, $key=null)
 
 showTables ()
 
 getStringPositionSql ($substring, $string)
 
 getRandom ()
 
 getAlterDbCharacterSet ($dbName)
 
 getCreateDbQuery ($options, $utf)
 
 replacePrefix ($query, $prefix='#__')
 
 releaseTransactionSavepoint ($savepointName)
 
 transactionSavepoint ($savepointName)
 
 unlockTables ()
 
 updateObject ($table, &$object, $key, $nulls=false)
 
 getAlterTableCharacterSet ($tableName)
 
 quoteBinary ($data)
 
- Fonctions membres publiques hérités de JDatabaseDriver
 __call ($method, $args)
 
 __construct ($options)
 
 alterDbCharacterSet ($dbName)
 
 alterTableCharacterSet ($tableName, $rethrow=false)
 
 connect ()
 
 connected ()
 
 createDatabase ($options, $utf=true)
 
 __destruct ()
 
 disconnect ()
 
 addDisconnectHandler ($callable)
 
 dropTable ($table, $ifExists=true)
 
 escape ($text, $extra=false)
 
 getAffectedRows ()
 
 getAlterDbCharacterSet ($dbName)
 
 getAlterTableCharacterSet ($tableName)
 
 convertUtf8mb4QueryToUtf8 ($query)
 
 getCollation ()
 
 getConnectionCollation ()
 
 getConnection ()
 
 getCount ()
 
 getDateFormat ()
 
 getLog ()
 
 getTimings ()
 
 getCallStacks ()
 
 getMinimum ()
 
 getNullDate ()
 
 getNumRows ($cursor=null)
 
 getPrefix ()
 
 getExporter ()
 
 getImporter ()
 
 getName ()
 
 getServerType ()
 
 getQuery ($new=false)
 
 getIterator ($column=null, $class='stdClass')
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableCreate ($tables)
 
 getTableKeys ($table)
 
 getTableList ()
 
 getUTFSupport ()
 
 hasUTFSupport ()
 
 hasUTF8mb4Support ()
 
 getVersion ()
 
 insertid ()
 
 insertObject ($table, &$object, $key=null)
 
 isMinimumVersion ()
 
 loadAssoc ()
 
 loadAssocList ($key=null, $column=null)
 
 loadColumn ($offset=0)
 
 loadNextObject ($class='stdClass')
 
 loadNextRow ()
 
 loadObject ($class='stdClass')
 
 loadObjectList ($key='', $class='stdClass')
 
 loadResult ()
 
 loadRow ()
 
 loadRowList ($index=null)
 
 lockTable ($tableName)
 
 quote ($text, $escape=true)
 
 quoteBinary ($data)
 
 quoteName ($name, $as=null)
 
 replacePrefix ($sql, $prefix='#__')
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 select ($database)
 
 setDebug ($level)
 
 setQuery ($query, $offset=0, $limit=0)
 
 setUtf ()
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 truncateTable ($table)
 
 updateObject ($table, &$object, $key, $nulls=false)
 
 execute ()
 
 unlockTables ()
 
- Fonctions membres publiques hérités de JDatabase
 query ()
 
 getErrorMsg ($escaped=false)
 
 getErrorNum ()
 
 stderr ($showSQL=false)
 

Fonctions membres publiques statiques

static test ()
 
static isSupported ()
 
- Fonctions membres publiques statiques hérités de JDatabaseDriver
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($sql)
 
- Fonctions membres publiques statiques hérités de JDatabase
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($query)
 
static test ()
 

Champs de données

 $name = 'postgresql'
 
 $serverType = 'postgresql'
 
- Champs de données hérités de JDatabaseDriver
 $name
 
 $serverType
 

Fonctions membres protégées

 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getErrorNumber ()
 
 getErrorMessage ()
 
 getCreateDatabaseQuery ($options, $utf)
 
- Fonctions membres protégées hérités de JDatabaseDriver
 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getCreateDatabaseQuery ($options, $utf)
 
 getDatabase ()
 
 quoteNameStr ($strArr)
 

Attributs protégés

 $nameQuote = '"'
 
 $nullDate = '1970-01-01 00:00:00'
 
 $concat_operator = '||'
 
 $queryObject = null
 
- Attributs protégés hérités de JDatabaseDriver
 $connection
 
 $count = 0
 
 $cursor
 
 $debug = false
 
 $limit = 0
 
 $log = array()
 
 $timings = array()
 
 $callStacks = array()
 
 $nameQuote
 
 $nullDate
 
 $offset = 0
 
 $options
 
 $sql
 
 $tablePrefix
 
 $utf = true
 
 $utf8mb4 = false
 
 $errorNum = 0
 
 $errorMsg
 
 $transactionDepth = 0
 
 $disconnectHandlers = array()
 

Attributs protégés statiques

static $dbMinimum = '8.3.18'
 
- Attributs protégés statiques hérités de JDatabaseDriver
static $instances = array()
 
static $dbMinimum
 

Fonctions membres privées

 getDefaultSchema ()
 

Description détaillée

PostgreSQL database driver

Depuis
3.0.0
Obsolète:
4.0 Use PDO PostgreSQL instead

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options)

Database object constructor

Paramètres
array$optionsList of options used to configure the connection
Depuis
3.0.0

Références $options, et null.

Documentation des fonctions membres

◆ connect()

connect ( )

Connects to the database if needed.

Renvoie
void Returns void if the database connected successfully.
Depuis
3.0.0
Exceptions
RuntimeException

Références $tmp.

◆ connected()

connected ( )

Determines if the connection to the server is active.

Renvoie
boolean
Depuis
3.0.0

◆ disconnect()

disconnect ( )

Disconnects the database.

Renvoie
void
Depuis
3.0.0

Références null.

◆ dropTable()

dropTable (   $tableName,
  $ifExists = true 
)

Drops a table from the database.

Paramètres
string$tableNameThe name of the database table to drop.
boolean$ifExistsOptionally specify that the table must exist before it is dropped.
Renvoie
boolean
Depuis
3.0.0
Exceptions
RuntimeException

◆ escape()

escape (   $text,
  $extra = false 
)

Method to escape a string for usage in an SQL statement.

Paramètres
string$textThe string to be escaped.
boolean$extraOptional parameter to provide extra escaping.
Renvoie
string The escaped string.
Depuis
3.0.0

Références $text.

◆ execute()

execute ( )

Execute the SQL statement.

Renvoie
mixed A database cursor resource on success, boolean false on failure.
Depuis
3.0.0
Exceptions
RuntimeException

Références $offset, $query, et null.

◆ fetchArray()

fetchArray (   $cursor = null)
protected

Method to fetch a row from the result set cursor as an array.

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
3.0.0

◆ fetchAssoc()

fetchAssoc (   $cursor = null)
protected

Method to fetch a row from the result set cursor as an associative array.

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
3.0.0

◆ fetchObject()

fetchObject (   $cursor = null,
  $class = 'stdClass' 
)
protected

Method to fetch a row from the result set cursor as an object.

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
string$classThe class name to use for the returned row object.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
3.0.0

Références $class, et null.

◆ freeResult()

freeResult (   $cursor = null)
protected

Method to free up the memory used for the result set.

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
void
Depuis
3.0.0

◆ getAffectedRows()

getAffectedRows ( )

Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE for the previous executed SQL statement.

Renvoie
integer The number of affected rows in the previous operation
Depuis
3.0.0

◆ getAlterDbCharacterSet()

getAlterDbCharacterSet (   $dbName)

Get the query string to alter the database character set.

Paramètres
string$dbNameThe database name
Renvoie
string The query that alter the database query string
Depuis
3.0.0

Références $query.

◆ getAlterTableCharacterSet()

getAlterTableCharacterSet (   $tableName)

Get the query strings to alter the character set and collation of a table.

Paramètres
string$tableNameThe name of the table
Renvoie
string[] The queries required to alter the table's character set and collation
Depuis
CMS 3.5.0

◆ getCollation()

getCollation ( )

Method to get the database collation in use by sampling a text field of a table in the database.

Renvoie
mixed The collation in use by the database or boolean false if not supported.
Depuis
3.0.0
Exceptions
RuntimeException

◆ getConnectionCollation()

getConnectionCollation ( )

Method to get the database connection collation, as reported by the driver. If the connector doesn't support reporting this value please return an empty string.

Renvoie
string

◆ getCreateDatabaseQuery()

getCreateDatabaseQuery (   $options,
  $utf 
)
protected

Return the query string to create new Database. Each database driver, other than MySQL, need to override this member to return correct string.

Paramètres
stdClass$optionsObject used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
boolean$utfTrue if the database supports the UTF-8 character set.
Renvoie
string The query that creates database
Depuis
3.0.1

Références $options.

◆ getCreateDbQuery()

getCreateDbQuery (   $options,
  $utf 
)

Get the query string to create new Database in correct PostgreSQL syntax.

Paramètres
object$optionsobject coming from "initialise" function to pass user and database name to database driver.
boolean$utfTrue if the database supports the UTF-8 character set, not used in PostgreSQL "CREATE DATABASE" query.
Renvoie
string The query that creates database, owned by $options['user']
Depuis
3.0.0

Références $options, et $query.

◆ getDefaultSchema()

getDefaultSchema ( )
private

Internal function to get the name of the default schema for the current PostgreSQL connection. That is the schema where tables are created by Joomla.

Renvoie
string
Depuis
3.9.24

◆ getErrorMessage()

getErrorMessage ( )
protected

Return the actual SQL Error message

Renvoie
string The SQL Error message
Depuis
3.4.6

◆ getErrorNumber()

getErrorNumber ( )
protected

Return the actual SQL Error number

Renvoie
integer The SQL Error number
Depuis
3.4.6
Exceptions

◆ getNumRows()

getNumRows (   $cur = null)

Get the number of returned rows for the previous executed SQL statement. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by an INSERT, UPDATE, REPLACE or DELETE query, use getAffectedRows().

Paramètres
resource$curAn optional database cursor resource to extract the row count from.
Renvoie
integer The number of returned rows.
Depuis
3.0.0

◆ getQuery()

getQuery (   $new = false,
  $asObj = false 
)

Get the current or query, or new JDatabaseQuery object.

Paramètres
boolean$newFalse to return the last query set, True to return a new JDatabaseQuery object.
boolean$asObjFalse to return last query as string, true to get JDatabaseQueryPostgresql object.
Renvoie
JDatabaseQuery The current query object or a new object extending the JDatabaseQuery class.
Depuis
3.0.0
Exceptions
RuntimeException

◆ getRandom()

getRandom ( )

Generate a random value

Renvoie
float The random generated number
Depuis
3.0.0

◆ getStringPositionSql()

getStringPositionSql (   $substring,
  $string 
)

Get the substring position inside a string

Paramètres
string$substringThe string being sought
string$stringThe string/column being searched
Renvoie
integer The position of $substring in $string
Depuis
3.0.0

Références $position, et $query.

◆ getTableColumns()

getTableColumns (   $table,
  $typeOnly = true 
)

Retrieves field information about a given table.

Paramètres
string$tableThe name of the database table. For PostgreSQL may start with a schema.
boolean$typeOnlyTrue to only return field types.
Renvoie
array An array of fields for the database table.
Depuis
3.0.0
Exceptions
RuntimeException

Références $field, $fields, et null.

◆ getTableCreate()

getTableCreate (   $tables)

Shows the table CREATE statement that creates the given tables.

This is unsupported by PostgreSQL.

Paramètres
mixed$tablesA table name or a list of table names.
Renvoie
string An empty char because this function is not supported by PostgreSQL.
Depuis
3.0.0

◆ getTableKeys()

getTableKeys (   $table)

Get the details list of keys for a table.

Paramètres
string$tableThe name of the table.
Renvoie
array An array of the column specification for the table.
Depuis
3.0.0
Exceptions
RuntimeException

◆ getTableList()

getTableList ( )

Method to get an array of all tables in the database.

Renvoie
array An array of all the tables in the database.
Depuis
3.0.0
Exceptions
RuntimeException

Références $query.

◆ getTableSequences()

getTableSequences (   $table)

Get the details list of sequences for a table.

Paramètres
string$tableThe name of the table.
Renvoie
array An array of sequences specification for the table.
Depuis
3.0.0
Exceptions
RuntimeException

Références $name, et $query.

◆ getVersion()

getVersion ( )

Get the version of the database connector.

Renvoie
string The database connector version.
Depuis
3.0.0

Références $version.

◆ insertid()

insertid ( )

◆ insertObject()

insertObject (   $table,
$object,
  $key = null 
)

Inserts a row into a table based on an object's properties.

Paramètres
string$tableThe name of the database table to insert into.
object&$objectA reference to an object whose public properties match the table fields.
string$keyThe name of the primary key. If provided the object property is updated.
Renvoie
boolean True on success.
Depuis
3.0.0
Exceptions
RuntimeException

Références $columns, $fields, $id, $key, $query, et null.

◆ isSupported()

static isSupported ( )
static

Test to see if the PostgreSQL connector is available.

Renvoie
boolean True on success, false otherwise.
Depuis
3.0.0

Implémente JDatabaseInterface.

◆ lockTable()

lockTable (   $tableName)

Locks a table in the database.

Paramètres
string$tableNameThe name of the table to unlock.
Renvoie
JDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
3.0.0
Exceptions
RuntimeException

◆ quoteBinary()

quoteBinary (   $data)

Quotes a binary string to database requirements for use in database queries.

Paramètres
mixed$dataA binary string to quote.
Renvoie
string The binary quoted input string.
Depuis
3.9.12

Références $data.

◆ releaseTransactionSavepoint()

releaseTransactionSavepoint (   $savepointName)

Method to release a savepoint.

Paramètres
string$savepointNameSavepoint's name to release
Renvoie
void
Depuis
3.0.0

◆ renameTable()

renameTable (   $oldTable,
  $newTable,
  $backup = null,
  $prefix = null 
)

Renames a table in the database.

Paramètres
string$oldTableThe name of the table to be renamed
string$newTableThe new name for the table.
string$backupNot used by PostgreSQL.
string$prefixNot used by PostgreSQL.
Renvoie
JDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
3.0.0
Exceptions
RuntimeException

◆ replacePrefix()

replacePrefix (   $query,
  $prefix = '#__' 
)

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

Paramètres
string$queryThe SQL statement to prepare.
string$prefixThe common table prefix.
Renvoie
string The processed SQL statement.
Depuis
3.0.0

Références $prefix, et $query.

◆ select()

select (   $database)

Selects the database, but redundant for PostgreSQL

Paramètres
string$databaseDatabase name to select.
Renvoie
boolean Always true
Depuis
3.0.0

◆ setUtf()

setUtf ( )

Custom settings for UTF support

Renvoie
integer Zero on success, -1 on failure
Depuis
3.0.0

◆ showTables()

showTables ( )

Returns an array containing database's table list.

Renvoie
array The database's table list.
Depuis
3.0.0

Références $query.

◆ sqlValue()

sqlValue (   $columns,
  $fieldName,
  $fieldValue 
)

This function return a field value as a prepared string to be used in a SQL statement.

Paramètres
array$columnsArray of table's column returned by ::getTableColumns.
string$fieldNameThe table field's name.
string$fieldValueThe variable value to quote and return.
Renvoie
string The quoted string.
Depuis
3.0.0

Références $columns, $fieldValue, et elseif.

◆ test()

static test ( )
static

Test to see if the PostgreSQL connector is available

Renvoie
boolean True on success, false otherwise.
Depuis
3.0.0

◆ transactionCommit()

transactionCommit (   $toSavepoint = false)

Method to commit a transaction.

Paramètres
boolean$toSavepointIf true, commit to the last savepoint.
Renvoie
void
Depuis
3.0.0
Exceptions
RuntimeException

◆ transactionRollback()

transactionRollback (   $toSavepoint = false)

Method to roll back a transaction.

Paramètres
boolean$toSavepointIf true, rollback to the last savepoint.
Renvoie
void
Depuis
3.0.0
Exceptions
RuntimeException

◆ transactionSavepoint()

transactionSavepoint (   $savepointName)

Method to create a savepoint.

Paramètres
string$savepointNameSavepoint's name to create
Renvoie
void
Depuis
3.0.0

◆ transactionStart()

transactionStart (   $asSavepoint = false)

Method to initialize a transaction.

Paramètres
boolean$asSavepointIf true and a transaction is already active, a savepoint will be created.
Renvoie
void
Depuis
3.0.0
Exceptions
RuntimeException

◆ unlockTables()

unlockTables ( )

Unlocks tables in the database, this command does not exist in PostgreSQL, it is automatically done on commit or rollback.

Renvoie
JDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
3.0.0
Exceptions
RuntimeException

◆ updateObject()

updateObject (   $table,
$object,
  $key,
  $nulls = false 
)

Updates a row in a table based on an object's properties.

Paramètres
string$tableThe name of the database table to update.
object&$objectA reference to an object whose public properties match the table fields.
array$keyThe name of the primary key.
boolean$nullsTrue to update null fields or false to ignore them.
Renvoie
boolean True on success.
Depuis
3.0.0
Exceptions
RuntimeException

Références $columns, $fields, $key, et null.

Documentation des champs

◆ $concat_operator

$concat_operator = '||'
protected

◆ $dbMinimum

$dbMinimum = '8.3.18'
staticprotected

◆ $name

$name = 'postgresql'

◆ $nameQuote

$nameQuote = '"'
protected

◆ $nullDate

$nullDate = '1970-01-01 00:00:00'
protected

◆ $queryObject

$queryObject = null
protected

◆ $serverType

$serverType = 'postgresql'

La documentation de cette classe a été générée à partir du fichier suivant :