Tim Malseed
01/17/2020, 1:36 PMTim Malseed
01/17/2020, 1:36 PMsuspend fun getReports(): List<Report> = DatabaseManager.dbQuery {
val voteCount = Votes.userId.countDistinct()
(Reports leftJoin Votes)
.slice(Reports.columns + voteCount)
.selectAll()
.map { row ->
Report(
row[Reports.id],
row[Reports.userId],
row[Reports.title],
row[Reports.description],
row[voteCount],
row[Reports.appVersion],
row[Reports.deviceName],
row[Reports.osVersion],
row[Reports.dateCreated],
row[Reports.dateResolved]
)
}
}
But this only ever returns one row. What gives?spand
01/17/2020, 1:48 PMTim Malseed
01/17/2020, 1:48 PMspand
01/17/2020, 1:49 PMspand
01/17/2020, 1:49 PMTim Malseed
01/17/2020, 1:50 PMTim Malseed
01/17/2020, 1:51 PMspand
01/17/2020, 1:51 PMTim Malseed
01/17/2020, 1:52 PMTim Malseed
01/17/2020, 1:52 PMspand
01/17/2020, 1:52 PMselectAll
just means no sql where clausespand
01/17/2020, 1:53 PMReports.id
Tim Malseed
01/17/2020, 1:54 PMspand
01/17/2020, 1:54 PMTim Malseed
01/17/2020, 1:58 PMTim Malseed
01/17/2020, 1:58 PMspand
01/17/2020, 2:03 PMTim Malseed
01/17/2020, 2:03 PMTim Malseed
01/17/2020, 2:05 PMTim Malseed
01/17/2020, 2:06 PMspand
01/17/2020, 2:06 PMTim Malseed
01/17/2020, 2:08 PMslice is sql select
Tim Malseed
01/17/2020, 2:08 PMTim Malseed
01/17/2020, 2:08 PMKevin Schmeichel
01/17/2020, 5:22 PMKevin Schmeichel
01/17/2020, 5:22 PMDico
01/18/2020, 11:24 AM