refactor: sqlx - add vkey view

This commit is contained in:
Anton
2024-05-05 15:54:38 +05:00
parent 31c07ca9a4
commit 7b25c85f8f

View File

@@ -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 │
-- └───────────────┘