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

INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE #26

Open
2kikee122 opened this issue Jul 10, 2020 · 2 comments

Comments

@2kikee122
Copy link

Is it possible to save a qframe, where we update primary keys if they exist?

@kevinschoon
Copy link
Contributor

This functionality is not currently available in QFrame, colloquially what you describe is an upsert.

 A(i)  B(s)
----- -----
    1   one
    2   two
// generates a prepared statement like:
INSERT INTO table (A, B) VALUES (?, ?);

We would just need to add an option to generate a dialect specific statement like ON CONFLICT .... You can see how the prepared statement is created here.

@kevinschoon
Copy link
Contributor

kevinschoon commented Jul 31, 2020

I forgot to mention that I wrote a fix for allowing upserts in qframe in #29 but I haven't had a chance to finalize it, feel free to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants