{"record":{"id":"9b1af86c5d5127ad","repo":"tursodatabase/turso","slug":"the-supplied-sql-string-contains-no-statements-9b1af8","errorCode":null,"errorMessage":"The supplied SQL string contains no statements","messagePattern":"The supplied SQL string contains no statements","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"bindings/javascript/packages/common/promise.ts","lineNumber":277,"sourceCode":"  async connect() {\n    if (this.connected) { return; }\n    await this.db.connectAsync();\n    this.connected = true;\n  }\n\n  /**\n   * Prepares a SQL statement for execution.\n   *\n   * @param {string} sql - The SQL statement string to prepare.\n   */\n  prepare(sql: string): Promise<Statement> {\n    // Only throw if we connected before but now the database is closed\n    // Allow implicit connection if not connected yet\n    if (this.connected && !this.open) {\n      throw new TypeError(\"The database connection is not open\");\n    }\n    if (!sql) {\n      throw new RangeError(\"The supplied SQL string contains no statements\");\n    }\n\n    try {\n      if (this.connected) {\n        return new Statement(maybeValue(this.db.prepare(sql)), this.db, this.execLock, this.ioStep) as unknown as Promise<Statement>;\n      } else {\n        return new Statement(maybePromise(() => this.connect().then(() => this.db.prepare(sql))), this.db, this.execLock, this.ioStep) as unknown as Promise<Statement>;\n      }\n    } catch (err) {\n      throw convertError(err);\n    }\n  }\n\n  /**\n   * Returns a function that executes the given function in a transaction.\n   *\n   * @deprecated Use {@link transactionAsync} instead. This wrapper only\n   * emits `BEGIN`/`COMMIT` around the callback without owning the","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/javascript/packages/common/promise.ts#L259-L295","documentation":"Error \"The supplied SQL string contains no statements\" thrown in tursodatabase/turso.","triggerScenarios":"Thrown at bindings/javascript/packages/common/promise.ts:277 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}