Django Models / SQLAlchemy are bloated! Any truly Pythonic DB models out there?

后端 未结 8 1864
广开言路
广开言路 2021-02-09 15:16

\"Make things as simple as possible, but no simpler.\"

Can we find the solution/s that fix the Python database world?

Update: A

8条回答
  •  时光取名叫无心
    2021-02-09 16:05

    Forget ORM! I like vanilla SQL. The python wrappers like psycopg2 for postgreSQL do automatic type conversion, offer pretty good protection against SQL injection, and are nice and simple.

    sql = "SELECT * FROM table WHERE id=%s"
    data = (5,)
    cursor.execute(sql, data)
    

提交回复
热议问题