tursodatabase/turso · error · RangeError

The supplied SQL string contains no statements

Error message

The supplied SQL string contains no statements

What it means

Error "The supplied SQL string contains no statements" thrown in tursodatabase/turso.

Source

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

  async connect() {
    if (this.connected) { return; }
    await this.db.connectAsync();
    this.connected = true;
  }

  /**
   * Prepares a SQL statement for execution.
   *
   * @param {string} sql - The SQL statement string to prepare.
   */
  prepare(sql: string): Promise<Statement> {
    // Only throw if we connected before but now the database is closed
    // Allow implicit connection if not connected yet
    if (this.connected && !this.open) {
      throw new TypeError("The database connection is not open");
    }
    if (!sql) {
      throw new RangeError("The supplied SQL string contains no statements");
    }

    try {
      if (this.connected) {
        return new Statement(maybeValue(this.db.prepare(sql)), this.db, this.execLock, this.ioStep) as unknown as Promise<Statement>;
      } else {
        return new Statement(maybePromise(() => this.connect().then(() => this.db.prepare(sql))), this.db, this.execLock, this.ioStep) as unknown as Promise<Statement>;
      }
    } catch (err) {
      throw convertError(err);
    }
  }

  /**
   * Returns a function that executes the given function in a transaction.
   *
   * @deprecated Use {@link transactionAsync} instead. This wrapper only
   * emits `BEGIN`/`COMMIT` around the callback without owning the

View on GitHub (pinned to bad083fafb)

When it happens

Trigger: Thrown at bindings/javascript/packages/common/promise.ts:277 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/9b1af86c5d5127ad. Report an issue: GitHub.