2025-01-17 14:02:28 -06:00
|
|
|
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
|
|
|
|
|
|
-- StackRepository.search
|
2025-01-21 09:36:28 -06:00
|
|
|
select
|
|
|
|
|
"asset_stack".*,
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
coalesce(json_agg(agg), '[]')
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
*
|
|
|
|
|
from
|
|
|
|
|
"assets"
|
|
|
|
|
where
|
|
|
|
|
"assets"."deletedAt" is null
|
|
|
|
|
and "assets"."stackId" = "asset_stack"."id"
|
|
|
|
|
) as agg
|
|
|
|
|
) as "assets"
|
|
|
|
|
from
|
|
|
|
|
"asset_stack"
|
|
|
|
|
where
|
|
|
|
|
"asset_stack"."ownerId" = $1
|
2025-01-17 14:02:28 -06:00
|
|
|
|
|
|
|
|
-- StackRepository.delete
|
2025-01-21 09:36:28 -06:00
|
|
|
select
|
|
|
|
|
*,
|
2025-01-17 14:02:28 -06:00
|
|
|
(
|
2025-01-21 09:36:28 -06:00
|
|
|
select
|
|
|
|
|
coalesce(json_agg(agg), '[]')
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
*,
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
coalesce(json_agg(agg), '[]')
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
"tags".*
|
|
|
|
|
from
|
|
|
|
|
"tags"
|
|
|
|
|
inner join "tag_asset" on "tags"."id" = "tag_asset"."tagsId"
|
|
|
|
|
where
|
|
|
|
|
"tag_asset"."assetsId" = "assets"."id"
|
|
|
|
|
) as agg
|
|
|
|
|
) as "tags"
|
|
|
|
|
from
|
|
|
|
|
"assets"
|
|
|
|
|
where
|
|
|
|
|
"assets"."deletedAt" is null
|
|
|
|
|
and "assets"."stackId" = "asset_stack"."id"
|
|
|
|
|
) as agg
|
|
|
|
|
) as "assets"
|
|
|
|
|
from
|
|
|
|
|
"asset_stack"
|
|
|
|
|
where
|
|
|
|
|
"id" = $1::uuid
|
2025-01-17 14:02:28 -06:00
|
|
|
|
|
|
|
|
-- StackRepository.getById
|
2025-01-21 09:36:28 -06:00
|
|
|
select
|
|
|
|
|
*,
|
2025-01-17 14:02:28 -06:00
|
|
|
(
|
2025-01-21 09:36:28 -06:00
|
|
|
select
|
|
|
|
|
coalesce(json_agg(agg), '[]')
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
*,
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
coalesce(json_agg(agg), '[]')
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select
|
|
|
|
|
"tags".*
|
|
|
|
|
from
|
|
|
|
|
"tags"
|
|
|
|
|
inner join "tag_asset" on "tags"."id" = "tag_asset"."tagsId"
|
|
|
|
|
where
|
|
|
|
|
"tag_asset"."assetsId" = "assets"."id"
|
|
|
|
|
) as agg
|
|
|
|
|
) as "tags"
|
|
|
|
|
from
|
|
|
|
|
"assets"
|
|
|
|
|
where
|
|
|
|
|
"assets"."deletedAt" is null
|
|
|
|
|
and "assets"."stackId" = "asset_stack"."id"
|
|
|
|
|
) as agg
|
|
|
|
|
) as "assets"
|
|
|
|
|
from
|
|
|
|
|
"asset_stack"
|
|
|
|
|
where
|
|
|
|
|
"id" = $1::uuid
|