Spaces:
Running
Running
browser-sqlite-playground / source /teaql-ts /examples /trace-chain /lib /src /generated-bootstrap.ts
Download source/teaql-ts/examples/trace-chain/lib/src/generated-bootstrap.ts from teaql/browser-sqlite-playground: direct link, hf CLI and curl.
- Browser
- Download file 768 Bytes
-
https://huggingface.co/spaces/teaql/browser-sqlite-playground/resolve/main/source/teaql-ts/examples/trace-chain/lib/src/generated-bootstrap.ts
- Command line
-
hf download hf://spaces/teaql/browser-sqlite-playground/source/teaql-ts/examples/trace-chain/lib/src/generated-bootstrap.ts
-
curl -L -o generated-bootstrap.ts https://huggingface.co/spaces/teaql/browser-sqlite-playground/resolve/main/source/teaql-ts/examples/trace-chain/lib/src/generated-bootstrap.ts
768 Bytes
| import { UserContext } from './teaql-ts'; | |
| import { Q } from './generated/Q'; | |
| import { Platform } from './generated/models/Platform'; | |
| /** @internal Generated typed Mutation bootstrap; never call from application code. */ | |
| export async function ensureGeneratedBootstrap(context: UserContext): Promise<void> { | |
| let domainRoot = (await Q.platforms().withIdIs('1').comment('what: locate generated Domain Root').purpose('why: idempotent runtime bootstrap').executeForList(context))[0]; | |
| if (!domainRoot) { | |
| domainRoot = Platform.teaqlBootstrapNew('1'); | |
| domainRoot.updateName("Trace Chain Verification"); | |
| await domainRoot.auditAs('create generated Domain Root Platform').save(context); | |
| } | |
| context.withActiveRoot({ entity: 'Platform', id: domainRoot.id! }); | |
| } | |