class PostgresqlDriver extends PdoDriver (View source)

The PostgresqlDriver class.

Methods

__construct(null $connection = null, array $options = array())

Constructor.

resource|object
getConnection()

getConnection

setConnection(resource $connection)

setConnection

resource|false
execute()

Execute the SQL statement.

disconnect()

Disconnects the database.

from PdoDriver
boolean
select(string $database)

Select a database for use.

from PdoDriver
string
getVersion()

Get the version of the database connector

from PdoDriver
freeResult(mixed $cursor = null)

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

from PdoDriver
mixed
listDatabases()

getDatabaseList

from PdoDriver
resource
getCursor()

getCursor

getQuery(boolean $new = false)

Get the current query object or a new Query object.

from PdoDriver
getTable(string $name, bool $new = false)

getTable

getDatabase(string $name = null, bool $new = false)

getTable

getReader(Query $query = null, bool $new = true)

getReader

getWriter(bool $new = true)

getWriter

getTransaction(boolean $nested = true, bool $new = false)

getWriter

getIterator(string $class = 'stdClass')

getIterator

string
getCurrentDatabase()

Gets the name of the database used by this conneciton.

string
getPrefix()

Get the common table prefix for the database driver.

string
replacePrefix(string $sql, string $prefix = '#__')

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

static array
splitSql(string $sql)

Splits a string of multiple queries into an array of individual queries.

setDebug(boolean $level)

Sets the database debugging state for the driver.

setQuery(mixed $query, array $driverOptions = array())

Sets the SQL statement string for later execution.

from PdoDriver
mixed
loadAll(string $key = null, string $class = '\\stdClass')

loadAll

mixed
loadOne(string $class = '\\stdClass')

loadOne

mixed
loadResult()

loadResult

mixed
loadColumn()

loadColumn

mixed
quoteName(string $text)

quoteName

mixed
qn(string $text)

qn

string
quote(string $text, bool $escape = true)

quote

string
q(string $text, bool $escape = true)

q

string
escape(string $text, bool $extra = true)

escape

string
e(string $text, bool $extra = true)

e

string
getName()

Method to get property Name

array
getOptions()

Method to get property Options

setOptions(array $options)

Method to set property options

setDatabaseName(string $database)

Method to set property database

getMiddlewares()

Method to get property Middlewares

resetMiddlewares()

Method to set property middlewares

string
getLastQuery()

Method to get property LastQuery

static boolean
isSupported()

Is this driver supported.

mixed
getOption(mixed $key)

Retrieve a PDO database connection attribute http://www.php.net/manual/en/pdo.getattribute.php

from PdoDriver
boolean
setOption(integer $key, mixed $value)

Sets an attribute on the PDO database handle.

from PdoDriver
PDOStatement|false
doExecute()

Execute the SQL statement.

from PdoDriver

Details

at line line 45
__construct(null $connection = null, array $options = array())

Constructor.

Parameters

null $connection The database connection instance.
array $options List of options used to configure the connection

resource|object getConnection()

getConnection

Return Value

resource|object

AbstractDatabaseDriver setConnection(resource $connection)

setConnection

Parameters

resource $connection

Return Value

AbstractDatabaseDriver Return self to support chaining.

resource|false execute()

Execute the SQL statement.

Return Value

resource|false Return Resource to do more or false if query failure.

Exceptions

RuntimeException

in PdoDriver at line line 108
AbstractDatabaseDriver connect()

connect

Return Value

AbstractDatabaseDriver

Exceptions

RuntimeException

in PdoDriver at line line 144
AbstractDatabaseDriver disconnect()

Disconnects the database.

Return Value

AbstractDatabaseDriver

in PdoDriver at line line 220
boolean select(string $database)

Select a database for use.

Parameters

string $database The name of the database to select for use.

Return Value

boolean True if the database was successfully selected.

Exceptions

RuntimeException

in PdoDriver at line line 203
string getVersion()

Get the version of the database connector

Return Value

string The database connector version.

in PdoDriver at line line 304
AbstractDatabaseDriver freeResult(mixed $cursor = null)

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

Parameters

mixed $cursor The optional result set cursor from which to fetch the row.

Return Value

AbstractDatabaseDriver

in PdoDriver at line line 357
mixed listDatabases()

getDatabaseList

Return Value

mixed

Exceptions

LogicException

resource getCursor()

getCursor

Return Value

resource

in PdoDriver at line line 328
Query getQuery(boolean $new = false)

Get the current query object or a new Query object.

Parameters

boolean $new False to return the current query object, True to return a new Query object.

Return Value

Query The current query object or a new object extending the Query class.

Exceptions

RuntimeException

AbstractTable getTable(string $name, bool $new = false)

getTable

Parameters

string $name
bool $new

Return Value

AbstractTable

AbstractDatabase getDatabase(string $name = null, bool $new = false)

getTable

Parameters

string $name
bool $new

Return Value

AbstractDatabase

AbstractReader getReader(Query $query = null, bool $new = true)

getReader

Parameters

Query $query
bool $new

Return Value

AbstractReader

AbstractWriter getWriter(bool $new = true)

getWriter

Parameters

bool $new

Return Value

AbstractWriter

AbstractTransaction getTransaction(boolean $nested = true, bool $new = false)

getWriter

Parameters

boolean $nested
bool $new

Return Value

AbstractTransaction

DataIterator getIterator(string $class = 'stdClass')

getIterator

Parameters

string $class

Return Value

DataIterator

string getCurrentDatabase()

Gets the name of the database used by this conneciton.

Return Value

string

string getPrefix()

Get the common table prefix for the database driver.

Return Value

string The common database table prefix.

at line line 64
string replacePrefix(string $sql, string $prefix = '#__')

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

Parameters

string $sql The SQL statement to prepare.
string $prefix The common table prefix.

Return Value

string The processed SQL statement.

static array splitSql(string $sql)

Splits a string of multiple queries into an array of individual queries.

Parameters

string $sql Input SQL string with which to split into individual queries.

Return Value

array The queries from the input string separated into an array.

AbstractDatabaseDriver setDebug(boolean $level)

Sets the database debugging state for the driver.

Parameters

boolean $level True to enable debugging.

Return Value

AbstractDatabaseDriver

in PdoDriver at line line 239
AbstractDatabaseDriver setQuery(mixed $query, array $driverOptions = array())

Sets the SQL statement string for later execution.

Parameters

mixed $query The SQL statement to set either as a Query object or a string.
array $driverOptions The optional PDO driver options

Return Value

AbstractDatabaseDriver This object to support method chaining.

mixed loadAll(string $key = null, string $class = '\\stdClass')

loadAll

Parameters

string $key
string $class

Return Value

mixed

mixed loadOne(string $class = '\\stdClass')

loadOne

Parameters

string $class

Return Value

mixed

mixed loadResult()

loadResult

Return Value

mixed

mixed loadColumn()

loadColumn

Return Value

mixed

mixed quoteName(string $text)

quoteName

Parameters

string $text

Return Value

mixed

mixed qn(string $text)

qn

Parameters

string $text

Return Value

mixed

string quote(string $text, bool $escape = true)

quote

Parameters

string $text
bool $escape

Return Value

string

string q(string $text, bool $escape = true)

q

Parameters

string $text
bool $escape

Return Value

string

string escape(string $text, bool $extra = true)

escape

Parameters

string $text
bool $extra

Return Value

string

string e(string $text, bool $extra = true)

e

Parameters

string $text
bool $extra

Return Value

string

string getName()

Method to get property Name

Return Value

string

array getOptions()

Method to get property Options

Return Value

array

AbstractDatabaseDriver setOptions(array $options)

Method to set property options

Parameters

array $options

Return Value

AbstractDatabaseDriver Return self to support chaining.

AbstractDatabaseDriver setDatabaseName(string $database)

Method to set property database

Parameters

string $database

Return Value

AbstractDatabaseDriver Return self to support chaining.

AbstractDatabaseDriver addMiddleware(MiddlewareInterface|callable $middleware)

addMiddleware

Parameters

MiddlewareInterface|callable $middleware

Return Value

AbstractDatabaseDriver

ChainBuilder getMiddlewares()

Method to get property Middlewares

Return Value

ChainBuilder

AbstractDatabaseDriver resetMiddlewares()

Method to set property middlewares

Return Value

AbstractDatabaseDriver Return self to support chaining.

string getLastQuery()

Method to get property LastQuery

Return Value

string

at line line 32
static boolean isSupported()

Is this driver supported.

Return Value

boolean

in PdoDriver at line line 167
mixed getOption(mixed $key)

Retrieve a PDO database connection attribute http://www.php.net/manual/en/pdo.getattribute.php

Usage: $db->getOption(PDO::ATTR_CASE);

Parameters

mixed $key One of the PDO::ATTR_* Constants

Return Value

mixed

in PdoDriver at line line 189
boolean setOption(integer $key, mixed $value)

Sets an attribute on the PDO database handle.

http://www.php.net/manual/en/pdo.setattribute.php

Usage: $db->setOption(PDO::ATTRCASE, PDO::CASEUPPER);

Parameters

integer $key One of the PDO::ATTR_* Constants
mixed $value One of the associated PDO Constants related to the particular attribute key.

Return Value

boolean

in PdoDriver at line line 257
PDOStatement|false doExecute()

Execute the SQL statement.

Return Value

PDOStatement|false A database cursor resource on success, boolean false on failure.

Exceptions

RuntimeException