beverage / OpenAIDatabaseTests

A console app, and future hosted service, for the generation of French language quizzing problems based on language features. Also, my first time writing in Python beyond simple tooling scripts. It will back a mobile app I've already made if it ends up working out.
MIT License
0 stars 0 forks source link

🐞 Fix ORM model race condition #18

Open beverage opened 4 months ago

beverage commented 4 months ago

We are currently reflecting from tables created by SQL scripts on the first database loading and want to have SQLAlchemy reflect these tables at runtime instead of trying any DDL on them itself. The problem right now is, if the ORM objects are created in the documentation-recommended manner, the reflection is often not complete, and is not able to provide these classes at runtime.

We need a means to either delay, or lazily define these classes at some moment after table reflection.

AsyncClick maybe a contributing factor. Is it also possible that having a not-yet-referenced module holding the ORM classes could solve this too?

beverage commented 4 months ago

This seems to be mostly fixed, except some properties are still not reflected in the IDE. This may just be IDE problems, as the app works just fine despite that. It is now possible to directly reference the ORM objects with no issues like it used to be.