MCPcopy Create free account
hub / github.com/effect-app/libs / seedNamespace

Function seedNamespace

packages/infra/src/Store/SQL.ts:181–188  ·  view source on GitHub ↗
(ns: string)

Source from the content-addressed store, hash-verified

179 [`${tableName}::${ns}`, tableName]
180 )
181 if ((existing as any[]).length > 0) return
182 yield* InfraLogger.logInfo(`Seeding data for ${name} (namespace: ${ns})`)
183 const items = yield* seed.pipe(Effect.provide(ctx), Effect.orDie)
184 const ne = toNonEmptyArray([...items])
185 // Seed inserts are not concurrent; OCC here is a programming defect.
186 if (Option.isSome(ne)) {
187 yield* bulkSetInternal(ne.value, ns).pipe(
188 Effect.catchTag("OptimisticConcurrencyException", Effect.die)
189 )
190 }
191 yield* exec(

Callers 3

makeSQLStoreIntFunction · 0.70
makeSQLiteStorePerNsFunction · 0.70
Cosmos.tsFile · 0.70

Calls 4

makeSeedEffectFunction · 0.85
getMethod · 0.65
pipeMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…