{"record":{"id":"befda0e3d7ae5c74","repo":"clockworklabs/SpacetimeDB","slug":"cannot-semijoin-a-table-to-itself","errorCode":null,"errorMessage":"Cannot semijoin a table to itself","messagePattern":"Cannot semijoin a table to itself","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/bindings-typescript/src/lib/query.ts","lineNumber":117,"sourceCode":"      predicate: (row: RowExpr<TableDef>) => PredicateExpr<TableDef>\n    ): SemijoinBuilder<TableDef>;\n    /** @deprecated No longer needed — builder is already a valid query. */\n    build(): Query<TableDef>;\n  }>;\n\nclass SemijoinImpl<TableDef extends TypedTableDef>\n  implements SemijoinBuilder<TableDef>, TableTypedQuery<TableDef>\n{\n  readonly [QueryBrand] = true;\n  readonly type = 'semijoin' as const;\n  constructor(\n    readonly sourceQuery: FromBuilder<TableDef>,\n    readonly filterQuery: FromBuilder<any>,\n    readonly joinCondition: BooleanExpr<any>\n  ) {\n    if (sourceQuery.table.sourceName === filterQuery.table.sourceName) {\n      // TODO: Handle aliasing properly instead of just forbidding it.\n      throw new Error('Cannot semijoin a table to itself');\n    }\n  }\n\n  build(): Query<TableDef> {\n    return this as Query<TableDef>;\n  }\n\n  where(\n    predicate: (row: RowExpr<TableDef>) => PredicateExpr<TableDef>\n  ): SemijoinImpl<TableDef> {\n    const nextSourceQuery = this.sourceQuery.where(predicate);\n    return new SemijoinImpl<TableDef>(\n      nextSourceQuery,\n      this.filterQuery,\n      this.joinCondition\n    );\n  }\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/bindings-typescript/src/lib/query.ts#L99-L135","documentation":"spacetime update uninstall current is rejected up front: current is the name of the symlink inside the CLI bin dir (BinDir::CURRENT_VERSION_DIR_NAME), not a real version. Removing 'that version' is ambiguous and would corrupt the install, so the command guards against the literal name.","triggerScenarios":"Passing the literal string current as the version argument: spacetime update uninstall current.","commonSituations":"Users see a current entry next to the version directories and assume it is a version; scripts iterate directory entries and feed each name to uninstall.","solutions":["Find real version names with spacetime update list (installed view) and uninstall one of those, e.g. spacetime update uninstall 1.6.0.","If the goal is a full cleanup, uninstall every listed version, then remove the leftover current symlink manually."],"exampleFix":"# before\nspacetime update uninstall current\n\n# after\nspacetime update list            # shows installed versions\nspacetime update uninstall 1.6.0","handlingStrategy":"validation","validationCode":"[[ \"$VERSION\" != \"current\" ]] \\\n  || { echo \"uninstall a concrete version, not 'current'\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Populate uninstall scripts from `spacetime update list` output, never from raw directory listings.","Treat 'current' as a symlink name, not a version, in all automation."],"tags":["spacetimedb","cli","uninstall","symlink","guard"],"backgroundTag":"protected-path-deletion","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"}