Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracking all suggested relationships in console has to be documented #2726

Closed
jjangga0214 opened this issue Aug 13, 2019 · 8 comments
Closed
Assignees
Labels
c/docs Related to docs e/quickfix can be wrapped up in few hours p/medium non-urgent issues/features that are candidates for being included in one of the upcoming sprints

Comments

@jjangga0214
Copy link
Contributor

jjangga0214 commented Aug 13, 2019

Hasura recommends relationships, based on foreign keys. So users just can "click" the button to create the relationships like this image.

Screenshot from 2019-08-13 22-50-06

However, for existing databases with 'many' tables, manually clicking all the buttons is so tedious. Therefore I request a feature to accept EVERY recommended relationships with one click.

@jjangga0214 jjangga0214 changed the title Accept EVERY suggested relations One click button to accept EVERY suggested relationships Aug 13, 2019
@jjangga0214 jjangga0214 changed the title One click button to accept EVERY suggested relationships One-click button to accept EVERY suggested relationships Aug 13, 2019
@marionschleifer marionschleifer added the c/console Related to console label Aug 13, 2019
@ecthiender
Copy link
Member

ecthiender commented Aug 14, 2019

If you go to the main "Data" page, it will list all relationships that can be tracked, under "Untracked foreign-key relations". You can just click on the "Track All" button to track them all.

Screenshot_2019-08-14 Schema - Data Hasura

This is what you mean right?

@jjangga0214
Copy link
Contributor Author

@ecthiender Great! Thank you for letting me know that!

@jjangga0214
Copy link
Contributor Author

jjangga0214 commented Aug 14, 2019

@ecthiender Then what if docs explicitly mention this feature? If so, users would not have to waste their time. Currently, as far as I know, docs doesn't say this feature.

@ecthiender ecthiender changed the title One-click button to accept EVERY suggested relationships tracking all suggested relationships in console has to be documented Aug 14, 2019
@ecthiender ecthiender added c/docs Related to docs and removed c/console Related to console labels Aug 14, 2019
@ecthiender ecthiender added e/quickfix can be wrapped up in few hours p/medium non-urgent issues/features that are candidates for being included in one of the upcoming sprints labels Aug 14, 2019
@oscar6echo
Copy link

oscar6echo commented Sep 15, 2019

I agree the button "Track All" under "Untracked foreign-key relations" in the the"Data" page is EXTREMELY USEFUL. Otherwise, it would be practically impossible to use Hasura on an existing database with a large number of relationships.

But what is still missing is an API endpoint to do that: "Track all relationships inferred from db structure" (more precisely, the subset of tracked tables).
Is there any plan to add this feature soon ?

Because it really is the ONLY step that cannot be automated (i.e. performed through the API).
You already can:

  • track tables
  • make tables enums (where relevant)
  • manage event triggers and permissions
  • manage remote schemas
  • then download resulting metadata for future use

True, you can create individual relationships though create_array_relationship and create_object_relationship but it is a lot of work to build the many queries to do the same as the "Track All" button on the GUI.

In my company we are starting to use Hasura to expose postgres dBs. Unfortunately this manual step breaks the workflow. I'm surprised this endpoint is not already in the API. I would seem very natural since the work is already done, right ? Is there a reason beyond 'nobody asked for it' ?

Apart from that, I would like to congratulate the Hasura team for the superb work. It is a very useful and promising piece of software !!!

@jjangga0214
Copy link
Contributor Author

jjangga0214 commented Sep 15, 2019

@oscar6echo +1

P.S.0. In my humble opinion, your suggestion should be an independent issue as it's a 'feature request' for API, while this issue is now a 'docs request'.

P.S.1. Using an e2e testing tool would enable a workaround by "clicking" the button in an automatic way.

@shahidhk
Copy link
Member

@oscar6echo It is not encouraged to "click the button" to track all tables or relationships in a production environment. You should do that once in your dev env and then export the metadata and use import this metadata later in other instances.
Otherwise, your configuration is never declarative.

See https://docs.hasura.io/1.0/graphql/manual/migrations/manage-metadata.html on how you can use the API to export/import metadata.

@oscar6echo
Copy link

Ok, understood.
Thx for the quick answer.

@marionschleifer marionschleifer removed their assignment Sep 17, 2020
@marionschleifer marionschleifer added help wanted Good candidate for contribution. Community help wanted! good first issue Good for newcomers labels Sep 18, 2020
@marionschleifer marionschleifer removed good first issue Good for newcomers hacktoberfest help wanted Good candidate for contribution. Community help wanted! labels Sep 28, 2020
@marionschleifer marionschleifer self-assigned this Sep 28, 2020
@rikinsk
Copy link
Member

rikinsk commented Oct 14, 2020

Closed via #4948

@rikinsk rikinsk closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/docs Related to docs e/quickfix can be wrapped up in few hours p/medium non-urgent issues/features that are candidates for being included in one of the upcoming sprints
Projects
None yet
Development

No branches or pull requests

7 participants