mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 09:14:58 +03:00
feat(server): add memories statistics resource (#19035)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user