(ns: string)
| 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})`) |
no test coverage detected
searching dependent graphs…