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

nameSchemaChangeFor() — drizzle-orm Function Reference

Architecture documentation for the nameSchemaChangeFor() function in snapshotsDiffer.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  d4397b1a_b460_00f3_a94c_ee5c9fa31f9b["nameSchemaChangeFor()"]
  582ba146_631b_7794_80a3_5b8044ba7cde["snapshotsDiffer.ts"]
  d4397b1a_b460_00f3_a94c_ee5c9fa31f9b -->|defined in| 582ba146_631b_7794_80a3_5b8044ba7cde
  c7a398db_43c9_7771_09b7_73bc09e703e8["applyPgSnapshotsDiff()"]
  c7a398db_43c9_7771_09b7_73bc09e703e8 -->|calls| d4397b1a_b460_00f3_a94c_ee5c9fa31f9b
  style d4397b1a_b460_00f3_a94c_ee5c9fa31f9b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/snapshotsDiffer.ts lines 519–538

const nameSchemaChangeFor = (
	table: NamedWithSchema,
	renamedTables: { from: NamedWithSchema; to: NamedWithSchema }[],
) => {
	for (let ren of renamedTables) {
		if (table.name === ren.from.name && table.schema === ren.from.schema) {
			return {
				key: `${ren.to.schema || 'public'}.${ren.to.name}`,
				name: ren.to.name,
				schema: ren.to.schema,
			};
		}
	}

	return {
		key: `${table.schema || 'public'}.${table.name}`,
		name: table.name,
		schema: table.schema,
	};
};

Domain

Subdomains

Frequently Asked Questions

What does nameSchemaChangeFor() do?
nameSchemaChangeFor() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/snapshotsDiffer.ts.
Where is nameSchemaChangeFor() defined?
nameSchemaChangeFor() is defined in drizzle-kit/src/snapshotsDiffer.ts at line 519.
What calls nameSchemaChangeFor()?
nameSchemaChangeFor() is called by 1 function(s): applyPgSnapshotsDiff.

Analyze Your Own Codebase

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

Try Supermodel Free