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

transaction support for TinyDB

License

NotificationsYou must be signed in to change notification settings

eugene-eeo/tinyrecord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

Watchers

Forks

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp