python database / sql programming - where to start

前端 未结 9 2218
闹比i
闹比i 2021-02-02 03:25

What is the best way to use an embedded database, say sqlite in Python:

  1. Should be small footprint. I\'m only needing few thousands records per table. And just a ha
9条回答
  •  萌比男神i
    2021-02-02 04:08

    This is an aggregate of answers, in no particular order:

    Everybody is recommending an ORM layer. Which makes perfect sense, if you really need a database. Well, that was sort of requested in the title :-)

    1. SQLAlchemy
    2. Autumn
    3. Django ORM
    4. Use SQLite official support Pysqlite
    5. Storm
    6. Elixir
    7. Just use Python's own Pickle

    But I'm starting to think that if an in-memory database is sufficient, in this will be used in scripts only, not a web app or even a desktop gui, then option 7 is also perfectly valid, provided no transaction support is needed and "database" integrity is not an issue.

提交回复
热议问题