🐍 I tried SQLAlchemy, as well as CRUD without SQLAlchemy.
With SQLAlchemy, a 7 to 10 line code is converted to a 2 line code.
db.session.commit
db.session.commit()
I wonder why to have a long method of saving in the first place and then use a library to shorten it. Do you have an answer?
With SQLAlchemy, a 7 to 10 line code is converted to a 2 line code.
Saving to database is:
db.session.add(self)db.session.commit
Similarly delete is:
db.session.delete(self)db.session.commit()
Fetching data is a single line code:
ItemModel.query.all()I wonder why to have a long method of saving in the first place and then use a library to shorten it. Do you have an answer?
Comments
Post a Comment