db
Property delegate that triggers auto-hydration from the database on first access. Use with AutoTable entities: properties delegated to db will lazily load the entity's data when read or written for the first time.
class User : AutoTable() {
var name: String by db("")
}Functions
Delegate read: on a library-constructed shadow reference, triggers AutoTable.hydrate to load the row before returning the in-memory value. On a user-constructed entity (or one already hydrated), returns the in-memory value directly with no DB access.
Delegate write: on a library-constructed shadow reference, runs AutoTable.hydrate first so that all other fields keep their database values, then stores the new value (so the just-written field wins). On a user-constructed entity (or one already hydrated), stores the value directly with no DB access.