pgSuite.simpleIndex() — drizzle-orm Function Reference
Architecture documentation for the pgSuite.simpleIndex() function in pg.test.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD ebfac5d1_8581_6e9c_3ea6_3d291fb357fe["pgSuite.simpleIndex()"] 66244d8b_f6c8_7e4e_5409_4e7e6a4add95["pg.test.ts"] ebfac5d1_8581_6e9c_3ea6_3d291fb357fe -->|defined in| 66244d8b_f6c8_7e4e_5409_4e7e6a4add95 style ebfac5d1_8581_6e9c_3ea6_3d291fb357fe fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-kit/tests/indexes/pg.test.ts lines 138–242
async simpleIndex() {
const schema1 = {
users: pgTable('users', {
id: serial('id').primaryKey(),
name: text('name'),
}),
};
const schema2 = {
users: pgTable(
'users',
{
id: serial('id').primaryKey(),
name: text('name'),
},
(t) => ({
indx: index()
.on(t.name.desc(), t.id.asc().nullsLast())
.with({ fillfactor: 70 })
.where(sql`select 1`),
indx1: index('indx1')
.using('hash', t.name.desc(), sql`${t.name}`)
.with({ fillfactor: 70 }),
}),
),
};
const { statements, sqlStatements } = await diffTestSchemas(
schema1,
schema2,
[],
);
expect(statements.length).toBe(2);
expect(statements[0]).toStrictEqual({
schema: '',
tableName: 'users',
type: 'create_index_pg',
data: {
columns: [
{
asc: false,
expression: 'name',
isExpression: false,
nulls: 'last',
opclass: '',
},
{
asc: true,
expression: 'id',
isExpression: false,
nulls: 'last',
opclass: '',
},
],
concurrently: false,
isUnique: false,
method: 'btree',
name: 'users_name_id_index',
where: 'select 1',
with: {
fillfactor: 70,
},
},
// data: 'users_name_id_index;name,false,last,undefined,,id,true,last,undefined;false;false;btree;select 1;{"fillfactor":70}',
});
expect(statements[1]).toStrictEqual({
schema: '',
tableName: 'users',
type: 'create_index_pg',
data: {
columns: [
{
asc: false,
expression: 'name',
isExpression: false,
nulls: 'last',
opclass: '',
},
{
asc: true,
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does pgSuite.simpleIndex() do?
pgSuite.simpleIndex() is a function in the drizzle-orm codebase, defined in drizzle-kit/tests/indexes/pg.test.ts.
Where is pgSuite.simpleIndex() defined?
pgSuite.simpleIndex() is defined in drizzle-kit/tests/indexes/pg.test.ts at line 138.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free