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

Function seedNamespace

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

Source from the content-addressed store, hash-verified

154 )
155
156 const ctx = yield* Effect.context<R>()
157 const seedCache = new Map<string, Effect.Effect<void, DatabaseError>>()
158 const makeSeedEffect = Effect.fnUntraced(function*(ns: string) {
159 yield* ensureTable
160 if (!seed) return
161 const existing = yield* exec(
162 `SELECT id FROM "_migrations" WHERE id = $1 AND version = $2`,
163 [`${tableName}::${ns}`, tableName]
164 )
165 if ((existing as any[]).length > 0) return
166 yield* InfraLogger.logInfo(`Seeding data for ${name} (namespace: ${ns})`)

Callers 1

Pg.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…