feature: add sqlite kv db

This commit is contained in:
Seraphim Strub 2024-07-12 13:50:20 +00:00
parent 3671bf1f80
commit 759aae3b54
9 changed files with 152 additions and 2 deletions

15
query.sql Normal file
View file

@ -0,0 +1,15 @@
-- name: GetItem :one
SELECT *
FROM store
WHERE id = ?
LIMIT 1;
-- name: CountItems :one
SELECT count(*)
FROM store;
-- name: CreateItem :exec
INSERT INTO store (id, data)
VALUES (?1, ?2)
ON CONFLICT(id)
DO UPDATE SET data = ?2;