◆ __construct()
PostgreSQLDatabase::__construct |
( |
| ) |
|
|
protected |
Constructor.
Initializes internal variables and prepares the class for use.
◆ __destruct()
PostgreSQLDatabase::__destruct |
( |
| ) |
|
Destructor.
Ensures the database connection is closed and resources are freed.
◆ Configure()
PostgreSQLDatabase::Configure |
( |
|
$server, |
|
|
|
$user, |
|
|
|
$pass, |
|
|
|
$db |
|
) |
| |
|
finalprotected |
Configures the database connection settings.
- Parameters
-
string | $server | The database server address. |
string | $user | The username for the database. |
string | $pass | The password for the database. |
string | $db | The name of the database. |
◆ ConfigureSTMT()
PostgreSQLDatabase::ConfigureSTMT |
( |
|
$name, |
|
|
|
$query |
|
) |
| |
|
final |
Configures a prepared statement.
- Parameters
-
string | $name | The name of the prepared statement. |
string | $query | The SQL query for the prepared statement. |
◆ Connect()
PostgreSQLDatabase::Connect |
( |
| ) |
|
|
finalprotected |
Connects to the PostgreSQL database.
- Exceptions
-
Exception | If the connection fails. |
◆ DeleteAllSTMT()
PostgreSQLDatabase::DeleteAllSTMT |
( |
| ) |
|
|
finalprotected |
Deletes all prepared statements.
◆ DeleteSTMT()
PostgreSQLDatabase::DeleteSTMT |
( |
|
$name | ) |
|
|
finalprotected |
Deletes a prepared statement by its name.
- Parameters
-
string | $name | The name of the prepared statement. |
◆ EndCopyFromSTDIN()
PostgreSQLDatabase::EndCopyFromSTDIN |
( |
| ) |
|
|
final |
Ends copying data from STDIN.
◆ EndTransaction()
PostgreSQLDatabase::EndTransaction |
( |
|
$commit = true | ) |
|
|
final |
Ends a transaction.
- Parameters
-
bool | $commit | True to commit data, false to rollback. |
◆ EscapeByteA()
PostgreSQLDatabase::EscapeByteA |
( |
|
$bytea | ) |
|
Escapes a bytea value for use in a SQL query.
- Parameters
-
string | $bytea | The bytea value to escape. |
- Returns
- string The escaped bytea value.
◆ EscapeString()
PostgreSQLDatabase::EscapeString |
( |
|
$string | ) |
|
|
final |
Escapes a string for use in a SQL query.
- Parameters
-
string | $string | The string to escape. |
- Returns
- string The escaped string.
◆ ExecuteAsyncQuery()
PostgreSQLDatabase::ExecuteAsyncQuery |
( |
|
$query | ) |
|
|
final |
Executes a query asynchronously.
- Parameters
-
string | $query | The SQL query to execute. |
◆ ExecuteAsyncSTMT()
PostgreSQLDatabase::ExecuteAsyncSTMT |
( |
|
$name, |
|
|
|
$params |
|
) |
| |
|
final |
Executes a prepared statement asynchronously (ignoring result).
- Parameters
-
string | $name | The name of the prepared statement. |
| mixed | ...$params The parameters for the prepared statement. |
◆ ExecuteQuery()
PostgreSQLDatabase::ExecuteQuery |
( |
|
$query | ) |
|
|
finalprotected |
Executes a raw SQL query.
- Parameters
-
string | $query | The SQL query to execute. |
- Returns
- array|bool The result of the query, or false on failure.
◆ ExecuteSTMT()
PostgreSQLDatabase::ExecuteSTMT |
( |
|
$name, |
|
|
|
$params |
|
) |
| |
|
final |
Executes and fetches results from a prepared statement.
- Parameters
-
string | $name | The name of the prepared statement. |
| mixed | ...$params The parameters for the prepared statement. |
- Returns
- array|bool|int The result of the execution, or false on failure.
◆ GetAffectedRowsSTMT()
PostgreSQLDatabase::GetAffectedRowsSTMT |
( |
|
$name | ) |
|
|
final |
Obtain affected rows of a prepared statement previously executed.
- Parameters
-
string | $name | The name of the prepared statement. |
- Returns
- int The number of affected rows.
◆ GetAllConfiguredSTMTs()
PostgreSQLDatabase::GetAllConfiguredSTMTs |
( |
| ) |
|
|
finalprotected |
Gets all configured prepared statements (for debug).
- Returns
- array The configured prepared statements.
◆ GetExecutedSTMTStatistics()
PostgreSQLDatabase::GetExecutedSTMTStatistics |
( |
| ) |
|
Gets statistics for executed prepared statements.
- Returns
- array The statistics for executed prepared statements.
◆ GetSQLQueryExecutedCount()
PostgreSQLDatabase::GetSQLQueryExecutedCount |
( |
| ) |
|
Gets the count of executed SQL queries.
- Returns
- int The count of executed SQL queries.
◆ GetSTMTExecStats()
PostgreSQLDatabase::GetSTMTExecStats |
( |
| ) |
|
|
finalprotected |
Gets the execution count of prepared statements.
- Returns
- array The execution count of prepared statements.
◆ GetTimeSpent()
PostgreSQLDatabase::GetTimeSpent |
( |
| ) |
|
Gets the total time spent executing SQL queries.
- Returns
- float The total time spent executing SQL queries.
◆ IsConnected()
PostgreSQLDatabase::IsConnected |
( |
| ) |
|
Checks if the server is connected.
- Returns
- bool True if connected, false otherwise.
◆ LoadAllSTMTs()
PostgreSQLDatabase::LoadAllSTMTs |
( |
| ) |
|
|
finalprotected |
Debug function to load and parse all prepared statements in search for an error.
◆ LockTable()
PostgreSQLDatabase::LockTable |
( |
|
$tablename | ) |
|
|
final |
Locks a table within a transaction.
- Parameters
-
string | $tablename | The name of the table to lock. |
◆ PutDataSTDIN()
PostgreSQLDatabase::PutDataSTDIN |
( |
|
$data | ) |
|
|
final |
Puts data to STDIN for a copy.
- Parameters
-
string | $data | The data to copy. |
◆ ShowAllSTMTNames()
PostgreSQLDatabase::ShowAllSTMTNames |
( |
| ) |
|
|
final |
Function to show all prepared statement names.
◆ StartCopyFromSTDIN()
PostgreSQLDatabase::StartCopyFromSTDIN |
( |
|
$tablename | ) |
|
|
final |
Starts a copy from STDIN.
- Parameters
-
string | $tablename | The name of the table. |
◆ StartTransaction()
PostgreSQLDatabase::StartTransaction |
( |
| ) |
|
|
final |
◆ UnEscapeByteA()
PostgreSQLDatabase::UnEscapeByteA |
( |
|
$bytea | ) |
|
Unescapes a bytea value.
- Parameters
-
string | $bytea | The bytea value to unescape. |
- Returns
- string The unescaped bytea value.
◆ BIGINT_MAX
const PostgreSQLDatabase::BIGINT_MAX = "9223372036854775807" |
Maximum value for BIGINT.
◆ BIGINT_MIN
const PostgreSQLDatabase::BIGINT_MIN = "-9223372036854775808" |
Minimum value for BIGINT.
◆ INT_MAX
const PostgreSQLDatabase::INT_MAX = "2147483647" |
◆ INT_MIN
const PostgreSQLDatabase::INT_MIN = "-2147483648" |
◆ SMALLINT_MAX
const PostgreSQLDatabase::SMALLINT_MAX = "32767" |
Maximum value for SMALLINT.
◆ SMALLINT_MIN
const PostgreSQLDatabase::SMALLINT_MIN = "-32768" |
Minimum value for SMALLINT.
The documentation for this class was generated from the following file: