# Todo - move `prepare_*` methods from `dialect` to `query_compiler` - add `session_insert_builder` and `session_update_builder` (returning multiple statements) - finish fetch eager has-many/belongs-to relations - implement lazy loading - implement polymorphic class hierarchies - finish `schema_repository` classes (move add/drop from `session` to `schema`) - implement a flag class for enumerations __Proposal for polymorphic classes:__ object_ptr::as does the following checks; 1. The requested type has a super class 2. Super class has a discriminator column defined 3. Super class has a discriminator value defined 4. Discriminator value is mapped to the requested type If all checks succeed, the requested is fetched from the database. ```cpp schema.attach("payloads", make_polymorph("type")); schema.attach("id_list_payloads", make_polymorph_type("IdPayload")); schema.attach("id_payloads", make_polymorph_type("IdListPayload")); object::object_ptr payload; auto result = payload.as(); if (result.is_ok()) { const auto& is_payload = result.value(); // Use requested type id_payload->id = 1; } payload.is_polymorphic(); payload.is_polymorphic_type(); ```