I mean something like this:
fun operator Table.get(column_name: String) = this.column(column_name)
// Currently gives an error: "Expecting a top level declaration"
Table
instance currently works like: table.column("column_name")
I want to make it work like this: table["column_name"]
This is possible, it's just that the operator
keyword has go before the fun
keyword in the declaration (as do other modifiers, such as infix
, inline
, etc.):
operator fun Table.get(column_name: String) = this.column(column_name)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With