hasura / hasura/graphql-engine

Configure table columns order

Open
#9,847 0 comments 0 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

One of the most annoying limitation with PostgresQL in my opinion is it's [lack of support to configure column order](https://wiki.postgresql.org/wiki/Alter_column_position).

As they mentionned on their wiki page:

> The idea of allowing re-ordering of column position is not one the postgresql developers are against, it is more a case where no one has stepped forward to do the work.

This document has been last updated in 2014, so it would be surprising that PostgresQL end up supporting this in the near future.

In the meantime the main drawbacks of this limitation prevents us from benefiting from consistency in column ordering. This can make schema management and understanding easier, especially when you have conventions like always starting with an `id` column or ending with timestamp columns like `created_at` and `updated_at`.

In my opinion, it would be easy for Hasura to store the table column orders in the table `yaml` files, so that all environment would look and feel the same and it would improve the overall experience when using the UI.

### Describe the solution you'd like

I would like the ability in the "Table modify" UI, to drag ad drop the order of the columns which would be persisted in the `yaml` configuration file.

### Describe alternatives you've considered

Right now, when I need to change column orders, I have to use complex SQL query which in my case quasi-rewrite tables. It's very dangerous and time consuming when all we need is a decent way to view the data.

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.