tursodatabase/turso · error · TypeError

Expected second argument to be an options object

Error message

Expected second argument to be an options object

What it means

Error "Expected second argument to be an options object" thrown in tursodatabase/turso.

Source

Thrown at bindings/javascript/packages/common/promise.ts:556

   * @param {...any} bindParameters - Bind parameters, optionally followed by a query options object.
   */
  async *iterate(sql, ...bindParameters) {
    const stmt = await this.prepare(sql);
    try {
      yield* stmt.iterate(...bindParameters);
    } finally {
      await stmt.close();
    }
  }

  async pragma(source, options) {
    if (options == null) options = {};

    if (typeof source !== "string")
      throw new TypeError("Expected first argument to be a string");

    if (typeof options !== "object")
      throw new TypeError("Expected second argument to be an options object");

    const pragma = `PRAGMA ${source}`;

    const stmt = await this.prepare(pragma);
    try {
      const results = await stmt.all();
      return results;
    } finally {
      await stmt.close();
    }
  }

  backup(filename, options) {
    throw new Error("not implemented");
  }

  serialize(options) {
    throw new Error("not implemented");

View on GitHub (pinned to bad083fafb)

When it happens

Trigger: Thrown at bindings/javascript/packages/common/promise.ts:556 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tursodatabase/turso@bad083fafb (2026-08-16). Data as JSON: /api/errors/64215e66ffc527bf. Report an issue: GitHub.