How do cursors work in Python's DB-API?

后端 未结 3 935
囚心锁ツ
囚心锁ツ 2020-12-28 13:48

I have been using python with RDBMS\' (MySQL and PostgreSQL), and I have noticed that I really do not understand how to use a cursor.

Usually, one have his script co

3条回答
  •  心在旅途
    2020-12-28 14:38

    Assuming you're using PostgreSQL, the cursors probably are just implemented using the database's native cursor API. You may want to look at the source code for pg8000, a pure Python PostgreSQL DB-API module, to see how it handles cursors. You might also like to look at the PostgreSQL documentation for cursors.

提交回复
热议问题