Git Product home page Git Product logo

Comments (5)

njnes avatar njnes commented on July 20, 2024

which functions do you expect?

from monetdbe-python.

gijzelaerr avatar gijzelaerr commented on July 20, 2024

What are the options? the usual commit, rollback, start transaction?

from monetdbe-python.

njnes avatar njnes commented on July 20, 2024

from monetdbe-python.

 avatar commented on July 20, 2024

Recap from the documentation.
The Python/SQLite semantics are : auto-commit, deferred, immediate, exclusive.
The underlying SQLite library is based on auto-commit.autocommit mode means that statements that modify the database take effect immediately. A BEGIN or SAVEPOINT statement disables auto-commit mode, and a COMMIT, a ROLLBACK, or a RELEASE that ends the outermost transaction, turns auto-commit mode back on.
The Python sqlite3 module by default issues a BEGIN statement implicitly before a Data Modification Language (DML) statement (i.e. INSERT/UPDATE/DELETE/REPLACE).

You can control which kind of BEGIN statements sqlite3 implicitly executes via the isolation_level parameter to the connect() call, or via the isolation_level property of connections. If you specify no isolation_level, a plain BEGIN is used, which is equivalent to specifying DEFERRED. Other possible values are IMMEDIATE and EXCLUSIVE.

You can disable the sqlite3 module’s implicit transaction management by setting isolation_level to None. This will leave the underlying sqlite3 library operating in autocommit mode. You can then completely control the transaction state by explicitly issuing BEGIN, ROLLBACK, SAVEPOINT, and RELEASE statements in your code.

Proposed MonetDBe rules

  • all statements passed through execute() follow the auto-commit semantics
  • all statements passed executescript(), and executemany() are considered compound transactions, automatically wrapped with a BEGIN TRANSACTION and finalized with a COMMIT. We don;t check on mis-use (nested BEGIN) within the sequence.

from monetdbe-python.

gijzelaerr avatar gijzelaerr commented on July 20, 2024

The SQLite transactions test suite passes now

from monetdbe-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.