{"record":{"id":"ee4cbdb4481ab5b7","repo":"clockworklabs/SpacetimeDB","slug":"cannot-extract-accessor-name-from-query","errorCode":null,"errorMessage":"Cannot extract accessor name from query","messagePattern":"Cannot extract accessor name from query","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/bindings-typescript/src/lib/query.ts","lineNumber":1056,"sourceCode":"\n/**\n * Extract the table name from a query builder expression.\n */\nexport function getQueryTableName(query: any): string {\n  if (query.table) return query.table.name; // FromBuilder\n  if (query.name) return query.name; // TableRefImpl\n  if (query.sourceQuery) return query.sourceQuery.table.name; // SemijoinImpl (source table)\n  throw new Error('Cannot extract table name from query');\n}\n\n/**\n * Extract the accessor name from a query builder expression.\n */\nexport function getQueryAccessorName(query: any): string {\n  if (query.table) return query.table.accessorName; // FromBuilder\n  if (query.accessorName) return query.accessorName; // TableRefImpl\n  if (query.sourceQuery) return query.sourceQuery.table.accessorName; // SemijoinImpl\n  throw new Error('Cannot extract accessor name from query');\n}\n\n/**\n * Extract the BooleanExpr from a query builder, if any.\n */\nexport function getQueryWhereClause(query: any): BooleanExpr<any> | undefined {\n  if (query.whereClause) return query.whereClause; // FromBuilder\n  return undefined; // TableRefImpl has no where clause\n}\n\n// TODO: Fix this.\nfunction _createIndexedRowExpr<TableDef extends TypedTableDef>(\n  tableDef: TableDef,\n  cols: RowExpr<TableDef>\n): IndexedRowExpr<TableDef> {\n  const indexed = new Set<ColumnNames<TableDef>>();\n  for (const idx of tableDef.indexes) {\n    if ('columns' in idx) {","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/bindings-typescript/src/lib/query.ts#L1038-L1074","documentation":"When spacetimedb-update's CLI proxy runs from a cargo target/ directory (a dev checkout), it proxies to the spacetimedb-cli binary cargo should have built into the same artifact directory (target/<profile>/spacetimedb-cli), instead of the installed current version. If that binary is absent, it bails with explicit build instructions.","triggerScenarios":"Executing target/debug/spacetimedb-update (or target/release/...) in the SpacetimeDB repo when spacetimedb-cli has not been built into the same profile directory — e.g. after only building the update crate, or after cargo clean.","commonSituations":"cargo build -p spacetimedb-update only; cargo clean between builds; copying the updater binary out of a partial build tree and running it from target/.","solutions":["Build the CLI into the same profile: cargo build -p spacetimedb-cli (add --release if you run the release updater).","Or run the installed updater outside target/ so it resolves the CLI via the current version directory instead.","If you meant to run the repo CLI, prefer cargo run -p spacetimedb-cli -- <args>."],"exampleFix":"# before\n$ ./target/debug/spacetimedb-update --version\nerror: ... spacetimedb-cli binary doesn't exist ...\n\n# after\n$ cargo build -p spacetimedb-cli\n$ ./target/debug/spacetimedb-update --version","handlingStrategy":"validation","validationCode":"# Ensure the CLI exists in the same profile as the updater you run:\nPROFILE=debug   # or release\ntest -x \"target/$PROFILE/spacetimedb-cli\" \\\n  || cargo build -p spacetimedb-cli $([ \"$PROFILE\" = release ] && echo --release)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the updater and CLI together: cargo build -p spacetimedb-update -p spacetimedb-cli.","Match profiles: a release updater needs a release-built spacetimedb-cli in target/release.","After cargo clean, rebuild both crates before invoking the proxy from target/."],"tags":["spacetimedb","cli","build","development-environment","cargo"],"backgroundTag":"binary-not-found","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}