Private Method Details |
clone |
private void clone( )
|
|
Duplicates a DB maintaining consistency.
|
Returns |
void |
|
connect |
private integer connect( string $host, string $login, string $passwd, string $database )
|
|
Connects to the database
|
Parameter |
|
|
|
|
|
|
|
string |
$database |
|
|
name to connect to. |
|
Returns |
integer the dabase link identifier or NULL on failure(?) |
|
pconnect |
private integer pconnect( string $host, string $login, string $passwd, string $database )
|
|
Opens a persistent connection to the database
|
Parameter |
|
|
|
|
|
|
|
string |
$database |
|
|
name to connect to. |
|
Returns |
integer the dabase link identifier or NULL on failure(?) |
|
close |
private integer close( )
|
|
Closes the connection to the database
|
Returns |
integer return code of pg_close(). |
|
select_db |
private void select_db( string $database )
|
|
Really useful???
|
Parameter |
|
string |
$database |
|
|
name of the database |
|
Returns |
void |
|
query |
private integer query( string $query )
|
|
Sends an SQL query, with limitations.
WARNING: don't send unduly long queries with this method! That is, query
length shall be less than 8000 characters long, because of a PgSQL
limitation. This limit may be lowered when we add support for other databases.
|
Parameter |
|
string |
$query |
|
|
query to b exectuted |
|
Returns |
integer a result index if the query has been successfully executed, false on failure. |
|
result |
private mixed result( integer $nb, string $fieldname )
|
|
Gets the value of fieldname in row nb.
Row numbering starts at 0.
|
Parameter |
|
integer |
$nb |
|
|
number of the row |
|
|
string |
$fieldname |
|
|
field to return |
|
Returns |
mixed the value. |
|
free |
private void free( )
|
|
Frees the result buffer.
|
Returns |
void |
|
fetch_array |
private array fetch_array( )
|
|
Gets the current row in data set.
Automatically converts the "timestamp" field from pgsql timestamp
to a MySQL one.
|
Returns |
array the fetched row; false if no more rows. |
|
fetch_field |
private void fetch_field( )
|
|
Hmm, unused one?
Call to pg_fetch_array DOES NOT MATCH prototype
|
Returns |
void |
Deprecated |
unsused in dacode? May not work. |
|
num_rows |
private integer num_rows( )
|
|
Gets the number of rows in the result set
|
Returns |
integer |
|
num_fields |
private integer num_fields( )
|
|
Gets the nuimber of fields in the result set.
|
Returns |
integer (What else would you expect?) |
|
error |
private string error( )
|
|
Gets the last DBMS error message
|
Returns |
string the clear (hopefully!) english error message |
|
last_insert_id |
private integer last_insert_id( )
|
|
Gets last inserted ID
REALLY USEFUL?
|
Returns |
integer |
|
affected_rows |
private int affected_rows( )
|
|
Returns the number of rows affected by last query.
|
Returns |
int |
|
compat_limit |
private string compat_limit( integer $nb, [ integer $offset ] )
|
|
Creates a Pgsql-compatible (specific?) LIMIT clause
|
Parameter |
|
integer |
$nb |
|
|
number of rows the result set should be limited to |
|
|
integer |
$offset |
= >>0<< |
|
number of rows to be skipped before the result set. |
|
Returns |
string a valid pgsql LIMIT clause |
|
compat_date_add |
private string compat_date_add( integer $sec )
|
|
Creates a SQL expression for now + sec
Creates the SQL expression which will give a timestamp for
current time + sec seconds.
|
Parameter |
|
integer |
$sec |
|
|
number of seconds from now. |
|
Returns |
string the SQL order. |
|
timestamp14_to_dbms_stamp |
private string timestamp14_to_dbms_stamp( string $t )
|
|
Converts a timestamp14 (YYYYMMDDhhmmss) into DBMS stamp
(YYYY-MM-DD hh:mm:ss for PostgreSQL).
|
Parameter |
|
|
Returns |
string a PostgreSQL timestamp |
|
date8_to_dbms_date |
private string date8_to_dbms_date( string $t )
|
|
Converts a date8 (YYYYMMDD) into DBMS date (YYYY-MM-DD for PostgreSQL).
|
Parameter |
|
|
Returns |
string a PostgreSQL date |
|
insertLob |
private integer insertLob( string $table, array $values, array $lobFields )
|
|
Inserts a LOB into the database.
Takes care of any encoding needed for LOB. Other values must be valid SQL ie strings inside ' '.
|
Parameter |
|
string |
$table |
|
|
name of the table |
|
|
array |
$values |
|
|
(column, value) pair; valid SQL except LOB fields which are raw data. |
|
|
array |
$lobFields |
|
|
of fields to be treated as LOB |
|
Returns |
integer true on success, false otherwise |
|
getLobByID |
private string getLobByID( string $table, string $pkField, integer $pk, string $lobField )
|
|
Gets a LOB identified by its primary key
|
Parameter |
|
string |
$table |
|
|
of the table... |
|
|
string |
$pkField |
|
|
the name of the primary key |
|
|
integer |
$pk |
|
|
the primary key itself |
|
|
string |
$lobField |
|
|
name of the LOB field. |
|
Returns |
string the LOB |
|
fetchLOB |
private array fetchLOB( array $lobFields )
|
|
Gets a row from current dataset containing LOBs
Careful: you may run into inconsitencies if you use numeric indexes.
Always use name indexes.
|
Parameter |
|
array |
$lobFields |
|
|
of fields containing LOBs |
|
Returns |
array the fethed row, with LOBs... |
|
deleteLOB |
private integer deleteLOB( string $table, string $pkField, integer $pk, string $lobField )
|
|
Deletes a row containing a LOB
|
Parameter |
|
string |
$table |
|
|
of the table... |
|
|
string |
$pkField |
|
|
the name of the primary key |
|
|
integer |
$pk |
|
|
the primary key itself |
|
|
string |
$lobField |
|
|
name of the LOB field. |
|
Returns |
integer true on success |
|