{"record":{"id":"26384cc1c255c710","repo":"clockworklabs/SpacetimeDB","slug":"cannot-extract-table-name-from-query","errorCode":null,"errorMessage":"Cannot extract table name from query","messagePattern":"Cannot extract table name from query","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/bindings-typescript/src/lib/query.ts","lineNumber":1046,"sourceCode":"export function toComparableValue(value: any): any {\n  // Handle `ConnectionId` and `Identity`.\n  if (isHexSerializableLike(value)) {\n    return value.toHexString();\n  }\n  if (isTimestampLike(value)) {\n    return value.__timestamp_micros_since_unix_epoch__;\n  }\n  return value;\n}\n\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","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/bindings-typescript/src/lib/query.ts#L1028-L1064","documentation":"The uninstaller refuses to remove the version the bin dir's current symlink points to, because that is the CLI installation you are effectively running. It reads current_version() (a read failure is only warned about, not fatal) and compares it with the requested version before touching the directory.","triggerScenarios":"spacetime update uninstall <v> where <v> equals the target of the current symlink (e.g. you installed 1.7.1 with --use, then try to uninstall 1.7.1).","commonSituations":"Cleaning up old versions without remembering which one is active; several versions piled up after repeated install --use switches.","solutions":["Switch to another installed version first: spacetime update install <other-version> --use, then uninstall the old one.","If it is the only installed version, install a newer one with --use and uninstall this one afterwards.","Verify with spacetime update list that the current marker moved before uninstalling."],"exampleFix":"# before\nspacetime update uninstall 1.7.1   # 1.7.1 is current -> refused\n\n# after\nspacetime update install 1.7.2 --use\nspacetime update uninstall 1.7.1","handlingStrategy":"validation","validationCode":"current=\"$(basename \"$(readlink \"$BIN_DIR/current\")\")\"\n[[ \"$VERSION\" != \"$current\" ]] \\\n  || { echo \"switch away from $VERSION before uninstalling it\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Before uninstalling, check which version `spacetime update list` marks current.","In cleanup scripts, switch to the newest installed version first, then prune older ones."],"tags":["spacetimedb","cli","uninstall","version-management"],"backgroundTag":"version-in-use","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"}