Wednesday, January 20, 2016

SqlAlchemy notes


  1. Hybrid property/method : when invoked through an instance returns some value but for class based invocation returns sql.
  2. Alembic - for migrations
  3. Reflection - for loading table structure from DB
  4. SqlAlchemy Core - has sum/count/order by/group by etc sql equivalents.
  5. Session states for an object - Transient/Pending/Persistent/Detached
  6. session.expunge() for removing an object from session
  7. SqlAlchemy ORM is different from core
  8. (Core) ResultProxy - you can iterate through the resultset using indices or key/value both
  9. Association proxy : For e.g. many-to-many relationship in Cookie-Ingredient and you just want to create ingredients for a cookie or just want to fetch ingredients' names. With AP you can do it easily without looping through stuff.
  10. sqlacodegen - something about reflection 

No comments:

Blog Archive