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

squashMysqlSchemeV4() — drizzle-orm Function Reference

Architecture documentation for the squashMysqlSchemeV4() function in mysqlSchema.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  629077ed_9c1d_2f64_5c91_4cdfb7b80a88["squashMysqlSchemeV4()"]
  f2ee16c1_40e6_43f3_15b2_c391a3ac170b["mysqlSchema.ts"]
  629077ed_9c1d_2f64_5c91_4cdfb7b80a88 -->|defined in| f2ee16c1_40e6_43f3_15b2_c391a3ac170b
  920ff56d_9b78_d6a4_9c81_c1e6a3d1d992["mapValues()"]
  629077ed_9c1d_2f64_5c91_4cdfb7b80a88 -->|calls| 920ff56d_9b78_d6a4_9c81_c1e6a3d1d992
  style 629077ed_9c1d_2f64_5c91_4cdfb7b80a88 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/serializer/mysqlSchema.ts lines 305–336

export const squashMysqlSchemeV4 = (
	json: MySqlSchemaV4,
): MySqlSchemaSquashedV4 => {
	const mappedTables = Object.fromEntries(
		Object.entries(json.tables).map((it) => {
			const squashedIndexes = mapValues(it[1].indexes, (index) => {
				return MySqlSquasher.squashIdx(index);
			});

			const squashedFKs = mapValues(it[1].foreignKeys, (fk) => {
				return MySqlSquasher.squashFK(fk);
			});

			return [
				it[0],
				{
					name: it[1].name,
					schema: it[1].schema,
					columns: it[1].columns,
					indexes: squashedIndexes,
					foreignKeys: squashedFKs,
				},
			];
		}),
	);
	return {
		version: '4',
		dialect: json.dialect,
		tables: mappedTables,
		schemas: json.schemas,
	};
};

Domain

Subdomains

Calls

Frequently Asked Questions

What does squashMysqlSchemeV4() do?
squashMysqlSchemeV4() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/serializer/mysqlSchema.ts.
Where is squashMysqlSchemeV4() defined?
squashMysqlSchemeV4() is defined in drizzle-kit/src/serializer/mysqlSchema.ts at line 305.
What does squashMysqlSchemeV4() call?
squashMysqlSchemeV4() calls 1 function(s): mapValues.

Analyze Your Own Codebase

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

Try Supermodel Free