@photostructure/sqlite
    Preparing search index...

    Interface StatementSyncInstance

    A prepared SQL statement that can be executed multiple times with different parameters. This interface represents an instance of the StatementSync class.

    interface StatementSyncInstance {
        expandedSQL: undefined | string;
        sourceSQL: string;
        "[dispose]"(): void;
        all(...parameters: any[]): any[];
        columns(): { name: string; type?: string }[];
        finalize(): void;
        get(...parameters: any[]): any;
        iterate(...parameters: any[]): IterableIterator<any>;
        run(
            ...parameters: any[],
        ): { changes: number; lastInsertRowid: number | bigint };
        setAllowBareNamedParameters(allowBareNamedParameters: boolean): void;
        setReadBigInts(readBigInts: boolean): void;
        setReturnArrays(returnArrays: boolean): void;
    }
    Index

    Properties

    expandedSQL: undefined | string

    The expanded SQL string with bound parameters, if expandedSQL option was set.

    sourceSQL: string

    The original SQL source string.

    Methods

    • Dispose of the statement resources using the explicit resource management protocol.

      Returns void

    • This method executes a prepared statement and returns all results as an array.

      Parameters

      • ...parameters: any[]

        Optional named and anonymous parameters to bind to the statement.

      Returns any[]

      An array of row objects from the query results.

    • Returns an array of objects, each representing a column in the statement's result set. Each object has a 'name' property for the column name and a 'type' property for the SQLite type.

      Returns { name: string; type?: string }[]

      Array of column metadata objects.

    • Finalizes the prepared statement and releases its resources. Called automatically by Symbol.dispose.

      Returns void

    • This method executes a prepared statement and returns the first result row.

      Parameters

      • ...parameters: any[]

        Optional named and anonymous parameters to bind to the statement.

      Returns any

      The first row from the query results, or undefined if no rows.

    • This method executes a prepared statement and returns an iterable iterator of objects. Each object represents a row from the query results.

      Parameters

      • ...parameters: any[]

        Optional named and anonymous parameters to bind to the statement.

      Returns IterableIterator<any>

      An iterable iterator of row objects.

    • This method executes a prepared statement and returns an object.

      Parameters

      • ...parameters: any[]

        Optional named and anonymous parameters to bind to the statement.

      Returns { changes: number; lastInsertRowid: number | bigint }

      An object with the number of changes and the last insert rowid.

    • Set whether to allow bare named parameters in SQL.

      Parameters

      • allowBareNamedParameters: boolean

        If true, allows bare named parameters.

      Returns void

      false
      
    • Set whether to read integer values as JavaScript BigInt.

      Parameters

      • readBigInts: boolean

        If true, read integers as BigInts.

      Returns void

      false
      
    • Set whether to return results as arrays rather than objects.

      Parameters

      • returnArrays: boolean

        If true, return results as arrays.

      Returns void

      false