Skip to content

Commit 360e5e0

Browse files
hansololaibenjie
authored andcommitted
feat(pg): add partial index detection to introspection (#535)
1 parent fb80d2d commit 360e5e0

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

packages/graphile-build-pg/src/plugins/PgIntrospectionPlugin.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export interface PgIndex {
152152
indexType: string;
153153
isUnique: boolean;
154154
isPrimary: boolean;
155+
isPartial: boolean;
155156
attributeNums: Array<number>;
156157
attributePropertiesAsc: Array<boolean> | void;
157158
attributePropertiesNullsFirst: Array<boolean> | void;

packages/graphile-build-pg/src/plugins/PgIntrospectionPlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export type PgIndex = {
182182
isReplicaIdentity: boolean,
183183
isValid: boolean,
184184
*/
185+
isPartial: boolean,
185186
attributeNums: Array<number>,
186187
attributePropertiesAsc: ?Array<boolean>,
187188
attributePropertiesNullsFirst: ?Array<boolean>,

packages/graphile-build-pg/src/plugins/introspectionQuery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ with
375375
idx.indimmediate as "isImmediate", -- enforce uniqueness immediately on insert
376376
idx.indisreplident as "isReplicaIdentity",
377377
idx.indisvalid as "isValid", -- if false, don't use for queries
378+
idx.indpred is not null as "isPartial", -- if true, index is not on on rows.
378379
idx.indkey as "attributeNums",
379380
am.amname as "indexType",
380381
${

0 commit comments

Comments
 (0)