Skip to content
Search
DSL · Postgresql

from_pgsql_cursor

Definition

/**
 * Create a PostgreSQL cursor extractor using server-side cursors for memory-efficient extraction.
 *
 * Uses DECLARE CURSOR + FETCH to stream data without loading entire result set into memory.
 * This is the only way to achieve true low memory extraction with PHP's ext-pgsql.
 *
 * Note: Requires a transaction context (auto-started if not in one).
 *
 * @param Client $client PostgreSQL client
 * @param Sql|string $query SQL query to execute (wrapped in DECLARE CURSOR)
 * @param list<mixed> $parameters Values bound by position to $1, $2, ... placeholders; wrap with {@see \Flow\PostgreSql\DSL\typed()} to force a specific PostgreSQL type
 */
from_pgsql_cursor(Client $client, Sql|string $query, array $parameters) : PostgreSqlCursorExtractor

Contributors

Built in the open.

Join us on GitHub
scroll back to top