aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/pg/sql/find_email_validation.sql
blob: 1eb3e43f9b3368d47e06d26db48332466c1c400f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
select
        ev.email_validation_public_id
        , i.identity_public_id
        , e.address
        , ev.code
        , ev.is_oauth_derived
        , ev.created_at
        , ev.expired_at
        , ev.validated_at
        , iev.revoked_at
        , iev.deleted_at
from secd.email_validation               ev
join secd.email                          e   using (email_id)
left join secd.identity_email_validation iev using (email_validation_id)
left join secd.identity                  i   using (identity_id)
where (($1 is null) or (email_validation_public_id = $1))
and   (($2 is null) or (code = $2));
--