{"record":{"id":"81609f51d2557d62","repo":"tursodatabase/turso","slug":"expected-first-argument-to-be-a-string-81609f","errorCode":null,"errorMessage":"Expected first argument to be a string","messagePattern":"Expected first argument to be a string","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"bindings/javascript/packages/common/promise.ts","lineNumber":553,"sourceCode":"   * Prepares the SQL and executes it as `Statement.iterate`, yielding each row.\n   *\n   * @param {string} sql - The SQL statement string.\n   * @param {...any} bindParameters - Bind parameters, optionally followed by a query options object.\n   */\n  async *iterate(sql, ...bindParameters) {\n    const stmt = await this.prepare(sql);\n    try {\n      yield* stmt.iterate(...bindParameters);\n    } finally {\n      await stmt.close();\n    }\n  }\n\n  async pragma(source, options) {\n    if (options == null) options = {};\n\n    if (typeof source !== \"string\")\n      throw new TypeError(\"Expected first argument to be a string\");\n\n    if (typeof options !== \"object\")\n      throw new TypeError(\"Expected second argument to be an options object\");\n\n    const pragma = `PRAGMA ${source}`;\n\n    const stmt = await this.prepare(pragma);\n    try {\n      const results = await stmt.all();\n      return results;\n    } finally {\n      await stmt.close();\n    }\n  }\n\n  backup(filename, options) {\n    throw new Error(\"not implemented\");\n  }","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/javascript/packages/common/promise.ts#L535-L571","documentation":"Error \"Expected first argument to be a string\" thrown in tursodatabase/turso.","triggerScenarios":"Thrown at bindings/javascript/packages/common/promise.ts:553 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"}