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

Function diffSchemasOrTables

drizzle-kit/src/jsonDiffer.js:90–104  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

88};
89
90export function diffSchemasOrTables(left, right) {
91 left = JSON.parse(JSON.stringify(left));
92 right = JSON.parse(JSON.stringify(right));
93
94 const result = Object.entries(diff(left, right) ?? {});
95
96 const added = result
97 .filter((it) => it[0].endsWith('__added'))
98 .map((it) => it[1]);
99 const deleted = result
100 .filter((it) => it[0].endsWith('__deleted'))
101 .map((it) => it[1]);
102
103 return { added, deleted };
104}
105
106export function diffIndPolicies(left, right) {
107 left = JSON.parse(JSON.stringify(left));

Callers 5

applyPgSnapshotsDiffFunction · 0.90
applyMysqlSnapshotsDiffFunction · 0.90
applySqliteSnapshotsDiffFunction · 0.90
applyLibSQLSnapshotsDiffFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected