k98kurz / sqloquent

Python 3+ SQL ORM system inspired by Eloquent
Other
1 stars 0 forks source link

Option for automatic loading relations on `__init__` #6

Closed k98kurz closed 1 month ago

k98kurz commented 1 month ago

Is your feature request related to a problem? Please describe.

Currently, when creating an instance of using get, find, or insert, the related models are not automatically loaded, and there is no option to enable this behavior. Instead, model.related().reload() has to be called before model.related can be used.

Describe the solution you'd like

There are two options:

Additional context

Eager loading would also be a helpful feature for use with databases other than sqlite3, but that would be a lot more work than just making things load automatically.

k98kurz commented 1 month ago

Done.