a ORM model for AWS QLDB
Project description
makpar-innolab
qldb-orm
A simple Object-Relation-Mapping for a serverless AWS Quantum Ledger Database backend, and a command line utility for querying tables on those ledgers.
NOTE: The user or process using this library must have an IAM policy that allows access to QLDB.
ORM
The idea behind the ORM is to map document fields to native Python object attributes, so that document values can be accessed by traversing the object property tree.
CRUD OPERATIONS
from qldb_orm.qldb import Document
# Create a document on `my_table` table.
document = Document('my_table')
document.field = {
'nested_data': {
'array': ['colllection', 'of', 'things']
}
}
document.save()
from qldb_orm.qldb import Document
# Load a document from `my_table` table.
document = Document('my_table', id="123456")
for val in document.field.nested_data.array:
print(val)
Queries
from qldb_orm.qldb import Query
query = Query('my-table').find_by(field_name='field value')
for document in query:
print(f'Document({document.id}).field_name = {document.field_name}')
CLI
CRUD Operations
qldb-orm --table your-table --insert col1=val1 col2=val2 ...
qldb-orm --table your-table --id 123 --update col1=newval1 col2=newval2
Queries
qldb-orm --table your-table --find column=this
Read The Docs
Code Quality
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
qldb-orm-1.0.2.tar.gz
(25.5 kB
view details)
Built Distribution
qldb_orm-1.0.2-py3-none-any.whl
(26.5 kB
view details)
File details
Details for the file qldb-orm-1.0.2.tar.gz
.
File metadata
- Download URL: qldb-orm-1.0.2.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3382df95f899842309282a089e5d1760e60c6afffded27be7c0366865ef33fa8 |
|
MD5 | a336449170a271b0687173fbf7b9cbd4 |
|
BLAKE2b-256 | 91dcbb2f451e69daf0592b5210d8c0ded508ebfc9e96f52578e5dd9c30958fd3 |
File details
Details for the file qldb_orm-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: qldb_orm-1.0.2-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3a2a41563bf4f9fb93a7ae137f3b1f90c651f827a0cbc761a0bfa14cb8dc67f |
|
MD5 | cd2ed94abb2c5b91f2c0acefdfd6b340 |
|
BLAKE2b-256 | 9f975419451b168b336984a6db0d0aea0d193634402854097f59dd6e20b4ba9b |