mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server): add memories statistics resource (#19035)
This commit is contained in:
parent
16745e77d4
commit
e88bd74fd2
12 changed files with 352 additions and 17 deletions
|
|
@ -1,8 +1,33 @@
|
|||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- MemoryRepository.statistics
|
||||
select
|
||||
count(*) as "total"
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
"deletedAt" is null
|
||||
and "ownerId" = $1
|
||||
|
||||
-- MemoryRepository.statistics (date filter)
|
||||
select
|
||||
count(*) as "total"
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
(
|
||||
"showAt" is null
|
||||
or "showAt" <= $1
|
||||
)
|
||||
and (
|
||||
"hideAt" is null
|
||||
or "hideAt" >= $2
|
||||
)
|
||||
and "deletedAt" is null
|
||||
and "ownerId" = $3
|
||||
|
||||
-- MemoryRepository.search
|
||||
select
|
||||
"memories".*,
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
|
|
@ -20,7 +45,8 @@ select
|
|||
order by
|
||||
"assets"."fileCreatedAt" asc
|
||||
) as agg
|
||||
) as "assets"
|
||||
) as "assets",
|
||||
"memories".*
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
|
|
@ -31,7 +57,6 @@ order by
|
|||
|
||||
-- MemoryRepository.search (date filter)
|
||||
select
|
||||
"memories".*,
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
|
|
@ -49,7 +74,8 @@ select
|
|||
order by
|
||||
"assets"."fileCreatedAt" asc
|
||||
) as agg
|
||||
) as "assets"
|
||||
) as "assets",
|
||||
"memories".*
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue