aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/pg/sql/write_session.sql
diff options
context:
space:
mode:
Diffstat (limited to 'crates/secd/store/pg/sql/write_session.sql')
-rw-r--r--crates/secd/store/pg/sql/write_session.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/secd/store/pg/sql/write_session.sql b/crates/secd/store/pg/sql/write_session.sql
new file mode 100644
index 0000000..cd5892b
--- /dev/null
+++ b/crates/secd/store/pg/sql/write_session.sql
@@ -0,0 +1,18 @@
+insert into auth.session (
+ identity_id
+ , secret_hash
+ , created_at
+ , touched_at
+ , expires_at
+ , revoked_at
+) values (
+ (select identity_id from auth.identity where identity_public_id = $1)
+ , $2
+ , $3
+ , $4
+ , $5
+ , $6
+) on conflict (secret_hash) do update
+ set touched_at = excluded.touched_at
+ , revoked_at = excluded.revoked_at;
+--