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

Function insertSession

packages/core/test/session-runner.test.ts:294–310  ·  view source on GitHub ↗
(id: SessionV2.ID)

Source from the content-addressed store, hash-verified

292const otherSessionID = SessionV2.ID.make("ses_runner_other")
293
294const insertSession = (id: SessionV2.ID) =>
295 Effect.gen(function* () {
296 const { db } = yield* Database.Service
297 yield* db
298 .insert(SessionTable)
299 .values({
300 id,
301 project_id: Project.ID.global,
302 slug: id,
303 directory: "/project",
304 title: "test",
305 version: "test",
306 })
307 .onConflictDoNothing()
308 .run()
309 .pipe(Effect.orDie)
310 })
311
312const setup = Effect.gen(function* () {
313 const { db } = yield* Database.Service

Callers 1

Calls 4

onConflictDoNothingMethod · 0.80
insertMethod · 0.80
runMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected