Home / Function/ PgSquasher.unsquashIdx() — drizzle-orm Function Reference

PgSquasher.unsquashIdx() — drizzle-orm Function Reference

Architecture documentation for the PgSquasher.unsquashIdx() function in pgSchema.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  8cdb6ce4_18f0_23aa_07f8_8a58d080160b["PgSquasher.unsquashIdx()"]
  cbf63853_6723_30fc_5ded_88a8944f77c4["pgSchema.ts"]
  8cdb6ce4_18f0_23aa_07f8_8a58d080160b -->|defined in| cbf63853_6723_30fc_5ded_88a8944f77c4
  style 8cdb6ce4_18f0_23aa_07f8_8a58d080160b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/serializer/pgSchema.ts lines 562–597

	unsquashIdx: (input: string): Index => {
		const [
			name,
			columnsString,
			isUnique,
			concurrently,
			method,
			where,
			idxWith,
		] = input.split(';');

		const columnString = columnsString.split(',,');
		const columns: IndexColumnType[] = [];

		for (const column of columnString) {
			const [expression, isExpression, asc, nulls, opclass] = column.split('--');
			columns.push({
				nulls: nulls as IndexColumnType['nulls'],
				isExpression: isExpression === 'true',
				asc: asc === 'true',
				expression: expression,
				opclass: opclass === 'undefined' ? undefined : opclass,
			});
		}

		const result: Index = index.parse({
			name,
			columns: columns,
			isUnique: isUnique === 'true',
			concurrently: concurrently === 'true',
			method,
			where: where === 'undefined' ? undefined : where,
			with: !idxWith || idxWith === 'undefined' ? undefined : JSON.parse(idxWith),
		});
		return result;
	},

Domain

Subdomains

Frequently Asked Questions

What does PgSquasher.unsquashIdx() do?
PgSquasher.unsquashIdx() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/serializer/pgSchema.ts.
Where is PgSquasher.unsquashIdx() defined?
PgSquasher.unsquashIdx() is defined in drizzle-kit/src/serializer/pgSchema.ts at line 562.

Analyze Your Own Codebase

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

Try Supermodel Free