Skip to main content

Atomic transactions for TinyDB

Project description

TinyDB __  _                                   __
      / /_(_)__  __ _________ _______  _______/ /
     / __/ / _ \/ // / __/ -_) __/ _ \/ __/ _  /
     \__/_/_//_/\_, /_/  \__/\__/\___/_/  \_,_/
               /___/

Supported Pythons: 2.6+, 3.2+

Tinyrecord is a library which implements experimental atomic transaction support for the TinyDB NoSQL database. It uses a record-first then execute architecture which allows us to minimize the time that we are within a thread lock. Usage example:

from tinydb import TinyDB, where
from tinyrecord import transaction

table = TinyDB('db.json').table('table')
with transaction(table) as tr:
    tr.insert({})
    tr.update({'x': 'a'}, where('x') == 'z')
    tr.remove(where('x') == 'y')

Note that due to performance reasons you cannot view the data within a transaction unless you’ve comitted. You will have to call operations on the transaction object and not the database itself. Since tinyrecord works with dictionaries and the latest API, it will only support the dev version (2.0).

https://travis-ci.org/eugene-eeo/tinyrecord.svg?branch=master

Project details


Release history Release notifications

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
tinyrecord-0.1.0.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Sep 5, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page