Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document sqlite3.connect() as implicitly opening transactions in the new PEP-249 manual commit mode #99824

Closed
Labels
@geryogam

Description

@geryogam

Documentation

Insqlite3,@malemburgspecified thatconnect(),commit(), androllback() implicitly open transactions in the newPEP-249 manual commit mode implemented in PR#93823:

If this is set to False, the module could then implement the
correct way of handling transactions, which means:

a) start a new transaction when the connection is opened
b) start a new transaction after .commit() and .rollback()
c) don't start new transactions anywhere else
d) run an implicit .rollback() when the connection closes

So I expect to see that information clearly documented.

Yet the PR documented it only forcommit() androllback() (item b), not forconnect() (item a):

* :mod:`!sqlite3` ensures that a transaction is always open,  so :meth:`Connection.commit` and :meth:`Connection.rollback`  will implicitly open a new transaction immediately after closing  the pending one.

To me it is important to document it also forconnect() rather than relying on user’s deduction, which is not obvious at all since for instance inlegacy manual commit mode,sqlite3 doesnot implicitly open transactions whenconnect() is called but whenexecute() is called on a DML statement.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp