The sample code for querying tables looks incorrect
Opened this issue · 6 comments
In the readme, there is
object Citizens : TableDefinition() {
val id = varchar("id", 10).primaryKey()
val name = varchar("name", length = 50)
val cityId = reference(Cities.id, "city_id").nullable()
}
...
val row = query(Citizens)
...
This won't compile - query
takes an argument of type QueryObject
and TableDefinition
doesn't inherit from that.
Looks like you'd have to use "from"
from(Citizens).select(Citizens.name, Citizens.id).where { Citizens.name eq "name" }
I'm looking at the benchmarks file: https://github.com/orangy/squash/blob/master/squash-benchmarks/src/org/jetbrains/squash/benchmarks/QueryBenchmark.kt
May be you need to import another package – there are few query
functions there, and that's something we should fix.
I'm not able to find correct query import. Would you please provide the correct import?
Just going through issues and it looks like this is already done. @orangy , anything else you'd like done in order to close this issue? I can certainly provide more examples and documentation now that I've found my way around if you like.