Skip to content

Commit

Permalink
Give way of getting index access method
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Jan 31, 2024
1 parent 257c0f7 commit aa3d3a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/pg-introspection/src/augmentIntrospection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ export function augmentIntrospection(
entity.getInherited = memo(() =>
introspection.inherits.filter((inh) => inh.inhrelid === entity._id),
);
entity.getAccessMethod = memo(() =>
entity.relam != null
? introspection.am.find((am) => am._id === entity.relam)
: undefined,
);
});
introspection.indexes.forEach((entity) => {
entity._type = "PgIndex";
Expand Down
1 change: 1 addition & 0 deletions utils/pg-introspection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ declare module "./introspection" {
getTags(): PgSmartTagsDict;
getACL(): AclObject[];
getInherited(): PgInherits[];
getAccessMethod(): PgAm | undefined;
}
interface PgIndex {
_type: "PgIndex";
Expand Down

0 comments on commit aa3d3a1

Please sign in to comment.