(name: string, sql: string)
| 125 | } |
| 126 | |
| 127 | function renderMigration(name: string, sql: string) { |
| 128 | return `import { Effect } from "effect" |
| 129 | import type { DatabaseMigration } from "../migration" |
| 130 | |
| 131 | export default { |
| 132 | id: ${JSON.stringify(name)}, |
| 133 | up(tx) { |
| 134 | return Effect.gen(function* () { |
| 135 | ${renderStatements(sql)} |
| 136 | }) |
| 137 | }, |
| 138 | } satisfies DatabaseMigration.Migration |
| 139 | ` |
| 140 | } |
| 141 | |
| 142 | function renderSchema(sql: string) { |
| 143 | return `import { Effect } from "effect" |
no test coverage detected