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

prepareDropReferencesJson() — drizzle-orm Function Reference

Architecture documentation for the prepareDropReferencesJson() function in jsonStatements.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  27b257bf_18eb_15f2_6625_6a8e683928db["prepareDropReferencesJson()"]
  6139f734_8ada_c641_9fec_9a55cfdf376f["jsonStatements.ts"]
  27b257bf_18eb_15f2_6625_6a8e683928db -->|defined in| 6139f734_8ada_c641_9fec_9a55cfdf376f
  c7a398db_43c9_7771_09b7_73bc09e703e8["applyPgSnapshotsDiff()"]
  c7a398db_43c9_7771_09b7_73bc09e703e8 -->|calls| 27b257bf_18eb_15f2_6625_6a8e683928db
  a5972ffc_ff1b_9523_2495_5373af710e65["applyMysqlSnapshotsDiff()"]
  a5972ffc_ff1b_9523_2495_5373af710e65 -->|calls| 27b257bf_18eb_15f2_6625_6a8e683928db
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8["applySqliteSnapshotsDiff()"]
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8 -->|calls| 27b257bf_18eb_15f2_6625_6a8e683928db
  style 27b257bf_18eb_15f2_6625_6a8e683928db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/jsonStatements.ts lines 2988–3001

export const prepareDropReferencesJson = (
	tableName: string,
	schema: string,
	foreignKeys: Record<string, string>,
): JsonDeleteReferenceStatement[] => {
	return Object.values(foreignKeys).map((fkData) => {
		return {
			type: 'delete_reference',
			tableName,
			data: fkData,
			schema,
		};
	});
};

Domain

Subdomains

Frequently Asked Questions

What does prepareDropReferencesJson() do?
prepareDropReferencesJson() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/jsonStatements.ts.
Where is prepareDropReferencesJson() defined?
prepareDropReferencesJson() is defined in drizzle-kit/src/jsonStatements.ts at line 2988.
What calls prepareDropReferencesJson()?
prepareDropReferencesJson() is called by 3 function(s): applyMysqlSnapshotsDiff, applyPgSnapshotsDiff, applySqliteSnapshotsDiff.

Analyze Your Own Codebase

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

Try Supermodel Free