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

Function prepareSQLitePush

drizzle-kit/src/cli/commands/migrate.ts:991–1022  ·  view source on GitHub ↗
(
	schemaPath: string | string[],
	snapshot: SQLiteSchema,
	casing: CasingType | undefined,
)

Source from the content-addressed store, hash-verified

989};
990
991export const prepareSQLitePush = async (
992 schemaPath: string | string[],
993 snapshot: SQLiteSchema,
994 casing: CasingType | undefined,
995) => {
996 const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath, casing);
997
998 const validatedPrev = sqliteSchema.parse(prev);
999 const validatedCur = sqliteSchema.parse(cur);
1000
1001 const squashedPrev = squashSqliteScheme(validatedPrev, 'push');
1002 const squashedCur = squashSqliteScheme(validatedCur, 'push');
1003
1004 const { sqlStatements, statements, _meta } = await applySqliteSnapshotsDiff(
1005 squashedPrev,
1006 squashedCur,
1007 tablesResolver,
1008 columnsResolver,
1009 sqliteViewsResolver,
1010 validatedPrev,
1011 validatedCur,
1012 'push',
1013 );
1014
1015 return {
1016 sqlStatements,
1017 statements,
1018 squashedPrev,
1019 squashedCur,
1020 meta: _meta,
1021 };
1022};
1023
1024export const prepareLibSQLPush = async (
1025 schemaPath: string | string[],

Callers 1

sqlitePushFunction · 0.85

Calls 3

squashSqliteSchemeFunction · 0.90
applySqliteSnapshotsDiffFunction · 0.90

Tested by

no test coverage detected