I use SQLAlchemy at work, and it really works well. Now I'm thinking about best practices.
I am currently creating a module that contains all the SQLA materials:
my_model |__ __init__.py |__ _config.py <<<<< contains LOGIN, HOST, and a MetaData instance |__ table1.py <<<<< contains the class, the model and the mapper for table1 |__ table2.py <<<<< contains the class, the model and the mapper for table2 [...]
Now I really don't know if this is the best for this. I would like to load the fine-grained classes and be sure to create one connection with only db etc.
Here all classes are separated, but all are import _config and I wonder if this is good.
What more, I would like to be able to create subclasses of model classes that can be saved independently without messing with the cartographer every time. How can i do this?
For now, I just put them in the same file, and I need to create another mapper, but the first cartographer is still called every time. The same thing would happen if I had to import the parent class, because when I try to import the cartger starts. If I do not use the class to access data, do not overheat it every time?
I would also like to avoid using Elixir.
python orm sqlalchemy
e-satis
source share