Home / Function/ pgSuite.dropIndex() — drizzle-orm Function Reference

pgSuite.dropIndex() — drizzle-orm Function Reference

Architecture documentation for the pgSuite.dropIndex() function in pg.test.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  edad8f7e_f566_4287_2cae_c63278079c73["pgSuite.dropIndex()"]
  0408ab8f_6d6f_cdae_29f3_25c8efadbfae["pg.test.ts"]
  edad8f7e_f566_4287_2cae_c63278079c73 -->|defined in| 0408ab8f_6d6f_cdae_29f3_25c8efadbfae
  style edad8f7e_f566_4287_2cae_c63278079c73 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/tests/push/pg.test.ts lines 636–671

	async dropIndex() {
		const client = new PGlite();

		const schema1 = {
			users: pgTable(
				'users',
				{
					id: serial('id').primaryKey(),
					name: text('name'),
				},
				(t) => ({
					indx: index().on(t.name.desc(), t.id.asc().nullsLast()).with({ fillfactor: 70 }),
				}),
			),
		};

		const schema2 = {
			users: pgTable('users', {
				id: serial('id').primaryKey(),
				name: text('name'),
			}),
		};

		const { statements, sqlStatements } = await diffTestSchemasPush(client, schema1, schema2, [], false, ['public']);

		expect(statements.length).toBe(1);
		expect(statements[0]).toStrictEqual({
			schema: '',
			tableName: 'users',
			type: 'drop_index',
			data: 'users_name_id_index;name--false--last,,id--true--last;false;btree;{"fillfactor":"70"}',
		});

		expect(sqlStatements.length).toBe(1);
		expect(sqlStatements[0]).toBe(`DROP INDEX "users_name_id_index";`);
	},

Domain

Subdomains

Frequently Asked Questions

What does pgSuite.dropIndex() do?
pgSuite.dropIndex() is a function in the drizzle-orm codebase, defined in drizzle-kit/tests/push/pg.test.ts.
Where is pgSuite.dropIndex() defined?
pgSuite.dropIndex() is defined in drizzle-kit/tests/push/pg.test.ts at line 636.

Analyze Your Own Codebase

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

Try Supermodel Free