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

Derive Upsert Commands #10654

Open
olmohake opened this issue Jan 17, 2025 · 1 comment
Open

Derive Upsert Commands #10654

olmohake opened this issue Jan 17, 2025 · 1 comment
Labels
k/enhancement New feature or improve an existing feature

Comments

@olmohake
Copy link

Component

v3-engine
v3-ndc-postgres

Is your proposal related to a problem?

v2 was supporting upserts via

mutation upsert_article {
  insert_article (
    objects: [
      {
        id: 1
        title: "First Article",
        content: "Updated article 1 content",
        published_on: "2018-10-12"
      }
    ],
    on_conflict: {
      constraint: article_title_key,
      update_columns: [content]
    }
  ) {
    returning {
      id
      title
      content
      published_on
    }
  }
} 

this has not been implemented in v3 so far.

Describe the solution you'd like

derive a dedicated upsert command for all persisted models.

mutation upsert_article {
  upsertArticle (
    objects: [
      {
        id: 1
        title: "First Article",
        content: "Updated article 1 content",
        published_on: "2018-10-12"
      }
    ],
     update_columns: [content]
    }
  ) {
    returning {
      id
      title
      content
      published_on
    }
  }
} 

Describe alternatives you've considered

Implement upsert commands via native operations.

@olmohake olmohake added the k/enhancement New feature or improve an existing feature label Jan 17, 2025
@seanparkross
Copy link
Contributor

I am checking with the team for an update on upserts for the Postgres connector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants