Integrations
PHP PDO
Overview
The PHP Data Objects (PDO) is an extension, which supports PostgreSQL protocol implemented in Oxla and provides consistent interface for accessing databases in PHP. This page and its sections describe how to use PHP PDO with Oxla and also lists unsupported functions and structures.
Establishing connection
Note that the PDO::ATTR_EMULATE_PREPARES
attribute is set to true
, which is required in Oxla to ensure stability of query execution. Without this attribute setup, you may encounter prepared statement
errors during queries execution:
If you are running Oxla Cloud, you can append
sslmode=verify-full;sslrootcert=\{path to ssl cert from SaaS\}
to the first parameter of PDO
to ensure full SSL endpoint verification and encryption. Example usage
This example shows basic query execution, once the connection has been established:
Unsupported Functions & Structures
Here you can find a list of functions and potentially related structures, that we currently do not support when working with Oxla and PHP PDO:
PDO::pgsqlLOBCreate
,pgsqlLOBOpen
- Large ObjectsPDO::pgsqlGetPid
- returning processes IDPDO::pgsqlCopytFromFile
,PDO::pgsqlCopytFromArray
- copy from STDINPDO::pgsqlCopytToFile
- copy to STDINPDO::pgsqlCopytToArray
- copy to STDOUTPDO::pgsqlGetNotify
-LISTEN
andNOTIFY
channel commandsPDO::lastInsertId
- SEQUENCESPDO::beginTransaction
,PDO::inTransaction
,PDO::commit
,PDO::rollBack
- TransactionsPDOStatement::rowCount
- returns improper number of rows forDELETE
,UPDATE
,INSERT INTO ... (SELECT)
andCOPY
statements