SQL Repositories
SQL Repositories#
There are two SQL related repositories in Red Bird:
redbird.repos.SQLRepo
: Built around object-relational mappingredbird.repos.SQLExprRepo
: Built around SQL expressions
Both of them relies on functionalities provided by
SQLAlchemy. In most cases redbird.repos.SQLExprRepo
is right
choice as often it is less error prone as it is simpler.
redbird.repos.SQLRepo
is useful if you need to
leverage more from SQLAlchemy’s ORM features.
They also differ in terms of how they do the connection:
redbird.repos.SQLRepo
: Relies onsqlalchemy.orm.Session
redbird.repos.SQLExprRepo
: Relies onsqlalchemy.engine.Engine