It does not work, because this subsystem uses composite unique keys in combination with an ON CONFLICT DO UPDATE operation, on behalf of the model entity definition UpsertionRecord.
Because the composite uniqueness constraint is currently being emulated already, it can't also emulate ON CONFLICT behaviour on top easily.
CrateDB fails with SQLParseException[Number of conflict targets (["key", "namespace"]) did not match the number of primary key columns ([uuid])], which is expected.
sqlalchemy.exc.ProgrammingError: (crate.client.exceptions.ProgrammingError) SQLParseException[Number of conflict targets (["key", "namespace"]) did not match the number of primary key columns ([uuid])]
[SQL: INSERT INTO upsertion_record (uuid, key, namespace, group_id, updated_at) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?) ON CONFLICT (key, namespace) DO UPDATE SET group_id = excluded.group_id, updated_at = excluded.updated_at]
[parameters: ('c3c64eca-8c66-44ce-b4f4-01519249eeaf', 'key1', 'kittens', None, 1700599350.084, '9aa23596-fd40-4758-91eb-dac2431e09d1', 'key2', 'kittens', None, 1700599350.084, '3a06bab9-494f-4b3c-8bf5-6b66a155d5d6', 'key3', 'kittens', None, 1700599350.084)]
(Background on this error at: https://sqlalche.me/e/20/f405)
About
It does not work, because this subsystem uses composite unique keys in combination with an
ON CONFLICT DO UPDATE
operation, on behalf of the model entity definitionUpsertionRecord
.Because the composite uniqueness constraint is currently being emulated already, it can't also emulate ON CONFLICT behaviour on top easily.
Code References
Error Message
CrateDB fails with
SQLParseException[Number of conflict targets (["key", "namespace"]) did not match the number of primary key columns ([uuid])]
, which is expected.