Mathias Rørvik
11/23/2020, 2:21 PMfun getSymbolId(symbol: String): Int {
transaction {
Symbols.select { Symbols.symbol eq symbol }.toList().first()
}
}
Joel
11/23/2020, 9:12 PMSymbols.select { Symbols.symbol eq symbol }.first()
will be more efficient. .toList()
will pull all results into memory, whereas .first()
will limit 1.Mathias Rørvik
11/24/2020, 7:38 PM