如何在 slick 3.0 中进行此查询?
Select *,(SELECT COUNT(*) from flashcards WHERE setId = flashcards_sets.id ) as allCount,(SELECT COUNT(*) from flashcards WHERE studied = true AND setId = flashcards_sets.id ) as studiedCount FROM flashcards_sets;
private def filterByFlashCardQuery(id: Int): Query[FlashCards, FlashCard, Seq] =
flashcards.filter(_.setId === id && _.studied = true)
def findByFlashcardLength(flashcardId: Int):Future[Int] = {
try db.run(filterByFlashCardQuery(flashcardId).length.result)
finally println("db.close")//db.close
}
```