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

后端 未结 8 1849
广开言路
广开言路 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)
    
    0 讨论(0)
  • 2021-02-09 16:14

    What about using Elixir?

    0 讨论(0)
提交回复
热议问题