From c2268c285648ef02ece04de0d9df0813c6d70ff8 Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Sat, 24 Dec 2022 00:43:38 -0800
Subject: refactor everything with more abstraction and a nicer interface

---
 crates/secd/store/sqlite/sql/write_session.sql | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

(limited to 'crates/secd/store/sqlite/sql/write_session.sql')

diff --git a/crates/secd/store/sqlite/sql/write_session.sql b/crates/secd/store/sqlite/sql/write_session.sql
index 480af54..4679912 100644
--- a/crates/secd/store/sqlite/sql/write_session.sql
+++ b/crates/secd/store/sqlite/sql/write_session.sql
@@ -1,15 +1,10 @@
 insert into session (
        identity_id
-       , secret_hash
+       , token_hash
        , created_at
        , expired_at
        , revoked_at
 ) values (
-         (select identity_id from identity where identity_public_id = ?1)
-       , ?2
-       , ?3
-       , ?4
-       , ?5
-) on conflict (secret_hash) do update
-  set revoked_at = excluded.revoked_at;
---
+  (select identity_id from identity where identity_public_id = $1)
+  , $2, $3, $4, $5
+);
-- 
cgit v1.2.3

