MDB2
[ class tree: MDB2 ] [ index: MDB2 ] [ all elements ]

Class: MDB2_Driver_pgsql

Source Location: /MDB2_Driver_pgsql-1.2.2/MDB2/Driver/pgsql.php

Class Overview

MDB2_Driver_Common
   |
   --MDB2_Driver_pgsql

MDB2 PostGreSQL driver


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 55]
MDB2 PostGreSQL driver


[ Top ]


Class Variables

$escape_identifier =  '"'

[line 62]


Type:   mixed


[ Top ]

$escape_pattern =  "\\"

[line 60]


Type:   mixed


[ Top ]

$escape_quotes =  "'"

[line 58]


Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 70]

MDB2_Driver_pgsql __construct( )

Constructor

[ Top ]

beginTransaction   [line 217]

mixed beginTransaction( [string $savepoint = null])

Start a transaction or set a savepoint.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $savepoint   —  name of a savepoint to set

[ Top ]

commit   [line 256]

mixed commit( [string $savepoint = null])

Commit the database changes done during a transaction that is in progress or release a savepoint. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after committing the pending changes.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $savepoint   —  name of a savepoint to release

[ Top ]

connect   [line 447]

true connect( )

Connect to the database
  • Return: on success, MDB2 Error Object on failure
  • Access: public

[ Top ]

currID   [line 953]

mixed currID( string $seq_name)

Returns the current id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Parameters:

string   $seq_name   —  name of the sequence

[ Top ]

disconnect   [line 518]

mixed disconnect( [boolean $force = true])

Log out and disconnect from the database.
  • Return: true on success, false if not connected and error object on error
  • Access: public

Parameters:

boolean   $force   —  if the disconnect should be forced even if the connection is opened persistently

[ Top ]

errorInfo   [line 109]

array errorInfo( [integer $error = null])

This method is used to collect information about an error
  • Access: public

Parameters:

integer   $error   — 

[ Top ]

escape   [line 197]

string escape( string $text, [bool $escape_wildcards = false])

Quotes a string so it can be safely used in a query. It will quote the text so it can safely be used within a query.
  • Return: quoted string
  • Access: public

Parameters:

string   $text   —  the input string to quote
bool   $escape_wildcards   —  escape wildcards

[ Top ]

getServerVersion   [line 700]

mixed getServerVersion( [string $native = false])

return version information about the server
  • Return: array/string with version information or MDB2 error object
  • Access: public

Parameters:

string   $native   —  determines if the raw version string should be returned

[ Top ]

nextID   [line 922]

mixed nextID( string $seq_name, [boolean $ondemand = true])

Returns the next free id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Parameters:

string   $seq_name   —  name of the sequence
boolean   $ondemand   —  when true the sequence is automatic created, if it not exists

[ Top ]

prepare   [line 762]

mixed &prepare( string $query, [mixed $types = null], [mixed $result_types = null], [mixed $lobs = array()])

Prepares a query for multiple execution with execute().

With some database backends, this is emulated. prepare() requires a generic query as string like 'INSERT INTO numbers VALUES(?,?)' or 'INSERT INTO numbers VALUES(:foo,:bar)'. The ? and :[a-zA-Z] and are placeholders which can be set using bindParam() and the query can be send off using the execute() method.

  • Return: resource handle for the prepared query on success, a MDB2 error on failure
  • See: bindParam, execute
  • Access: public

Parameters:

string   $query   —  the query to prepare
mixed   $types   —  array that contains the types of the placeholders
mixed   $result_types   —  array that contains the types of the columns in the result set or MDB2_PREPARE_RESULT, if set to MDB2_PREPARE_MANIP the query is handled as a manipulation query
mixed   $lobs   —  key (field) value (parameter) pair for all lob placeholders

[ Top ]

rollback   [line 290]

mixed rollback( [string $savepoint = null])

Cancel any database changes done during a transaction or since a specific savepoint that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $savepoint   —  name of a savepoint to rollback to

[ Top ]

setCharset   [line 489]

true setCharset( string $charset, [resource $connection = null])

Set the charset on the current connection
  • Return: on success, MDB2 Error Object on failure

Parameters:

string   $charset   —  charset
resource   $connection   —  connection handle

[ Top ]

setTransactionIsolation   [line 327]

mixed setTransactionIsolation( string $isolation)

Set the transacton isolation level.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Since: 2.1.1
  • Access: public

Parameters:

string   $isolation   —  standard isolation level READ UNCOMMITTED (allows dirty reads) READ COMMITTED (prevents dirty reads) REPEATABLE READ (prevents nonrepeatable reads) SERIALIZABLE (prevents phantom reads)

[ Top ]

standaloneQuery   [line 554]

mixed &standaloneQuery( string $query, [mixed $types = null], [boolean $is_manip = false])

execute a query as DBA
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $query   —  the SQL query
mixed   $types   —  array that contains the types of the columns in the result set
boolean   $is_manip   —  if the query is a manipulation query

[ Top ]

_doConnect   [line 354]

mixed _doConnect( $database_name, [ $persistent = false])

Does the grunt work of connecting to the database
  • Return: connection resource on success, MDB2 Error Object on failure
  • Access: protected

Parameters:

   $database_name   — 
   $persistent   — 

[ Top ]

_doQuery   [line 594]

result &_doQuery( string $query, [boolean $is_manip = false], [resource $connection = null], [string $database_name = null])

Execute a query
  • Return: or error object
  • Access: protected

Parameters:

string   $query   —  query
boolean   $is_manip   —  if the query is a manipulation query
resource   $connection   — 
string   $database_name   — 

[ Top ]

_modifyQuery   [line 669]

string _modifyQuery( string $query, boolean $is_manip, integer $limit, integer $offset)

Changes a query string for various DBMS specific reasons
  • Return: modified query
  • Access: protected

Parameters:

string   $query   —  query to modify
boolean   $is_manip   —  if it is a DML query
integer   $limit   —  limit the number of rows
integer   $offset   —  start reading from given offset

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.