Skip to Content

Last Updated: 3/10/2026


kysely

  • Streamable

Interface Streamable

interface Streamable<O> {
    stream(chunkSize?: number): AsyncIterableIterator<O>;
}

Type Parameters

  • O

Hierarchy (View Summary)

Implemented by

Index

Methods

stream

Methods

stream

  • stream(chunkSize?: number): AsyncIterableIterator<O>

    Executes the query and streams the rows.

    The optional argument chunkSize defines how many rows to fetch from the database at a time. It only affects some dialects like PostgreSQL that support it.

    Examples

    const stream = db . selectFrom('person') . select(['first_name', 'last_name']) . where('gender', '=', 'other') . stream() for await (const person of stream) { console. log(person. first_name) if (person. last_name === 'Something') { // Breaking or returning before the stream has ended will release // the database connection and invalidate the stream. break }}

    Parameters

    • OptionalchunkSize: number

    Returns AsyncIterableIterator<O>

Settings

Member Visibility

On This Page

Methods

stream