Add startup task to find page counts of existing files

This commit is contained in:
Eike Kettner
2020-11-09 20:34:34 +01:00
parent de00b46e5d
commit 29455d638c
9 changed files with 234 additions and 11 deletions

View File

@ -255,6 +255,21 @@ object RAttachment {
}
}
def findAllWithoutPageCount(chunkSize: Int): Stream[ConnectionIO, RAttachment] = {
val aId = Columns.id.prefix("a")
val mId = RAttachmentMeta.Columns.id.prefix("m")
val mPages = RAttachmentMeta.Columns.pages.prefix("m")
val cols = all.map(_.prefix("a"))
val join = table ++ fr"a LEFT OUTER JOIN" ++
RAttachmentMeta.table ++ fr"m ON" ++ aId.is(mId)
val cond = mPages.isNull
selectSimple(cols, join, cond)
.query[RAttachment]
.streamWithChunkSize(chunkSize)
}
def findWithoutPreview(
coll: Option[Ident],
chunkSize: Int