-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Grant Moore
committed
Mar 20, 2022
1 parent
23a3b36
commit 0b4dc2f
Showing
7 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
Metadata-Version: 2.1 | ||
Name: qldb-orm | ||
Version: 1.0.14 | ||
Summary: a ORM model for AWS QLDB | ||
Home-page: https://innolab-coverage.makpar-innovation.net | ||
Author: Makpar Innovation Lab | ||
Author-email: [email protected] | ||
License: GNU GPL v3 | ||
Project-URL: Documentation, https://makpar-innovation-laboratory.github.io/qldb-orm/ | ||
Project-URL: Source, https://github.com/Makpar-Innovation-Laboratory/qldb-orm | ||
Keywords: aws,qldb,quantum-ledger-database,orm | ||
Platform: any | ||
Requires-Python: >=3.8 | ||
Description-Content-Type: text/markdown | ||
License-File: LICENSE | ||
|
||
# makpar-innolab | ||
|
||
## qldb-orm | ||
|
||
A simple [Object-Relation-Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) for a serverless [AWS Quantum Ledger Database](https://docs.aws.amazon.com/qldb/latest/developerguide/what-is.html) 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](https://docs.aws.amazon.com/qldb/latest/developerguide/security-iam.html). | ||
|
||
|
||
### 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** | ||
|
||
```python | ||
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() | ||
``` | ||
|
||
```python | ||
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** | ||
```python | ||
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** | ||
```shell | ||
qldb-orm --table your-table --insert col1=val1 col2=val2 ... | ||
qldb-orm --table your-table --id 123 --update col1=newval1 col2=newval2 | ||
``` | ||
|
||
**Queries** | ||
```shell | ||
qldb-orm --table your-table --find column=this | ||
``` | ||
|
||
### Read The Docs | ||
|
||
- [innolqb documentation](https://makpar-innovation-laboratory.github.io/qldb-orm/) | ||
|
||
### Code Quality | ||
|
||
[](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm/?ref=repository-badge) | ||
[](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm/?ref=repository-badge) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|