graphile / graphile/crystal

Easier api to get pk columns of table

Open
#2,233 2 comments 1 reaction 0 assignees View on GitHub
💅 enhancement
Dominant language
TypeScript
Stars
12.9k
Forks
625
Avg merge
5h 23m
Merged PRs (30d)
24

Description

### Feature description

Determining the (name of) the pk columns of a table can be done inside plugins, but requires digging into introspection details

So, this request if to have an easy api to get the pk columns (.getPKAttributes()?)

From my limited knowledge of Postgraphile and the comments on discord, it seem that that at least in one scenario one can have a reference to a codec and in other scenarios a pgClass and in both cases it should be possible to get the (name of the) pk column(s)

### Motivating example

See https://discord.com/channels/489127045289476126/1296863704364879902/1298276538726481992

### Breaking changes

Don't think so

### Supporting development

I [tick all that apply]:

- [ ] am interested in building this feature myself
- [ ] am interested in collaborating on building this feature
- [ ] am willing to help testing this feature before it's released
- [ ] am willing to write a test-driven test suite for this feature (before it exists)
- [ ] am a [Graphile sponsor](https://www.graphile.org/sponsor/) ❤️
- [ ] have an active [support or consultancy contract](https://www.graphile.org/support/) with Graphile

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.