Skip to content

Commit

Permalink
refactor: sqlx - add vkey view
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed May 5, 2024
1 parent 31c07ca commit 7b25c85
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/sqlx/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ create index if not exists
rkey_etime_idx on rkey (etime)
where etime is not null;

create view if not exists
vkey as
select
id as kid, key, type, len,
datetime(etime/1000, 'unixepoch') as etime,
datetime(mtime/1000, 'unixepoch') as mtime
from rkey
where rkey.etime is null or rkey.etime > unixepoch('subsec');

-- ┌───────────────┐
-- │ Strings │
-- └───────────────┘
Expand Down

0 comments on commit 7b25c85

Please sign in to comment.