Does the Python (Flask) SQL Alchemy uses both DAO and ORM design, or simply just ORM? I am learning design strategies and I thought of SQLAlchemy. Is it considered a DAO (clearly ORM) as well?
By default, it does not look like DAO.
What if I defined a class for an existing model class , for example given I have the following class:
class User(db.model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True, nullable=False)
verified= db.Column(db.String(5), unique=False, nullable=False)
I define another class, UserDao
class UserDao:
def addNewUser(user):
pass
def retrieveAllUsers(user):
users = User.query.limit(5).all()
And I instantitate and object of this UserDao class and call the respective methods to do some database operations through the respective method, does this make it a "DAO Pattern"?