Subtables are here! You can now store data across muliple tables in one logical model!
python
import orm
class SubList(orm.Table["SubList"]):
"""Simple subtable for a list of strings"""
sub_list_id: int
main_table_id: int
data: str
class SubDict(orm.Table["SubDict"]):
"""Simple subtable for a dict of strings"""
sub_dict_id: int
main_table_id: int
key: str
value: str
orm.subtable("data", SubList)
orm.subtable("datadict", SubDict, "value", "key")
dataclasses.dataclass
class MainTable(orm.Table["MainTable"]):
"""A simple table with a list of SubList rows"""
main_table_id: int
data: List[str]
datadict: Dict[str, str]