MCPcopy Create free account
hub / github.com/anomalyco/opencode / seed

Function seed

packages/opencode/test/project/migrate-global.test.ts:24–42  ·  view source on GitHub ↗
(opts: { id: SessionID; dir: string; project: ProjectV2.ID })

Source from the content-addressed store, hash-verified

22}
23
24function seed(opts: { id: SessionID; dir: string; project: ProjectV2.ID }) {
25 const now = Date.now()
26 return Database.Service.use(({ db }) =>
27 db
28 .insert(SessionTable)
29 .values({
30 id: opts.id,
31 project_id: opts.project,
32 slug: opts.id,
33 directory: opts.dir,
34 title: "test",
35 version: "0.0.0-test",
36 time_created: now,
37 time_updated: now,
38 })
39 .run()
40 .pipe(Effect.orDie),
41 )
42}
43
44function ensureGlobal() {
45 return Database.Service.use(({ db }) =>

Callers 1

Calls 4

insertMethod · 0.80
useMethod · 0.45
runMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected