Skip to content

Commit

Permalink
Merge branch 'master' into TDRD-229-allow-to-skip-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vimleshtna authored Feb 4, 2025
2 parents 636179f + fddd279 commit c170b00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ enablePlugins(GraphQLSchemaPlugin)
graphqlSchemaSnippet := "uk.gov.nationalarchives.tdr.api.graphql.GraphQlTypes.schema"

lazy val akkaVersion = "2.10.0"
lazy val akkaHttpVersion = "10.6.3"
lazy val akkaHttpVersion = "10.7.0"
lazy val circeVersion = "0.14.10"
lazy val testContainersVersion = "0.41.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class FileRepository(db: JdbcBackend#Database)(implicit val executionContext: Ex

def getAllDescendants(fileIds: Seq[UUID]): Future[Seq[FileRow]] = {

val sql =
val valueIdsString = fileIds.mkString("('", "','", "')")
val plainSql =
sql"""WITH RECURSIVE children AS (
SELECT
"FileId"::text,
Expand All @@ -108,7 +109,7 @@ class FileRepository(db: JdbcBackend#Database)(implicit val executionContext: Ex
"FileName",
"ParentId"::text
FROM "File"
WHERE "FileId"::text IN #${fileIds.mkString("('", "','", "')")}
WHERE "FileId"::text IN #$valueIdsString
UNION SELECT
f."FileId"::text,
f."ConsignmentId"::text,
Expand All @@ -119,7 +120,9 @@ class FileRepository(db: JdbcBackend#Database)(implicit val executionContext: Ex
f."FileName",
f."ParentId"::text
FROM "File" f INNER JOIN children c ON c."FileId"::text = f."ParentId"::text
) SELECT * FROM children;""".as[FileRow]
) SELECT * FROM children;"""

val sql = plainSql.as[FileRow]
db.run(sql)
}

Expand Down

0 comments on commit c170b00

Please sign in to comment.