Skip to content

Commit

Permalink
generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Moore committed Feb 8, 2022
1 parent 00a0e50 commit d8a57ed
Show file tree
Hide file tree
Showing 40 changed files with 1,313 additions and 158 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ A simple [Object-Relation-Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93

### 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 innoldb.qldb import Document

document = Document('my-table')
# Create a document on `my_table` table.
document = Document('my_table')
document.field = {
'nested_data': {
'array': ['colllection', 'of', 'things']
Expand All @@ -23,6 +26,15 @@ document.field = {
document.save()
```

```python
from innoldb.qldb import Document

# Load a document from `my_table` table.
document = Document('my_table', id="123456")
for val in document.nested_data_array:
print(val)
```

**Queries**
```python
from innoldb.qldb import Query
Expand Down
Binary file modified docs/build/doctrees/INTRODUCTION.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/SETUP.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/TODOS.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/innoldb.doctree
Binary file not shown.
Binary file added docs/build/doctrees/innoldb.examples.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/innoldb.static.doctree
Binary file not shown.
11 changes: 9 additions & 2 deletions docs/build/html/CLI.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<li class="md-nav__item">


<a href="INTRODUCTION.html" class="md-nav__link">Makpar Innovation Lab</a>
<a href="INTRODUCTION.html" class="md-nav__link">makpar-innolab</a>


</li>
Expand Down Expand Up @@ -293,7 +293,14 @@
<li class="md-nav__item">


<a href="modules.html" class="md-nav__link">Modules</a>
<a href="modules.html" class="md-nav__link">innoldb</a>


</li>
<li class="md-nav__item">


<a href="TODOS.html" class="md-nav__link">Todos</a>


</li>
Expand Down
11 changes: 9 additions & 2 deletions docs/build/html/CONFIGURATION.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<li class="md-nav__item">


<a href="INTRODUCTION.html" class="md-nav__link">Makpar Innovation Lab</a>
<a href="INTRODUCTION.html" class="md-nav__link">makpar-innolab</a>


</li>
Expand Down Expand Up @@ -266,7 +266,14 @@
<li class="md-nav__item">


<a href="modules.html" class="md-nav__link">Modules</a>
<a href="modules.html" class="md-nav__link">innoldb</a>


</li>
<li class="md-nav__item">


<a href="TODOS.html" class="md-nav__link">Todos</a>


</li>
Expand Down
94 changes: 81 additions & 13 deletions docs/build/html/INTRODUCTION.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@



<title>Makpar Innovation Lab &#8212; innoldb v1.0.10 documentation</title>
<title>makpar-innolab &#8212; innoldb v1.0.10 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/material.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -94,7 +94,7 @@
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">Innovation Lab</span>
<span class="md-header-nav__topic"> Makpar Innovation Lab </span>
<span class="md-header-nav__topic"> makpar-innolab </span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
Expand Down Expand Up @@ -183,17 +183,25 @@


<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc"> Makpar Innovation Lab </label>
<label class="md-nav__link md-nav__link--active" for="__toc"> makpar-innolab </label>

<a href="#" class="md-nav__link md-nav__link--active">Makpar Innovation Lab</a>
<a href="#" class="md-nav__link md-nav__link--active">makpar-innolab</a>


<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Contents</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a href="#introduction--page-root" class="md-nav__link">Makpar Innovation Lab</a><nav class="md-nav">
<li class="md-nav__item"><a href="#introduction--page-root" class="md-nav__link">makpar-innolab</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#innoldb" class="md-nav__link">innoldb</a>
<li class="md-nav__item"><a href="#innoldb" class="md-nav__link">innoldb</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#orm" class="md-nav__link">ORM</a>
</li>
<li class="md-nav__item"><a href="#cli" class="md-nav__link">CLI</a>
</li>
<li class="md-nav__item"><a href="#code-quality" class="md-nav__link">Code Quality</a>
</li></ul>
</nav>
</li></ul>
</nav>
</li>
Expand Down Expand Up @@ -257,7 +265,14 @@
<li class="md-nav__item">


<a href="modules.html" class="md-nav__link">Modules</a>
<a href="modules.html" class="md-nav__link">innoldb</a>


</li>
<li class="md-nav__item">


<a href="TODOS.html" class="md-nav__link">Todos</a>


</li>
Expand All @@ -275,9 +290,17 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Contents</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a href="#introduction--page-root" class="md-nav__link">Makpar Innovation Lab</a><nav class="md-nav">
<li class="md-nav__item"><a href="#introduction--page-root" class="md-nav__link">makpar-innolab</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#innoldb" class="md-nav__link">innoldb</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#innoldb" class="md-nav__link">innoldb</a>
<li class="md-nav__item"><a href="#orm" class="md-nav__link">ORM</a>
</li>
<li class="md-nav__item"><a href="#cli" class="md-nav__link">CLI</a>
</li>
<li class="md-nav__item"><a href="#code-quality" class="md-nav__link">Code Quality</a>
</li></ul>
</nav>
</li></ul>
</nav>
</li>
Expand All @@ -295,19 +318,64 @@
<div class="md-content">
<article class="md-content__inner md-typeset" role="main">

<section class="tex2jax_ignore mathjax_ignore" id="makpar-innovation-lab">
<h1 id="introduction--page-root">Makpar Innovation Lab<a class="headerlink" href="#introduction--page-root" title="Permalink to this headline"></a></h1>
<section class="tex2jax_ignore mathjax_ignore" id="makpar-innolab">
<h1 id="introduction--page-root">makpar-innolab<a class="headerlink" href="#introduction--page-root" title="Permalink to this headline"></a></h1>
<section id="innoldb">
<h2 id="innoldb">innoldb<a class="headerlink" href="#innoldb" title="Permalink to this headline"></a></h2>
<p>A simple <a class="reference external" href="https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping">Object-Relation-Mapping</a> for a serverless <a class="reference external" href="https://docs.aws.amazon.com/qldb/latest/developerguide/what-is.html">AWS Quantum Ledger Database</a> backend, and a command line utility for querying tables on those ledgers.</p>
<p><strong>NOTE</strong>: The user or process using this library must have an <a class="reference external" href="https://docs.aws.amazon.com/qldb/latest/developerguide/security-iam.html">IAM policy that allows access to QLDB</a>.</p>
<section id="orm">
<h3 id="orm">ORM<a class="headerlink" href="#orm" title="Permalink to this headline"></a></h3>
<p>The idea behind the <em>ORM</em> is to map document fields to native Python object attributes, so that document values can be accessed by traversing the object property tree.</p>
<p><strong>CRUD OPERATIONS</strong></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">innoldb.qldb</span> <span class="kn">import</span> <span class="n">Document</span>

<span class="n">document</span> <span class="o">=</span> <span class="n">Document</span><span class="p">(</span><span class="s1">'my-table'</span><span class="p">)</span>
<span class="n">document</span><span class="o">.</span><span class="n">field</span> <span class="o">=</span> <span class="s1">'my field'</span>
<span class="c1"># Create a document on `my_table` table.</span>
<span class="n">document</span> <span class="o">=</span> <span class="n">Document</span><span class="p">(</span><span class="s1">'my_table'</span><span class="p">)</span>
<span class="n">document</span><span class="o">.</span><span class="n">field</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">'nested_data'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'array'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'colllection'</span><span class="p">,</span> <span class="s1">'of'</span><span class="p">,</span> <span class="s1">'things'</span><span class="p">]</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="n">document</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
</pre></div>
</div>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">innoldb.qldb</span> <span class="kn">import</span> <span class="n">Document</span>

<span class="c1"># Load a document from `my_table` table.</span>
<span class="n">document</span> <span class="o">=</span> <span class="n">Document</span><span class="p">(</span><span class="s1">'my_table'</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="s2">"123456"</span><span class="p">)</span>
<span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">document</span><span class="o">.</span><span class="n">nested_data_array</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Queries</strong></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">innoldb.qldb</span> <span class="kn">import</span> <span class="n">Query</span>

<span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s1">'my-table'</span><span class="p">)</span><span class="o">.</span><span class="n">find_by</span><span class="p">(</span><span class="n">field_name</span><span class="o">=</span><span class="s1">'field value'</span><span class="p">)</span>
<span class="k">for</span> <span class="n">document</span> <span class="ow">in</span> <span class="n">query</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">'Document(</span><span class="si">{</span><span class="n">document</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s1">).field_name = </span><span class="si">{</span><span class="n">document</span><span class="o">.</span><span class="n">field_name</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="cli">
<h3 id="cli">CLI<a class="headerlink" href="#cli" title="Permalink to this headline"></a></h3>
<p><strong>CRUD Operations</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>innoldb --table your-table --insert <span class="nv">col1</span><span class="o">=</span>val1 <span class="nv">col2</span><span class="o">=</span>val2 ...
innoldb --table your-table --id <span class="m">123</span> --update <span class="nv">col1</span><span class="o">=</span>newval1 <span class="nv">col2</span><span class="o">=</span>newval2
</pre></div>
</div>
<p><strong>Queries</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>innoldb --table your-table --find <span class="nv">column</span><span class="o">=</span>this
</pre></div>
</div>
</section>
<section id="code-quality">
<h3 id="code-quality">Code Quality<a class="headerlink" href="#code-quality" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p><a class="reference external" href="https://deepsource.io/gh/Makpar-Innovation-Laboratory/innoldb/?ref=repository-badge"><img alt="DeepSource" src="https://deepsource.io/gh/Makpar-Innovation-Laboratory/innoldb.svg/?label=active+issues&amp;show_trend=true&amp;token=0yUpU0SKBmqEg7qNHU2C65C6"/></a></p></li>
<li><p><a class="reference external" href="https://deepsource.io/gh/Makpar-Innovation-Laboratory/innoldb/?ref=repository-badge"><img alt="DeepSource" src="https://deepsource.io/gh/Makpar-Innovation-Laboratory/innoldb.svg/?label=resolved+issues&amp;show_trend=true&amp;token=0yUpU0SKBmqEg7qNHU2C65C6"/></a></p></li>
</ul>
</section>
</section>
</section>

Expand Down
11 changes: 9 additions & 2 deletions docs/build/html/MODELS.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<li class="md-nav__item">


<a href="INTRODUCTION.html" class="md-nav__link">Makpar Innovation Lab</a>
<a href="INTRODUCTION.html" class="md-nav__link">makpar-innolab</a>


</li>
Expand Down Expand Up @@ -306,7 +306,14 @@
<li class="md-nav__item">


<a href="modules.html" class="md-nav__link">Modules</a>
<a href="modules.html" class="md-nav__link">innoldb</a>


</li>
<li class="md-nav__item">


<a href="TODOS.html" class="md-nav__link">Todos</a>


</li>
Expand Down
17 changes: 12 additions & 5 deletions docs/build/html/REFERENCES.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Modules" href="modules.html" />
<link rel="next" title="innoldb" href="modules.html" />
<link rel="prev" title="Configuration" href="CONFIGURATION.html" />


Expand Down Expand Up @@ -182,7 +182,7 @@
<li class="md-nav__item">


<a href="INTRODUCTION.html" class="md-nav__link">Makpar Innovation Lab</a>
<a href="INTRODUCTION.html" class="md-nav__link">makpar-innolab</a>


</li>
Expand Down Expand Up @@ -243,7 +243,14 @@
<li class="md-nav__item">


<a href="modules.html" class="md-nav__link">Modules</a>
<a href="modules.html" class="md-nav__link">innoldb</a>


</li>
<li class="md-nav__item">


<a href="TODOS.html" class="md-nav__link">Todos</a>


</li>
Expand Down Expand Up @@ -308,12 +315,12 @@ <h1 id="references--page-root">References<a class="headerlink" href="#references
</a>


<a href="modules.html" title="Modules"
<a href="modules.html" title="innoldb"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> Modules </span>
class="md-footer-nav__direction"> Next </span> innoldb </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
Expand Down
Loading

0 comments on commit d8a57ed

Please sign in to comment.