PostgreSQL-For-Wordpress / postgresql-for-wordpress

A maintained fork of https://wordpress.org/plugins/postgresql-for-wordpress/
GNU General Public License v2.0
220 stars 71 forks source link

Implement wpsqli_reap_async_query #70

Open mattbucci opened 10 months ago

mattbucci commented 10 months ago

https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress/blob/bf2ef7f4185d5327543ded7df42efb16ff79fa7c/pg4wp/driver_pgsql.php#L1269C10-L1269C33

/**
 * Gets the result from asynchronous PostgreSQL query.
 *
 * This function is a wrapper for the pg_reap_async_query function. It is used after initiating
 * a query with pg_query() on a connection with the pg_ASYNC flag set. It retrieves the result
 * from the query once it is complete, which can be used with pg_poll() to manage multiple
 * asynchronous queries. It returns a pg_result object for successful SELECT queries, or TRUE for
 * other DML queries (INSERT, UPDATE, DELETE, etc.) if the operation was successful, or FALSE on failure.
 *
 * @param PgSql\Connection $connection The pg connection resource.
 * @return \PgSql\Result|bool A pg_result object for successful SELECT queries, TRUE for other
 *                            successful DML queries, or FALSE on failure.
 */
function wpsqli_reap_async_query(&$connection)
{
    throw new \Exception("PG4WP: Not Yet Implemented");
    // mysqli_reap_async_query => No direct equivalent in PostgreSQL.
    // Asynchronous queries can be executed in PostgreSQL using pg_send_query and retrieved using pg_get_result.
}