32 lines
14 KiB
HTML
32 lines
14 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
|
"">
|
|
<html><head><meta charset="UTF-8" /><title>adl.to-psql documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-psql.html#var-compose-convenience-entity-field"><div class="inner"><span>compose-convenience-entity-field</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-compose-convenience-view-select-list"><div class="inner"><span>compose-convenience-view-select-list</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-compose-convenience-where-clause"><div class="inner"><span>compose-convenience-where-clause</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-construct-link-property"><div class="inner"><span>construct-link-property</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-application"><div class="inner"><span>emit-application</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-convenience-entity-field"><div class="inner"><span>emit-convenience-entity-field</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-convenience-view"><div class="inner"><span>emit-convenience-view</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-defined-field-type"><div class="inner"><span>emit-defined-field-type</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-entity-field-type"><div class="inner"><span>emit-entity-field-type</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-field-type"><div class="inner"><span>emit-field-type</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-file-header"><div class="inner"><span>emit-file-header</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-group-declaration"><div class="inner"><span>emit-group-declaration</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-link-field"><div class="inner"><span>emit-link-field</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-link-table"><div class="inner"><span>emit-link-table</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-link-tables"><div class="inner"><span>emit-link-tables</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-permissions-grant"><div class="inner"><span>emit-permissions-grant</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-property"><div class="inner"><span>emit-property</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-referential-integrity-link"><div class="inner"><span>emit-referential-integrity-link</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-referential-integrity-links"><div class="inner"><span>emit-referential-integrity-links</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-emit-table"><div class="inner"><span>emit-table</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-field-name"><div class="inner"><span>field-name</span></div></a></li><li class="depth-1"><a href="adl.to-psql.html#var-to-psql"><div class="inner"><span>to-psql</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-psql</h1><div class="doc"><pre class="plaintext">Application Description Language: generate Postgres database definition.
|
|
</pre></div><div class="public anchor" id="var-compose-convenience-entity-field"><h3>compose-convenience-entity-field</h3><div class="usage"><code>(compose-convenience-entity-field field entity application)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-compose-convenience-view-select-list"><h3>compose-convenience-view-select-list</h3><div class="usage"><code>(compose-convenience-view-select-list entity application top-level?)</code></div><div class="doc"><pre class="plaintext">Compose the body of an SQL `SELECT` statement for a convenience view of this
|
|
`entity` within this `application`, recursively. `top-level?` should be set
|
|
only on first invocation.</pre></div></div><div class="public anchor" id="var-compose-convenience-where-clause"><h3>compose-convenience-where-clause</h3><div class="usage"><code>(compose-convenience-where-clause entity application top-level?)</code></div><div class="doc"><pre class="plaintext">Compose an SQL `WHERE` clause for a convenience view of this
|
|
`entity` within this `application`.
|
|
TODO: does not correctly compose links at one stage down the tree.
|
|
See `lv_electors`, `lv_followuprequests` for examples of the problem.</pre></div></div><div class="public anchor" id="var-construct-link-property"><h3>construct-link-property</h3><div class="usage"><code>(construct-link-property entity)</code></div><div class="doc"><pre class="plaintext">Create a dummy property for a link-table referencing this `entity`, in order
|
|
that the field generation functions already defined may be applied to it.</pre></div></div><div class="public anchor" id="var-emit-application"><h3>emit-application</h3><div class="usage"><code>(emit-application application)</code></div><div class="doc"><pre class="plaintext">Emit all SQL declarations required to initialise a Postgres database for
|
|
this `application`.</pre></div></div><div class="public anchor" id="var-emit-convenience-entity-field"><h3>emit-convenience-entity-field</h3><div class="usage"><code>(emit-convenience-entity-field field entity application)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-emit-convenience-view"><h3>emit-convenience-view</h3><div class="usage"><code>(emit-convenience-view entity application)</code></div><div class="doc"><pre class="plaintext">Emit a convenience view of this `entity` of this `application` for use in generating lists,
|
|
menus, et cetera.</pre></div></div><div class="public anchor" id="var-emit-defined-field-type"><h3>emit-defined-field-type</h3><div class="usage"><code>(emit-defined-field-type property application)</code></div><div class="doc"><pre class="plaintext">Generate appropriate field type and constraints for this `property`
|
|
given this `typedef`.</pre></div></div><div class="public anchor" id="var-emit-entity-field-type"><h3>emit-entity-field-type</h3><div class="usage"><code>(emit-entity-field-type property application)</code></div><div class="doc"><pre class="plaintext">Emit an appropriate field type for this `property`, expected to reference an entity, in this `application`.
|
|
</pre></div></div><div class="public anchor" id="var-emit-field-type"><h3>emit-field-type</h3><div class="usage"><code>(emit-field-type property entity application key?)</code></div><div class="doc"><pre class="plaintext">Emit an appropriate field type for this `property`, expected to belong to
|
|
this `entity` within this `application`.</pre></div></div><div class="public anchor" id="var-emit-file-header"><h3>emit-file-header</h3><div class="usage"><code>(emit-file-header application)</code></div><div class="doc"><pre class="plaintext">Generate an appropriate file header for the Postgres initialisation script
|
|
for this `application`.</pre></div></div><div class="public anchor" id="var-emit-group-declaration"><h3>emit-group-declaration</h3><div class="usage"><code>(emit-group-declaration group application)</code></div><div class="doc"><pre class="plaintext">Emit a declaration for this authorisation `group` within this `application`.
|
|
</pre></div></div><div class="public anchor" id="var-emit-link-field"><h3>emit-link-field</h3><div class="usage"><code>(emit-link-field property entity application)</code></div><div class="doc"><pre class="plaintext">Emit an appropriate link field for this `property` of this `entity`
|
|
within this `application`.</pre></div></div><div class="public anchor" id="var-emit-link-table"><h3>emit-link-table</h3><div class="usage"><code>(emit-link-table property e1 application emitted-link-tables)</code></div><div class="doc"><pre class="plaintext">Emit a link table for the specified `property` of the entity `e1` within
|
|
this `application`, provided that such a table has not already been emitted
|
|
from the other end. The argument `emitted-link-tables` contains an atom
|
|
which references a set of the names of all those link tables which have
|
|
already been emitted, and this is modified in the execution of this function.</pre></div></div><div class="public anchor" id="var-emit-link-tables"><h3>emit-link-tables</h3><div class="usage"><code>(emit-link-tables entity application emitted-link-tables)</code><code>(emit-link-tables application emitted-link-tables)</code></div><div class="doc"><pre class="plaintext">Emit all required link tables for this `entity` within this `application`,
|
|
given these `emitted-link-tables` which have already been emitted.</pre></div></div><div class="public anchor" id="var-emit-permissions-grant"><h3>emit-permissions-grant</h3><div class="usage"><code>(emit-permissions-grant table-name privilege permissions)</code></div><div class="doc"><pre class="plaintext">Emit an appropriate grant of permissions on this `table-name` at this
|
|
`privilege` level given these `permissions`. `privilege` is expected
|
|
to be one of #{:SELECT :INSERT :UPDATE :DELETE}.
|
|
TODO: more thought needed here.</pre></div></div><div class="public anchor" id="var-emit-property"><h3>emit-property</h3><div class="usage"><code>(emit-property property entity application)</code><code>(emit-property property entity application key?)</code></div><div class="doc"><pre class="plaintext">Emit a field declaration representing this `property` of this `entity` within this `application`.
|
|
</pre></div></div><div class="public anchor" id="var-emit-referential-integrity-link"><h3>emit-referential-integrity-link</h3><div class="usage"><code>(emit-referential-integrity-link property nearside application)</code></div><div class="doc"><pre class="plaintext">Emit a referential integrity link for this `property` of the entity
|
|
`nearside` within this `application`.</pre></div></div><div class="public anchor" id="var-emit-referential-integrity-links"><h3>emit-referential-integrity-links</h3><div class="usage"><code>(emit-referential-integrity-links entity application)</code><code>(emit-referential-integrity-links application)</code></div><div class="doc"><pre class="plaintext">Emit all appropriate referential integrity links for this `entity`
|
|
within this `application`.</pre></div></div><div class="public anchor" id="var-emit-table"><h3>emit-table</h3><div class="usage"><code>(emit-table entity application doc-comment)</code><code>(emit-table entity application)</code></div><div class="doc"><pre class="plaintext">Emit a table declaration for this `entity` of this `application`,
|
|
documented with this `doc-comment` if specified.</pre></div></div><div class="public anchor" id="var-field-name"><h3>field-name</h3><div class="usage"><code>(field-name property)</code></div><div class="doc"><pre class="plaintext">Return the appropriate field name for this `property`.
|
|
TODO: really belongs in `adl-support.utils`.</pre></div></div><div class="public anchor" id="var-to-psql"><h3>to-psql</h3><div class="usage"><code>(to-psql application)</code></div><div class="doc"><pre class="plaintext">Generate a complete Postgres database initialisation script for this `application`.
|
|
</pre></div></div></div></body></html> |