Earlier quoted context omitted.
Even more advanced programmer: writing the ‘boilerplate’ queries out manually takes barely more time than composing them in an ORM, means less indirection, saves me a major dependency, and encourages me to think intelligently about each query no matter how boilerplate they might seem at the surface. Super-advanced programmer: allowing my database structure to be influenced by the needs of an off-the-shelf ORM will ma…
What ORM do people use that influences the structure of their database? The ORM I'm currently using the most can do whatever I need with my Postgres DB. Also, the ORM allows me to specify models that are not only used for structuring the database, but also for validation of incoming JSON requests and easily serialize queries back to JSON.
import json
data_from_json_request = json.loads(*request body*)
> easily serialize queries back to JSON import pymysql
import json
conn = pymysql.connect(*connection details*,
cursorclass = pymysql.cursors.DictCursor)
cur = conn.cursor()
cur.execute(*query*)
json_query_result = json.dumps(cur.fetchall())
I don't feel that a ORM is better than this personally. I know exactly what this is doing at all times. No magic, no guess work about the philosophy of the software. This is probably faster as well.