On 14/09/2017 00:51, Cameron Simpson wrote:

Secondly, there's SQLAlchemy. It knows the dialects and asks you to write "native" looking python syntax for selects etc. So stuff like:

  db_conn.select(t.col1 == 9 and t.col2 == 10)

where "t" is a "table" object it has handed you. I believe these are just special objects with attributes for columns and the right __eq__ etc dunder methods to compute the correct SQL syntax. No escaping or param substitution in your own code. It also has an ORM, which I've not used.

Cheers,
Cameron Simpson <c...@cskk.id.au> (formerly c...@zip.com.au)

SQLAlchemy isn't the only Python ORM of course. There is a useful little article about ORMs and their availability here https://www.fullstackpython.com/object-relational-mappers-orms.html. A more detailed comparison is given here http://pythoncentral.io/sqlalchemy-vs-orms/ which refers to storm, which is only mentioned in passing in the first link. I've successfully used peewee, I can't really comment on the others.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

---
This email has been checked for viruses by AVG.
http://www.avg.com


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to