26 lines
15 KiB
HTML
26 lines
15 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.7-SNAPSHOT</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-from-list"><div class="inner"><span>compose-convenience-view-from-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"><div class="markdown"><p>Application Description Language: generate Postgres database definition.</p>
|
|
</div></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><code>(compose-convenience-entity-field field entity application table-alias)</code></div><div class="doc"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
|
</div></div></div><div class="public anchor" id="var-compose-convenience-view-from-list"><h3>compose-convenience-view-from-list</h3><div class="usage"><code>(compose-convenience-view-from-list entity application top-level?)</code></div><div class="doc"><div class="markdown"><p>Compose the FROM list of an SQL <code>SELECT</code> statement for a convenience view of this <code>entity</code> within this <code>application</code>, recursively. <code>top-level?</code> should be set only on first invocation.</p>
|
|
</div></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"><div class="markdown"><p>Compose an SQL <code>WHERE</code> clause for a convenience view of this <code>entity</code> within this <code>application</code>. TODO: does not correctly compose links at one stage down the tree. See <code>lv_electors</code>, <code>lv_followuprequests</code> for examples of the problem.</p>
|
|
</div></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"><div class="markdown"><p>Create a dummy property for a link-table referencing this <code>entity</code>, in order that the field generation functions already defined may be applied to it.</p>
|
|
</div></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"><div class="markdown"><p>Emit all SQL declarations required to initialise a Postgres database for this <code>application</code>.</p>
|
|
</div></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 property entity application)</code><code>(emit-convenience-entity-field property entity application table-alias)</code></div><div class="doc"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
|
</div></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"><div class="markdown"><p>Emit a convenience view of this <code>entity</code> of this <code>application</code> for use in generating lists, menus, et cetera.</p>
|
|
</div></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"><div class="markdown"><p>Generate appropriate field type and constraints for this <code>property</code> given this <code>typedef</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit an appropriate field type for this <code>property</code>, expected to reference an entity, in this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit an appropriate field type for this <code>property</code>, expected to belong to this <code>entity</code> within this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Generate an appropriate file header for the Postgres initialisation script for this <code>application</code>.</p>
|
|
</div></div></div><div class="public anchor" id="var-emit-group-declaration"><h3>emit-group-declaration</h3><div class="usage"><code>(emit-group-declaration group)</code></div><div class="doc"><div class="markdown"><p>Emit a declaration for this authorisation <code>group</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit an appropriate link field for this <code>property</code> of this <code>entity</code> within this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit a link table for the specified <code>property</code> of the entity <code>e1</code> within this <code>application</code>, provided that such a table has not already been emitted from the other end. The argument <code>emitted-link-tables</code> 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.</p>
|
|
</div></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"><div class="markdown"><p>Emit all required link tables for this <code>entity</code> within this <code>application</code>, given these <code>emitted-link-tables</code> which have already been emitted.</p>
|
|
</div></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"><div class="markdown"><p>Emit an appropriate grant of permissions on this <code>table-name</code> at this <code>privilege</code> level given these <code>permissions</code>. <code>privilege</code> is expected to be one of #{:SELECT :INSERT :UPDATE :DELETE}. TODO: more thought needed here.</p>
|
|
</div></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"><div class="markdown"><p>Emit a field declaration representing this <code>property</code> of this <code>entity</code> within this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit a referential integrity link for this <code>property</code> of the entity <code>nearside</code> within this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit all appropriate referential integrity links for this <code>entity</code> within this <code>application</code>.</p>
|
|
</div></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"><div class="markdown"><p>Emit a table declaration for this <code>entity</code> of this <code>application</code>, documented with this <code>doc-comment</code> if specified.</p>
|
|
</div></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"><div class="markdown"><p>Return the appropriate field name for this <code>property</code>. TODO: really belongs in <code>adl-support.utils</code>.</p>
|
|
</div></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"><div class="markdown"><p>Generate a complete Postgres database initialisation script for this <code>application</code>.</p>
|
|
</div></div></div></div></body></html> |