Open kevinresol opened 7 years ago
Static extensions should work ;)
But yeah, let's see what we can do.
Static extensions should work ;)
I wonder what is the type of the generated table? Is it tink.sql.Table<User>
?
Ok I figured it out:
class UserTableTools {
public static function get(table:Table<{user:User}>, id:Id<User>)
return table.where(user.id == id).first();
}
I found myself writing the same query such as
db.user.where(user.id == id).first()
again and again. I wonder if it is possible to extend the generated table and add methods likedb.user.get(id)