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_free_result #67

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#L970

/**
 * Frees the memory associated with a result.
 *
 * This function is a wrapper for the pg_free_result function. It's used to free the memory
 * allocated for a result set obtained from a query. When the result data is not needed anymore,
 * it's a good practice to free the associated resources, especially when dealing with large
 * datasets that can consume significant amounts of memory. It is an important aspect of resource
 * management and helps to keep the application's memory footprint minimal.
 *
 * @param \PgSql\Result $result The result set returned by pg_query, pg_store_result
 *                              or pg_use_result.
 * @return void This function doesn't return any value.
 */
function wpsqli_free_result($result)
{
    // mysqli_free_result => pg_free_result (resource $result): bool
    // Frees memory associated with a result.
    return pg_free_result($result);
}