skip to navigation
skip to content

Not Logged In

tinyrecord 0.1.0

Atomic transactions for TinyDB

Latest Version: 0.1.2

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).

 
File Type Py Version Uploaded on Size
tinyrecord-0.1.0.tar.gz (md5) Source 2014-09-05 3KB
  • Downloads (All Versions):
  • 0 downloads in the last day
  • 34 downloads in the last week
  • 151 downloads in the last month