Home / Function/ prepareSQLitePush() — drizzle-orm Function Reference

prepareSQLitePush() — drizzle-orm Function Reference

Architecture documentation for the prepareSQLitePush() function in migrate.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  2ca89631_0f00_005d_5d76_39522f9fdfff["prepareSQLitePush()"]
  b14d3855_8cce_38c9_8952_a9d014c2fb1b["migrate.ts"]
  2ca89631_0f00_005d_5d76_39522f9fdfff -->|defined in| b14d3855_8cce_38c9_8952_a9d014c2fb1b
  f28864cc_bfe5_d841_4b4d_7469a00327d0["prepareSQLiteDbPushSnapshot()"]
  2ca89631_0f00_005d_5d76_39522f9fdfff -->|calls| f28864cc_bfe5_d841_4b4d_7469a00327d0
  dec1e114_a97f_91d6_7d9a_a12a7c1789b4["squashSqliteScheme()"]
  2ca89631_0f00_005d_5d76_39522f9fdfff -->|calls| dec1e114_a97f_91d6_7d9a_a12a7c1789b4
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8["applySqliteSnapshotsDiff()"]
  2ca89631_0f00_005d_5d76_39522f9fdfff -->|calls| d9097b7e_1e27_d29f_7732_f2fa1447f2b8
  style 2ca89631_0f00_005d_5d76_39522f9fdfff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/cli/commands/migrate.ts lines 991–1022

export const prepareSQLitePush = async (
	schemaPath: string | string[],
	snapshot: SQLiteSchema,
	casing: CasingType | undefined,
) => {
	const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath, casing);

	const validatedPrev = sqliteSchema.parse(prev);
	const validatedCur = sqliteSchema.parse(cur);

	const squashedPrev = squashSqliteScheme(validatedPrev, 'push');
	const squashedCur = squashSqliteScheme(validatedCur, 'push');

	const { sqlStatements, statements, _meta } = await applySqliteSnapshotsDiff(
		squashedPrev,
		squashedCur,
		tablesResolver,
		columnsResolver,
		sqliteViewsResolver,
		validatedPrev,
		validatedCur,
		'push',
	);

	return {
		sqlStatements,
		statements,
		squashedPrev,
		squashedCur,
		meta: _meta,
	};
};

Domain

Subdomains

Frequently Asked Questions

What does prepareSQLitePush() do?
prepareSQLitePush() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/migrate.ts.
Where is prepareSQLitePush() defined?
prepareSQLitePush() is defined in drizzle-kit/src/cli/commands/migrate.ts at line 991.
What does prepareSQLitePush() call?
prepareSQLitePush() calls 3 function(s): applySqliteSnapshotsDiff, prepareSQLiteDbPushSnapshot, squashSqliteScheme.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free