0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -05:00
penpot/backend/resources/sql/kvstore.sql
2016-11-20 20:04:52 +01:00

17 lines
402 B
SQL

-- :name update-kvstore :<! :1
insert into kvstore (key, value, "user")
values (:key, :value, :user)
on conflict ("user", key)
do update set value = :value, version = :version
returning *;
-- :name retrieve-kvstore :? :1
select kv.*
from kvstore as kv
where kv."user" = :user
and kv.key = :key;
-- :name delete-kvstore :! :n
delete from kvstore
where "user" = :user
and key = :key;