mirror-immich/server/src/queries/ocr.repository.sql

69 lines
1022 B
SQL

-- NOTE: This file is auto generated by ./sql-generator
-- OcrRepository.getById
select
"asset_ocr".*
from
"asset_ocr"
where
"asset_ocr"."id" = $1
-- OcrRepository.getByAssetId
select
"asset_ocr".*
from
"asset_ocr"
where
"asset_ocr"."assetId" = $1
-- OcrRepository.upsert
with
"deleted_ocr" as (
delete from "asset_ocr"
where
"assetId" = $1
),
"inserted_ocr" as (
insert into
"asset_ocr" (
"assetId",
"x1",
"y1",
"x2",
"y2",
"x3",
"y3",
"x4",
"y4",
"text",
"boxScore",
"textScore"
)
values
(
$2,
$3,
$4,
$5,
$6,
$7,
$8,
$9,
$10,
$11,
$12,
$13
)
),
"inserted_search" as (
insert into
"ocr_search" ("assetId", "text")
values
($14, $15)
on conflict ("assetId") do update
set
"text" = "excluded"."text"
)
select
1 as "dummy"