mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: no sql generation for queries with side effects (#18301)
no sql generation for queries with side effects
This commit is contained in:
parent
6a4d21205f
commit
709a7b70aa
20 changed files with 48 additions and 167 deletions
|
|
@ -432,3 +432,34 @@ where
|
|||
and "assets"."updatedAt" > $3
|
||||
limit
|
||||
$4
|
||||
|
||||
-- AssetRepository.detectOfflineExternalAssets
|
||||
update "assets"
|
||||
set
|
||||
"isOffline" = $1,
|
||||
"deletedAt" = $2
|
||||
where
|
||||
"isOffline" = $3
|
||||
and "isExternal" = $4
|
||||
and "libraryId" = $5::uuid
|
||||
and (
|
||||
not "originalPath" like $6
|
||||
or "originalPath" like $7
|
||||
)
|
||||
|
||||
-- AssetRepository.filterNewExternalAssetPaths
|
||||
select
|
||||
"path"
|
||||
from
|
||||
unnest(array[$1]::text[]) as "path"
|
||||
where
|
||||
not exists (
|
||||
select
|
||||
"originalPath"
|
||||
from
|
||||
"assets"
|
||||
where
|
||||
"assets"."originalPath" = "path"
|
||||
and "libraryId" = $2::uuid
|
||||
and "isExternal" = $3
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue