- Notifications
You must be signed in to change notification settings - Fork11
transaction support for TinyDB
License
eugene-eeo/tinyrecord
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TinyDB __ _ __ / /_(_)__ __ _________ _______ _______/ / / __/ / _ \/ // / __/ -_) __/ _ \/ __/ _ / \__/_/_//_/\_, /_/ \__/\__/\___/_/ \_,_/ /___/
Supported Pythons: 3.6+
Tinyrecord is a library which implements atomictransaction support for theTinyDB NoSQL database.It uses a record-first then execute architecture whichallows us to minimize the time that we are within athread lock. Usage example:
fromtinydbimportTinyDB,wherefromtinyrecordimporttransactiontable=TinyDB('db.json').table('table')withtransaction(table)astr:# insert a new recordtr.insert({'username':'john'})# update records matching a querytr.update({'invalid':True},where('username')=='john')# delete recordstr.remove(where('invalid')==True)# update using a functiontr.update(updater,where(...))# insert many itemstr.insert_multiple(documents)
Note that due to performance reasons you cannot viewthe data within a transaction unless you've committed.You will have to call operations on the transactionobject and not the database itself. Since tinyrecordworks with dictionaries and the latest API, it willonly support the latest version (4.x).
Installation is as simple aspip install tinyrecord.
About
transaction support for TinyDB
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.