-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
do not add extra s after table name when generating array relationship name #1072
Conversation
Beep boop! 🤖 Hey @elitan, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. 🕐 Stay awesome! 😎 |
hmm, do I have to take any further action on this? |
Hi @elitan, thanks for the contribution 🙏 The change you have added is for @praveenweb @karthikvt26, can you point @elitan to the right place where he needs to make this change? My suggestion is that we add a |
Ok, yes please nock me in the right direction. :) But first maybe we should discuss if we should or shouldn't add the extra With your idea with adding a This would result in |
That could work, but I do see some problems with it. As you say it would probably work "in most cases". Aslo you would have problem if you name your tables in another language than English. I understand you want to make it as easy as possible for users when naming relations between tables. But as a developer you also want to be, or feel like you are, in full control. For me, when Hasura tries to be smart like this, and fail, it is frustrating. And if Hasura would be somewhat successful in 'guessing' the correct name on relations I would expect Hasura to also enforce singular naming on table names for consistency. Further I would expect all query names to have the plural format as well since, if I am not misstaken, all queries return an array of objects. Ex: Table name: I suggest that Hasura would suggest to use plural format when naming tables, and remove any automatic/smart conversion when generating relationship names. |
@elitan Sorry, lost track of this issue. @praveenweb What do you think? |
Thanks for the PR @elitan, as @praveenweb mentioned, we'll use the node module inflection to do this. Feel free to take up #1444 if you are interested 😄 |
Review app https://hge-ci-pull-1072.herokuapp.com is deleted |
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.16 to 4.5.17. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.5.17</h2> <h2>[4.5.17] - 2024-09-04</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Style required argument groups</li> <li><em>(derive)</em> Improve error messages when unsupported fields are used</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.5.17] - 2024-09-04</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Style required argument groups</li> <li><em>(derive)</em> Improve error messages when unsupported fields are used</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/clap-rs/clap/commit/6013ad4f676dd25c5b5150557a5fb5698c3de020"><code>6013ad4</code></a> chore: Release</li> <li><a href="https://github.com/clap-rs/clap/commit/f98e3ee215015055d776f91217019c33da78c975"><code>f98e3ee</code></a> docs: Update changelog</li> <li><a href="https://github.com/clap-rs/clap/commit/addec17e9df4f4f64a959bbe6ab8c9ced48c6a3d"><code>addec17</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/5681">#5681</a> from epage/static</li> <li><a href="https://github.com/clap-rs/clap/commit/3c69aaa312af1b537ccd291314b60500ab5066c4"><code>3c69aaa</code></a> docs(complete): Add stdout warning to env</li> <li><a href="https://github.com/clap-rs/clap/commit/e46263a0480f7bc7ab085e966a1eee1287e4303b"><code>e46263a</code></a> docs(complete): Redistribute dynamic's documentation</li> <li><a href="https://github.com/clap-rs/clap/commit/de723aaf8a81402c4543f73118466c72c95653fb"><code>de723aa</code></a> fix(complete)!: Flatten in prep for stabilization</li> <li><a href="https://github.com/clap-rs/clap/commit/6727c1537b9e8c26a27efefad6e55106f25e0b1c"><code>6727c15</code></a> fix(complete): Section off existing completions</li> <li><a href="https://github.com/clap-rs/clap/commit/6842ed96da9d7307e340ac82bc2d6fd27a591f9d"><code>6842ed9</code></a> refactor(complete): Remove low-value w macro</li> <li><a href="https://github.com/clap-rs/clap/commit/17d6d2423292610827559be0e361035aeb42092a"><code>17d6d24</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/5680">#5680</a> from epage/unstable</li> <li><a href="https://github.com/clap-rs/clap/commit/23fb0568a861a34fb60b95c916f0aa9d8dbe7e24"><code>23fb056</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/5679">#5679</a> from epage/api</li> <li>Additional commits viewable in <a href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.16...clap_complete-v4.5.17">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.16&new-version=4.5.17)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> V3_GIT_ORIGIN_REV_ID: 49b80a6725973f691e34caf8e89750cf6765bc70
…p name
Description
do not add extra s after table name when generating array relationship name
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
None
Solution and Design
Some (most) use plural when naming their tables. This make the extra added, hard coded,
s
after a table name confusing. Even if the tables are named in singular, just adding as
in the end is not the correct plural naming. Likecompany
which in plural iscompanies
. Just adding as
in the end would result in an incorrect naming:companys
.Type
Checklist: