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

diffSchemasOrTables() — drizzle-orm Function Reference

Architecture documentation for the diffSchemasOrTables() function in jsonDiffer.js from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  560caeef_abdc_d66c_7c70_a78940262c2f["diffSchemasOrTables()"]
  42cd5bcb_caa4_6b61_11ea_da1b767eeadd["jsonDiffer.js"]
  560caeef_abdc_d66c_7c70_a78940262c2f -->|defined in| 42cd5bcb_caa4_6b61_11ea_da1b767eeadd
  c7a398db_43c9_7771_09b7_73bc09e703e8["applyPgSnapshotsDiff()"]
  c7a398db_43c9_7771_09b7_73bc09e703e8 -->|calls| 560caeef_abdc_d66c_7c70_a78940262c2f
  a5972ffc_ff1b_9523_2495_5373af710e65["applyMysqlSnapshotsDiff()"]
  a5972ffc_ff1b_9523_2495_5373af710e65 -->|calls| 560caeef_abdc_d66c_7c70_a78940262c2f
  d4992b27_bf78_8099_5134_750cef1c518c["applySingleStoreSnapshotsDiff()"]
  d4992b27_bf78_8099_5134_750cef1c518c -->|calls| 560caeef_abdc_d66c_7c70_a78940262c2f
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8["applySqliteSnapshotsDiff()"]
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8 -->|calls| 560caeef_abdc_d66c_7c70_a78940262c2f
  55569cde_7638_9cfc_9dcd_34636d975ec3["applyLibSQLSnapshotsDiff()"]
  55569cde_7638_9cfc_9dcd_34636d975ec3 -->|calls| 560caeef_abdc_d66c_7c70_a78940262c2f
  style 560caeef_abdc_d66c_7c70_a78940262c2f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/jsonDiffer.js lines 90–104

export function diffSchemasOrTables(left, right) {
	left = JSON.parse(JSON.stringify(left));
	right = JSON.parse(JSON.stringify(right));

	const result = Object.entries(diff(left, right) ?? {});

	const added = result
		.filter((it) => it[0].endsWith('__added'))
		.map((it) => it[1]);
	const deleted = result
		.filter((it) => it[0].endsWith('__deleted'))
		.map((it) => it[1]);

	return { added, deleted };
}

Domain

Subdomains

Frequently Asked Questions

What does diffSchemasOrTables() do?
diffSchemasOrTables() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/jsonDiffer.js.
Where is diffSchemasOrTables() defined?
diffSchemasOrTables() is defined in drizzle-kit/src/jsonDiffer.js at line 90.
What calls diffSchemasOrTables()?
diffSchemasOrTables() is called by 5 function(s): applyLibSQLSnapshotsDiff, applyMysqlSnapshotsDiff, applyPgSnapshotsDiff, applySingleStoreSnapshotsDiff, applySqliteSnapshotsDiff.

Analyze Your Own Codebase

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

Try Supermodel Free