From 2c4eb2d311919ad9fb70738199ecf99bf20c9fce Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Thu, 1 Dec 2022 10:30:34 -0800
Subject: - basic functionality with psql and sqlite - cli helper tool

---
 crates/secd/store/sqlite/sql/find_email_validation.sql | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 crates/secd/store/sqlite/sql/find_email_validation.sql

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

diff --git a/crates/secd/store/sqlite/sql/find_email_validation.sql b/crates/secd/store/sqlite/sql/find_email_validation.sql
new file mode 100644
index 0000000..a34c149
--- /dev/null
+++ b/crates/secd/store/sqlite/sql/find_email_validation.sql
@@ -0,0 +1,16 @@
+select
+        ev.email_validation_public_id
+        , i.identity_public_id
+        , e.address
+        , ev.attempts
+        , ev.code
+        , ev.is_validated
+        , ev.created_at
+        , ev.expires_at
+        , ev.revoked_at
+from email_validation ev
+join identity_email   ie using (identity_email_id)
+join email            e  using (email_id)
+join identity         i  using (identity_id)
+where ((?1 is null) or (email_validation_public_id = ?1))
+and   ((?2 is null) or (code = ?2));
-- 
cgit v1.2.3

