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

squashSingleStoreScheme() — drizzle-orm Function Reference

Architecture documentation for the squashSingleStoreScheme() function in singlestoreSchema.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a["squashSingleStoreScheme()"]
  d63c81a6_6779_4926_bffe_7351e12a4301["singlestoreSchema.ts"]
  8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a -->|defined in| d63c81a6_6779_4926_bffe_7351e12a4301
  c7ed0a8e_f5a3_d4ae_2295_c3e128cc59d1["generateSingleStoreMigration()"]
  c7ed0a8e_f5a3_d4ae_2295_c3e128cc59d1 -->|calls| 8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a
  09737f8b_925a_9628_47ce_149d9e6cce58["pushSingleStoreSchema()"]
  09737f8b_925a_9628_47ce_149d9e6cce58 -->|calls| 8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a
  920ff56d_9b78_d6a4_9c81_c1e6a3d1d992["mapValues()"]
  8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a -->|calls| 920ff56d_9b78_d6a4_9c81_c1e6a3d1d992
  style 8b30b0b0_f854_4a9f_f8d2_9f42f47b3c3a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/serializer/singlestoreSchema.ts lines 185–236

export const squashSingleStoreScheme = (json: SingleStoreSchema): SingleStoreSchemaSquashed => {
	const mappedTables = Object.fromEntries(
		Object.entries(json.tables).map((it) => {
			const squashedIndexes = mapValues(it[1].indexes, (index) => {
				return SingleStoreSquasher.squashIdx(index);
			});

			const squashedPKs = mapValues(it[1].compositePrimaryKeys, (pk) => {
				return SingleStoreSquasher.squashPK(pk);
			});

			const squashedUniqueConstraints = mapValues(
				it[1].uniqueConstraints,
				(unq) => {
					return SingleStoreSquasher.squashUnique(unq);
				},
			);

			return [
				it[0],
				{
					name: it[1].name,
					columns: it[1].columns,
					indexes: squashedIndexes,
					compositePrimaryKeys: squashedPKs,
					uniqueConstraints: squashedUniqueConstraints,
				},
			];
		}),
	);

	/* const mappedViews = Object.fromEntries(
		Object.entries(json.views).map(([key, value]) => {
			const meta = SingleStoreSquasher.squashView(value);

			return [key, {
				name: value.name,
				isExisting: value.isExisting,
				columns: value.columns,
				definition: value.definition,
				meta,
			}];
		}),
	); */

	return {
		version: '1',
		dialect: json.dialect,
		tables: mappedTables,
		/* views: mappedViews, */
	};
};

Domain

Subdomains

Calls

Frequently Asked Questions

What does squashSingleStoreScheme() do?
squashSingleStoreScheme() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/serializer/singlestoreSchema.ts.
Where is squashSingleStoreScheme() defined?
squashSingleStoreScheme() is defined in drizzle-kit/src/serializer/singlestoreSchema.ts at line 185.
What does squashSingleStoreScheme() call?
squashSingleStoreScheme() calls 1 function(s): mapValues.
What calls squashSingleStoreScheme()?
squashSingleStoreScheme() is called by 2 function(s): generateSingleStoreMigration, pushSingleStoreSchema.

Analyze Your Own Codebase

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

Try Supermodel Free