python database / sql programming - where to start

前端 未结 9 2052
闹比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条回答
  •  日久生厌
    2021-02-02 04:21

    What you're looking for is SQLAlchemy, which is fast becoming the de facto standard Python data access layer. To make your first experiences with SQLAlchemy even easier, check out Elixir, which is a thin ActiveRecord-style wrapper around SQLAlchemy.

    Update: Reread the question and saw the bit about not needing a full ORM. I'd still suggest going the SQLAlchemy route, just because it gives you a ridiculously easy way to work with databases in Python that you can reuse for any kind of database. Time spent working directly with SQLite is wasted once you need to connect to Oracle or something.

提交回复
热议问题