chore: no sql generation for queries with side effects (#18301)

no sql generation for queries with side effects
This commit is contained in:
Mert 2025-05-14 23:34:22 -04:00 committed by GitHub
parent 6a4d21205f
commit 709a7b70aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 48 additions and 167 deletions

View file

@ -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
)