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

Function drizzle

packages/core/script/migration.ts:94–106  ·  view source on GitHub ↗
(temporary: string, output: string, name?: string)

Source from the content-addressed store, hash-verified

92}
93
94async function drizzle(temporary: string, output: string, name?: string) {
95 const config = path.join(temporary, `${path.basename(output)}.config.ts`)
96 await Bun.write(
97 config,
98 `import config from ${JSON.stringify(pathToFileURL(path.join(root, "packages/core/drizzle.config.ts")).href)}
99
100export default { ...config, out: ${JSON.stringify(output)} }
101`,
102 )
103 await $`bun drizzle-kit generate --config ${config} ${name ? ["--name", name] : []}`.cwd(
104 path.join(root, "packages/core"),
105 )
106}
107
108async function generatedMigrations(directory: string) {
109 return (await Array.fromAsync(new Bun.Glob("*/migration.sql").scan({ cwd: directory })))

Callers 8

index.tsFile · 0.85
generateFunction · 0.85
checkFunction · 0.85
sqlite.bun.tsFile · 0.85
sqlite.node.tsFile · 0.85
importFilesFunction · 0.85
makeDrizzleFunction · 0.85
database.tsFile · 0.85

Calls 2

writeMethod · 0.80
cwdMethod · 0.65

Tested by

no test coverage detected