MCPcopy
hub / github.com/drizzle-team/drizzle-orm / generateSQLiteMigration

Function generateSQLiteMigration

drizzle-kit/src/api.ts:245–268  ·  view source on GitHub ↗
(
	prev: DrizzleSQLiteSnapshotJSON,
	cur: DrizzleSQLiteSnapshotJSON,
)

Source from the content-addressed store, hash-verified

243};
244
245export const generateSQLiteMigration = async (
246 prev: DrizzleSQLiteSnapshotJSON,
247 cur: DrizzleSQLiteSnapshotJSON,
248) => {
249 const { applySqliteSnapshotsDiff } = await import('./snapshotsDiffer');
250
251 const validatedPrev = sqliteSchema.parse(prev);
252 const validatedCur = sqliteSchema.parse(cur);
253
254 const squashedPrev = squashSqliteScheme(validatedPrev);
255 const squashedCur = squashSqliteScheme(validatedCur);
256
257 const { sqlStatements } = await applySqliteSnapshotsDiff(
258 squashedPrev,
259 squashedCur,
260 tablesResolver,
261 columnsResolver,
262 sqliteViewsResolver,
263 validatedPrev,
264 validatedCur,
265 );
266
267 return sqlStatements;
268};
269
270export const pushSQLiteSchema = async (
271 imports: Record<string, unknown>,

Callers

nothing calls this directly

Calls 2

squashSqliteSchemeFunction · 0.90
applySqliteSnapshotsDiffFunction · 0.85

Tested by

no test coverage detected