Files
immich/server/src/queries/map.repository.sql
2025-12-12 15:22:13 +01:00

42 lines
833 B
SQL

-- NOTE: This file is auto generated by ./sql-generator
-- MapRepository.getMapMarkers
select
"id",
"asset_exif"."latitude" as "lat",
"asset_exif"."longitude" as "lon",
"asset_exif"."city",
"asset_exif"."state",
"asset_exif"."country"
from
"asset"
inner join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
and "asset_exif"."latitude" is not null
and "asset_exif"."longitude" is not null
where
"asset"."visibility" = $1
and "deletedAt" is null
and (
"ownerId" in ($2)
or exists (
select
from
"album_asset"
where
"asset"."id" = "album_asset"."assetId"
and "album_asset"."albumId" in ($3)
)
)
order by
"fileCreatedAt" desc
-- MapRepository.getFavoriteLocations
select
*
from
"favorite_location"
where
"userId" = $1
order by
"name" asc