import { Readable } from "stream"; /** * DatabaseReadStream fetches and streams database records in paginated batches, * simulating a streaming behavior. This class is designed for efficient, memory-optimized chunking of * database queries, ideal for processing large datasets with minimal memory overhead. It operates in * object mode, directly streaming database entity objects. * * Note: Due to Prisma's lack of direct streaming support, this class implements a chunk-based approach * rather than true database streaming. It fetches data in paginated batches determined by the pageSize. * GitHub issue: https://github.com/prisma/prisma/issues/5055 * * @param prisma - The PrismaClient instance for database queries. * @param rawSqlQuery - A Prisma.Sql object representing the base SQL query, excluding OFFSET and LIMIT. * @param pageSize - Number of records per batch, defining the chunk size. * * The class extends Node.js's Readable stream, using async iteration and Prisma's pagination for scalable * data processing. It's suitable for applications requiring large dataset processing with a low memory footprint. */ export declare class DatabaseReadStream extends Readable { private queryDelegate; private pageSize; private maxRecords?; private hasNextPage; private offset; private isReading; constructor(queryDelegate: (pageSize: number, // eslint-disable-line no-unused-vars offset: number) => Promise>, pageSize: number, // eslint-disable-line no-unused-vars maxRecords?: number | undefined); _read(): Promise; } //# sourceMappingURL=DatabaseReadStream.d.ts.map