fabric-smart-client icon indicating copy to clipboard operation
fabric-smart-client copied to clipboard

upsert instead of select and then update or insert

Open arner opened this issue 6 months ago • 0 comments

The SetState function of the sql version of KVS and Vault uses an ANSI compliant but not the most performant way to do an upsert; it tries a SELECT and based on the result, chooses to do an INSERT or an UPDATE.

Now that we have two distinct database drivers for postgres and sqlite, we should also use their respective ways to do an upsert in a single call.

arner avatar Aug 06 '24 14:08 arner