We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found a case where /-/upserting a non-existing row behaves differently than /-/inserting a non-existing row.
/-/upsert
/-/insert
This surprised me, but I might be misunderstanding the intended use.
If I have a table like:
create table test(key text primary key, value text);
I can do:
$ curl -XPOST https://example.com/-/upsert/db/test?pk=key -d '{"key": "abc", "value": "def"}' {"table_count": 1}
But if the columns are non null, the upsert fails:
create table test(key text primary key, value text not null);
$ curl -XPOST https://example.com/-/upsert/db/test?pk=key -d '{"key": "abc", "value": "def"}' {"table_count": 0}
(The /-/insert endpoint adds the row in both cases.)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I found a case where
/-/upsert
ing a non-existing row behaves differently than/-/insert
ing a non-existing row.This surprised me, but I might be misunderstanding the intended use.
If I have a table like:
I can do:
But if the columns are non null, the upsert fails:
(The
/-/insert
endpoint adds the row in both cases.)The text was updated successfully, but these errors were encountered: