MCPcopy
hub / github.com/anomalyco/opencode / ensureGlobal

Function ensureGlobal

packages/opencode/test/project/migrate-global.test.ts:44–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44function ensureGlobal() {
45 return Database.Service.use(({ db }) =>
46 db
47 .insert(ProjectTable)
48 .values({
49 id: ProjectV2.ID.global,
50 worktree: AbsolutePath.make("/"),
51 time_created: Date.now(),
52 time_updated: Date.now(),
53 sandboxes: [],
54 })
55 .onConflictDoNothing()
56 .run()
57 .pipe(Effect.orDie),
58 )
59}
60
61describe("migrateFromGlobal", () => {
62 it.live("migrates global sessions on first project creation", () =>

Callers 1

Calls 6

onConflictDoNothingMethod · 0.80
insertMethod · 0.80
useMethod · 0.45
runMethod · 0.45
valuesMethod · 0.45
makeMethod · 0.45

Tested by

no test coverage detected