hasura / hasura/graphql-engine

Allow tracking of POTGRES sequences or functions to manipulate sequences

Open
#9,384 2 comments 0 reactions 0 assignees View on GitHub
k/enhancement t/native-dbs
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

Postgres sequence manipulation functions provide results as a specialised table. It could be interesting to be able to select results from a sequence with the given postgres functions

### Describe the solution you'd like

Be able to manipulate a sequence that is not attached to a table in order to store a counter in the database accessible via graphql api without having to create a table with inaccurate elements as table rows can be deleted not representing the correct current value of the sequence.

### Describe alternatives you've considered

Any alternative that provides the capability of using the database to store a counter that functions as a postgres sequence (getval, nextval, setval)

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests; start by reviewing how PostgreSQL functions are exposed through Hasura's GraphQL API. Define the supported sequence operations (getval, nextval, and setval), their GraphQL shape and permissions, then add coverage showing that an unattached sequence can be used and that the counter value is returned correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgres
Domain
api, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.