FunDB: Hybrid Row-and-Document Oriented datastore leveraging SQL/RDBMS database: SQLite, MySQL, MariaDB, Postgresql
Project description
FunDB
FunDB is Hybrid Row-and-Document Oriented datastore leveraging SQL/RDBMS database: SQLite, MySQL, MariaDB, Postgresql
FunDB is both RDMBS + Document Oriented together.
It supports, regular SQL query along with Document Oriented and Key Value store.
Engine:
- JSON
- SQLite
- Mariadb
- PostgreSQL
- MySQL
Install
pip install python-fundb
Usage
from fundb import fundb
# Open the db
# or in memory > fun = fundb()
fun = fundb("./my.db")
# Select a collection.
# Collection will be created automatically
# or explicitely > test = fun.select('test')
test = fun.test
# Get total entries
print(test.size)
# Insert an entry. It returns fundb#Document
entry = test.insert({
"name": "Fun",
"type": "DB",
"version": "1.0.0"
})
# Retrieve document by _id
_id = "9c5e5fbd05544700995c5fa3ca3ef214"
entry = test.get(_id)
# Access properties
entry.name # -> fun
entry.type # -> DB
entry.version # -> 1.0.0
# Update a field
entry.update(version="1.0.1")
# ...or
entry.update({"version": "1.0.1"})
#
entry.version # -> 1.0.1
# Delete entry
entry.delete()
# Search
results = test.find({"version:$gt": "1.0.0"})
for entry in results:
print(entry.name)
~ API ~
Database
fundb
#select
To select a collection in the database
fun = fundb()
users = fun.select("users")
## or
users = fun.users
#collections
List all the collections in the database
fun = fundb()
users = fun.select("users")
## or
users = fun.users
##D
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-fundb-0.0.12.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for python_fundb-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9466c825cceda745d5ec3fd8f22676b91ef94057ecb0dc3f317092abfad0307e |
|
MD5 | a3ba84211c4af6e4ac8f7148ff26c900 |
|
BLAKE2b-256 | c67102b07834df78f3cbb976dd4f8d9219d77c33b9504511f043457d842fbbb3 |