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

Upsert on table to respect omit tags #174

Merged
merged 1 commit into from
Jul 15, 2021
Merged

Upsert on table to respect omit tags #174

merged 1 commit into from
Jul 15, 2021

Conversation

ioancole
Copy link
Contributor

@ioancole ioancole commented Sep 16, 2020

Upsert should be ommitted if "@omit" tag is present

Works for both:

COMMENT ON TABLE table_name IS '@omit upsert';
(- omit upsert query only, other operations to be untouched)

and:

COMMENT ON TABLE table_name IS '@omit';
(- omit all queries on table_name)

@ioancole
Copy link
Contributor Author

Further suggestion to this feature - also exclude GraphQL upsert queries when any of the following are manually omitted via smart tags: upsert, insert, update.

The assumption here being that, e.g. if someone manually omits insert, they probably don't want the upsert query to be generated...

@cdaringe I have this extra change on a separate branch, can include them (and the original @omit feature) in one PR if you are interested...

@wesselvdv
Copy link

Can this be merged please? Would a nice thing to have.

@cdaringe
Copy link
Owner

cdaringe commented Jul 14, 2021

I’m so sorry I missed this! The commit needs to be formed using conventional commit style, that way the release will get auto published npm! I should have set up CI to test for this, apologies

@wesselvdv
Copy link

I assume @ioancole has to change the commit message and force-push?

@ioancole
Copy link
Contributor Author

Hi

I’m so sorry I missed this! The commit needs to be formed using conventional commit style, that way the release will get auto published npm! I should have set up CI to test for this, apologies

I can change the commit message. Can you point me to an example of the format/style that you need? Thanks

@cdaringe
Copy link
Owner

cdaringe commented Jul 15, 2021

feat: support omit tags would be fine. if you want more on it, check out https://www.conventionalcommits.org/en/v1.0.0/

mind dropping me a link to the Postgres feature? I’m not familiar with E'text' format

@ioancole
Copy link
Contributor Author

The commit message has been updated.

Sorry, the E'text' format is not necessary here, they are C style escape strings.
https://www.postgresql.org/docs/9.0/sql-syntax-lexical.html
Section 4.1.2.2

@cdaringe cdaringe merged commit 653f64c into cdaringe:master Jul 15, 2021
@ioancole
Copy link
Contributor Author

ioancole commented Aug 5, 2021

Hi, thanks for completing the PR. However I notice that the version in NPM is still 1.0.5, which does not contain this change. Do you plan on updating this soon?
Thanks 👍

@cdaringe
Copy link
Owner

cdaringe commented Aug 6, 2021

dang, if i would have noticed i would have patched earlier. looks like ci choked up. on it

@cdaringe
Copy link
Owner

cdaringe commented Aug 6, 2021 via email

@wa11-e
Copy link
Collaborator

wa11-e commented Aug 6, 2021

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wa11-e wa11-e added the released label Aug 6, 2021
@ioancole
Copy link
Contributor Author

ioancole commented Aug 6, 2021

1.1.0 is out

On Thu, Aug 5, 2021 at 1:00 AM Ioan @.***> wrote: Hi, thanks for completing the PR. However I notice that the version in NPM is still 1.0.5, which does not contain this change. Do you plan on updating this soon? Thanks — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#174 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHU57JUWAXADDIQE4KWGPTT3JALFANCNFSM4ROMBZOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Great, thanks!

eturino added a commit to eturino/postgraphile-upsert that referenced this pull request Dec 6, 2021
cdaringe pushed a commit that referenced this pull request Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants