-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamelinium.db.sql.html
149 lines (149 loc) · 70.5 KB
/
amelinium.db.sql.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.db.sql 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><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></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">Amelinium</span> <span class="project-version">1.0.1</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">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 current"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</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="amelinium.db.sql.html#var-braced-.3F"><div class="inner"><span>braced-?</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-braced-join-.3F"><div class="inner"><span>braced-join-?</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-braced-join-col-names"><div class="inner"><span>braced-join-col-names</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-braced-join-col-names-no-conv"><div class="inner"><span>braced-join-col-names-no-conv</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-build-query"><div class="inner"><span>build-query</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-build-query-dynamic"><div class="inner"><span>build-query-dynamic</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-col"><div class="inner"><span>col</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-col-kw"><div class="inner"><span>col-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-col-table"><div class="inner"><span>col-table</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-col-table-kw"><div class="inner"><span>col-table-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-colspec"><div class="inner"><span>colspec</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-colspec-kw"><div class="inner"><span>colspec-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-colspec-quoted"><div class="inner"><span>colspec-quoted</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-column"><div class="inner"><span>column</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-column-kw"><div class="inner"><span>column-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-column-table"><div class="inner"><span>column-table</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-column-table-kw"><div class="inner"><span>column-table-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-dbname"><div class="inner"><span>dbname</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-dbname-kw"><div class="inner"><span>dbname-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-dbname-quoted"><div class="inner"><span>dbname-quoted</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-delete.21"><div class="inner"><span>delete!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-find-by-keys"><div class="inner"><span>find-by-keys</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-for-insert-multi-or"><div class="inner"><span>for-insert-multi-or</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-for-insert-or"><div class="inner"><span>for-insert-or</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-for-replace"><div class="inner"><span>for-replace</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-for-replace-multi"><div class="inner"><span>for-replace-multi</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-get-failed.3F"><div class="inner"><span>get-failed?</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-groups-inverter"><div class="inner"><span>groups-inverter</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-id-from-db"><div class="inner"><span>id-from-db</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-id-to-db"><div class="inner"><span>id-to-db</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-idname"><div class="inner"><span>idname</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-idname-simple"><div class="inner"><span>idname-simple</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-multi-or.21"><div class="inner"><span>insert-multi-or!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-or.21"><div class="inner"><span>insert-or!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-or-ignore.21"><div class="inner"><span>insert-or-ignore!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-or-ignore-multi.21"><div class="inner"><span>insert-or-ignore-multi!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-or-replace.21"><div class="inner"><span>insert-or-replace!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-insert-or-replace-multi.21"><div class="inner"><span>insert-or-replace-multi!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-join-.3F"><div class="inner"><span>join-?</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-join-col-names"><div class="inner"><span>join-col-names</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-join-v.3D.3F"><div class="inner"><span>join-v=?</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-make-kw"><div class="inner"><span>make-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-make-kw-lisp"><div class="inner"><span>make-kw-lisp</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-make-kw-simple"><div class="inner"><span>make-kw-simple</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-make-kw-snake"><div class="inner"><span>make-kw-snake</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-query"><div class="inner"><span>query</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-quoted"><div class="inner"><span>quoted</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-replace.21"><div class="inner"><span>replace!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-replace-multi.21"><div class="inner"><span>replace-multi!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table"><div class="inner"><span>table</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table-col"><div class="inner"><span>table-col</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table-col-kw"><div class="inner"><span>table-col-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table-column"><div class="inner"><span>table-column</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table-column-kw"><div class="inner"><span>table-column-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-table-kw"><div class="inner"><span>table-kw</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-lisp"><div class="inner"><span>to-lisp</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-lisp-simple"><div class="inner"><span>to-lisp-simple</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-lisp-slashed"><div class="inner"><span>to-lisp-slashed</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-snake"><div class="inner"><span>to-snake</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-snake-simple"><div class="inner"><span>to-snake-simple</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-to-snake-slashed"><div class="inner"><span>to-snake-slashed</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-update.21"><div class="inner"><span>update!</span></div></a></li><li class="depth-1"><a href="amelinium.db.sql.html#var-values-.3F"><div class="inner"><span>values-?</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.db.sql</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>SQL helpers for Amelinium.</p>
</div></div><div class="public anchor" id="var-braced-.3F"><h3>braced-?</h3><div class="usage"><code>(braced-? coll)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-braced-join-.3F"><h3>braced-join-?</h3><div class="usage"><code>(braced-join-? ids)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-braced-join-col-names"><h3>braced-join-col-names</h3><div class="usage"><code>(braced-join-col-names cols)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-braced-join-col-names-no-conv"><h3>braced-join-col-names-no-conv</h3><div class="usage"><code>(braced-join-col-names-no-conv cols)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-build-query"><h3>build-query</h3><h4 class="type">macro</h4><div class="usage"><code>(build-query)</code><code>(build-query q)</code><code>(build-query q substitution-map)</code><code>(build-query coll)</code><code>(build-query & query-parts substitution-map)</code></div><div class="doc"><div class="markdown"><p>For the given SQL query <code>q</code> and substitution map performs pattern interpolation. If multiple arguments are given the last one will be treated as substitution map.</p>
<p>Tries to convert possible literals given as query parts to strings and then trim them while squeezing repeated spaces at compile time. If some operation cannot be performed in that phase, it generates code which will convert an expression to a string at runtime. Then pattern interpolation is performed on the resulting string, using the provided <code>substitutions</code> map.</p>
<p>If a source string contains <code>%{tag-name}</code> special pattern, <code>tag-name</code> will be looked up in substitution map and the whole pattern will be replaced by the corresponding value.</p>
<p>If a tag name from pattern cannot be found in a substitution map, the pattern will be replaced by an empty string.</p>
<p>A pattern may have a form of <code>%%{tag-name}</code>. In such case any non-<code>nil</code> value being a result of tag name resolution will be quoted using <code>amelinium.db.sql/quote</code>.</p>
<p>A synonym of <code>%%table{tag-name}</code> is <code>%[table-name]</code>. A synonym of <code>%%column{tag-name}</code> is <code>%(column-name)</code>. A synonym of <code>%%colspec{tag-name}</code> is <code>%<column-table-specification></code>.</p>
<p>A pattern may have additional modifier before the opening brace. It will be resolved as a symbolic function name to be called in order to transform a value associated with a tag name. If the name is not fully-qualified (does not contain a namespace part) its default namespace will be set to <code>amelinium.db.sql</code>.</p>
<p>There is a special pattern using <code>%SOME</code> tag: - <code>%SOME? variable:has-value#no-value</code> or - <code>%SOME? variable:has-value</code></p>
<p>It performs a substitution with <code>has-value</code> string if <code>variable</code> exists and is not <code>nil</code> and not <code>false</code>; otherwise it performs a substitution with <code>no-value</code> string or an empty string if the <code>no-value</code> was not given.</p>
<p>There is also an additional pattern <code>%'column-table-specification'</code> which is a quotation pattern. It uses <code>colspec-quoted</code> function on a given text.</p>
<p>Example:</p>
<pre><code>(build-query "select %%column{id} from %%table{users}"
"where" :points '> 100
{:id :users/id
:users :users/id})
</code></pre>
<p>The above call will generate the following result:</p>
<pre><code>"select `id` from `users` where points > 100"
</code></pre>
<p>This is synonymous to:</p>
<pre><code>(build-query "select %(id) from %[users]"
"where" :points '> 100
{:id :users/id
:users :users/id})
</code></pre>
<p>This macro can optionally be called with a single literal sequence given as its first and only argument. In such cache the sequence should contain all arguments, including a substitution map, if applicable.</p>
<p>This macro should NOT be used to dynamically generate queries having thousands of variant substitution parameters as it uses unlimited underlying cache. For such purposes please use <code>build-query-dynamic</code>, or simply utilize parameters of prepared statements.</p>
<p>WARNING: Interpolation pattern may execute arbitrary code since it allows for any function name.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L568">view source</a></div></div><div class="public anchor" id="var-build-query-dynamic"><h3>build-query-dynamic</h3><h4 class="type">macro</h4><div class="usage"><code>(build-query-dynamic)</code><code>(build-query-dynamic q)</code><code>(build-query-dynamic q substitution-map)</code><code>(build-query-dynamic coll)</code><code>(build-query-dynamic & query-parts substitution-map)</code></div><div class="doc"><div class="markdown"><p>For the given SQL query <code>q</code> and substitution map performs pattern interpolation. If multiple arguments are given the last one will be treated as substitution map.</p>
<p>Tries to convert possible literals given as query parts to strings and then trim them while squeezing repeated spaces at compile time. If some operation cannot be performed in that phase, it generates code which will convert an expression to a string at runtime. Then pattern interpolation is performed on the resulting string, using the provided <code>substitutions</code> map.</p>
<p>If a source string contains <code>%{tag-name}</code> special pattern, <code>tag-name</code> will be looked up in substitution map and the whole pattern will be replaced by the corresponding value.</p>
<p>If a tag name from pattern cannot be found in a substitution map, the pattern will be replaced by an empty string.</p>
<p>A pattern may have a form of <code>%%{tag-name}</code>. In such case any non-<code>nil</code> value being a result of tag name resolution will be quoted using <code>amelinium.db.sql/quote</code>.</p>
<p>A synonym of <code>%%table{tag-name}</code> is <code>%[table-name]</code>. A synonym of <code>%%column{tag-name}</code> is <code>%(column-name)</code>. A synonym of <code>%%colspec{tag-name}</code> is <code>%<column-table-specification></code>.</p>
<p>A pattern may have additional modifier before the opening brace. It will be resolved as a symbolic function name to be called in order to transform a value associated with a tag name. If the name is not fully-qualified (does not contain a namespace part) its default namespace will be set to <code>amelinium.db.sql</code>.</p>
<p>There is also additional pattern <code>%'column-table-specification'</code> which is a quotation pattern. It uses <code>colspec-quoted</code> function on a given text.</p>
<p>Example:</p>
<pre><code>(build-query-dynamic "select %%column{id} from %%table{users}"
"where" :points '> 100
{:id :users/id
:users :users/id})
</code></pre>
<p>The above call will generate the following result:</p>
<pre><code>"select `id` from `users` where points > 100"
</code></pre>
<p>This is synonymous to:</p>
<pre><code>(build-query-dynamic "select %%column{id} from %[users]"
"where" :points '> 100
{:users :users/id})
</code></pre>
<p>This macro can optionally be called with a single literal sequence given as its first and only argument. In such cache the sequence should contain all arguments, including a substitution map, if applicable.</p>
<p>This macro should be used to dynamically generate queries having thousands of variant substitution parameters.</p>
<p>WARNING: Interpolation pattern may execute arbitrary code since it allows for any function name.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L659">view source</a></div></div><div class="public anchor" id="var-col"><h3>col</h3><div class="usage"><code>(col col-spec)</code><code>(col _ col-spec)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>column</code>. Extracts column name as a snake-cased string from <code>col-spec</code> which may be an identifier or a string. If the identifier has a name, it will be used. For string, it will look for a slash or dot character used as a separator between a table and a column name, to extract the column name. If two arguments are given, the first one is ignored.</p>
<p>Example result: <code>"column_name"</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L300">view source</a></div></div><div class="public anchor" id="var-col-kw"><h3>col-kw</h3><div class="usage"><code>(col-kw col-spec)</code><code>(col-kw _ col-id)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>column-kw</code>. Extracts column name as a lisp-cased keyword from <code>col-spec</code> which may be an identifier or a string. If the identifier has a name, it will be used. For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and name to pick a column name. If two arguments are given, the first one is ignored.</p>
<p>Example result: <code>:column-name</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L422">view source</a></div></div><div class="public anchor" id="var-col-table"><h3>col-table</h3><div class="usage"><code>(col-table col-spec)</code><code>(col-table col-id col-spec)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>column-table</code>. Extracts column and table names from <code>col-spec</code> (which may be an identifier or a string) as snake-cased strings of a 2-element vector (first element being a column name, second a table name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a column name. If two arguments are given, names are extracted separately using <code>column</code> and <code>table</code> functions). If string is given (or an object convertable to a string), a dot or slash character will be used as a splitting point to extract table and column name. Single string without any separator character will be considered a table name.</p>
<p>Example results: <code>["column_name" "table_name"]</code>, <code>["column_name" nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L369">view source</a></div></div><div class="public anchor" id="var-col-table-kw"><h3>col-table-kw</h3><div class="usage"><code>(col-table-kw col-spec)</code><code>(col-table-kw col-id col-spec)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>column-table-kw</code>. Extracts column and table names from <code>col-spec</code> (which may be an identifier or a string) as lisp-cased keywords of a 2-element vector (first element being a column name, second a table name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a column name. If two arguments are given, names are extracted separately using <code>column-kw</code> and <code>table-kw</code> functions). For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and a name.</p>
<p>Example results: <code>[:column-name :table-name]</code>, <code>[:column-name nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L485">view source</a></div></div><div class="public anchor" id="var-colspec"><h3>colspec</h3><div class="usage"><code>(colspec col-spec)</code><code>(colspec table-id col-id)</code></div><div class="doc"><div class="markdown"><p>Converts a <code>table/column</code>-formatted identifier <code>col-spec</code> into a snake-cased string with first slash replaced by a dot character. If <code>table-id</code> and <code>col-id</code> are given, creates a string of those parts joined with a dot character. If single identifier is given, it uses its namespace and name.</p>
<p>Example results: <code>"table_name.column_name"</code> or <code>"simple_name"</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L187">view source</a></div></div><div class="public anchor" id="var-colspec-kw"><h3>colspec-kw</h3><div class="usage"><code>(colspec-kw col-spec)</code><code>(colspec-kw table-id col-id)</code></div><div class="doc"><div class="markdown"><p>Converts a <code>table/column</code> or <code>table.column</code>-formatted identifier <code>table-col</code> into a lisp-cased keyword. If <code>table-id</code> and <code>col-id</code> are given, it creates a string of those parts joined with a dot character. If identifier is given, it uses its namespace and name.</p>
<p>For strings and objects convertable to a string, first slash or dot character will be used as a split point. If the <code>col-spec</code> is a string and there is a slash character present in it, it will not be checked for a dot character presence.</p>
<p>Example results: <code>:table-name/column-name</code> or <code>:simple-name</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L234">view source</a></div></div><div class="public anchor" id="var-colspec-quoted"><h3>colspec-quoted</h3><div class="usage"><code>(colspec-quoted col-spec)</code><code>(colspec-quoted table-id col-id)</code></div><div class="doc"><div class="markdown"><p>Converts a <code>table/column</code>-formatted identifier <code>col-spec</code> into a snake-cased string with first slash replaced by a dot character. If <code>table-id</code> and <code>col-id</code> are given, creates a string of those parts joined with a dot character. If identifier is given, it uses its namespace and name. Each part of the name will be quoted.</p>
<p>If the <code>col-spec</code> is a string and there is a slash character present in it, it will not be checked for a dot character presence.</p>
<p>Example results: <code>"`table_name`.`column_name`"</code> or <code>"`simple_name`"</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L207">view source</a></div></div><div class="public anchor" id="var-column"><h3>column</h3><div class="usage"><code>(column col-spec)</code><code>(column _ col-spec)</code></div><div class="doc"><div class="markdown"><p>Extracts column name as a snake-cased string from <code>col-spec</code> which may be an identifier or a string. If the identifier has a name and a namespace, its name will be used. For string, it will look for a slash or dot character used as a separator between a table and a column name, to extract the column name. If two arguments are given, the first one is ignored.</p>
<p>Example result: <code>"column_name"</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L281">view source</a></div></div><div class="public anchor" id="var-column-kw"><h3>column-kw</h3><div class="usage"><code>(column-kw col-spec)</code><code>(column-kw _ col-id)</code></div><div class="doc"><div class="markdown"><p>Extracts column name as a lisp-cased keyword from <code>col-spec</code> which may be an identifier or a string. If the identifier has a name, it will be used. For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and name to pick a column name. If two arguments are given, the first one is ignored.</p>
<p>Example result: <code>:column-name</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L403">view source</a></div></div><div class="public anchor" id="var-column-table"><h3>column-table</h3><div class="usage"><code>(column-table col-spec)</code><code>(column-table col-id col-spec)</code></div><div class="doc"><div class="markdown"><p>Extracts column and table names from <code>col-spec</code> (which may be an identifier or a string) as snake-cased strings of a 2-element vector (first element being a column name, second a table name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a column name. If two arguments are given, names are extracted separately using <code>column</code> and <code>table</code> functions). If string is given (or an object convertable to a string), a dot or slash character will be used as a splitting point to extract table and column name. Single string without any separator character will be considered a table name.</p>
<p>Example results: <code>["column_name" "table_name"]</code>, <code>["column_name" nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L349">view source</a></div></div><div class="public anchor" id="var-column-table-kw"><h3>column-table-kw</h3><div class="usage"><code>(column-table-kw col-spec)</code><code>(column-table-kw col-id col-spec)</code></div><div class="doc"><div class="markdown"><p>Extracts column and table names from <code>col-spec</code> (which may be an identifier or a string) as lisp-cased keywords of a 2-element vector (first element being a column name, second a table name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a column name. If two arguments are given, names are extracted separately using <code>column-kw</code> and <code>table-kw</code> functions). For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and a name.</p>
<p>Example results: <code>[:column-name :table-name]</code>, <code>[:column-name nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L468">view source</a></div></div><div class="public anchor" id="var-dbname"><h3>dbname</h3><div class="usage"><code>(dbname v)</code></div><div class="doc"><div class="markdown"><p>If the given value <code>v</code> is an ident, it returns its (optional) namespace and name joined with a dot character. Otherwise it returns a string representation of the given object with a first slash replaced by a dot.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L89">view source</a></div></div><div class="public anchor" id="var-dbname-kw"><h3>dbname-kw</h3><div class="usage"><code>(dbname-kw v)</code></div><div class="doc"><div class="markdown"><p>If the given value <code>v</code> is an ident, it returns its keyword representation. Otherwise it returns a string representation of the given object with dots replaced by slashes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L118">view source</a></div></div><div class="public anchor" id="var-dbname-quoted"><h3>dbname-quoted</h3><div class="usage"><code>(dbname-quoted v)</code></div><div class="doc"><div class="markdown"><p>If the given value <code>v</code> is an ident, it returns its (optional) namespace and name joined with a dot character. Otherwise it returns a string representation of the given object with a first slash replaced by a dot. Each part of a name will be quoted.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L101">view source</a></div></div><div class="public anchor" id="var-delete.21"><h3>delete!</h3><div class="usage"><code>(delete! connectable table where-params)</code><code>(delete! connectable table where-params opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make certain common deletes easier.</p>
<p>Given a connectable object, a table name, and either a hash map of columns and values to search on or a vector of a SQL where clause and parameters, perform a delete on the table.</p>
</div></div></div><div class="public anchor" id="var-find-by-keys"><h3>find-by-keys</h3><div class="usage"><code>(find-by-keys connectable table key-map)</code><code>(find-by-keys connectable table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to make certain common queries easier.</p>
<p>Given a connectable object, a table name, and either a hash map of columns and values to search on or a vector of a SQL where clause and parameters, returns a vector of hash maps of rows that match.</p>
<p>If <code>:all</code> is passed instead of a hash map or vector – the query will select all rows in the table, subject to any pagination options below.</p>
<p>If <code>:columns</code> is passed, only that specified subset of columns will be returned in each row (otherwise all columns are selected).</p>
<p>If the <code>:order-by</code> option is present, add an <code>ORDER BY</code> clause. <code>:order-by</code> should be a vector of column names or pairs of column name / direction, which can be <code>:asc</code> or <code>:desc</code>.</p>
<p>If the <code>:top</code> option is present, the SQL Server <code>SELECT TOP ?</code> syntax is used and the value of the option is inserted as an additional parameter.</p>
<p>If the <code>:limit</code> option is present, the MySQL <code>LIMIT ? OFFSET ?</code> syntax is used (using the <code>:offset</code> option if present, else <code>OFFSET ?</code> is omitted). PostgreSQL also supports this syntax.</p>
<p>If the <code>:offset</code> option is present (without <code>:limit</code>), the standard <code>OFFSET ? ROWS FETCH NEXT ? ROWS ONLY</code> syntax is used (using the <code>:fetch</code> option if present, else <code>FETCH...</code> is omitted).</p>
</div></div></div><div class="public anchor" id="var-for-insert-multi-or"><h3>for-insert-multi-or</h3><div class="usage"><code>(for-insert-multi-or table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Given a table name, a vector of column names, and a vector of row values (each row is a vector of its values), return a vector of the full <code>INSERT</code> SQL string and its parameters. Applies any <code>:table-fn</code> / <code>:column-fn</code> supplied in the options. If <code>:suffix</code> is provided in <code>opts</code>, that string is appended to the <code>INSERT IGNORE ...</code> statement. The <code>IGNORE</code> part can be replaced by supplying :alt-clause option key.</p>
</div></div></div><div class="public anchor" id="var-for-insert-or"><h3>for-insert-or</h3><div class="usage"><code>(for-insert-or table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Given a table name and a hash map of column names and their values, return a vector of the full <code>INSERT OR IGNORE</code> SQL string and its parameters. Applies any <code>:table-fn</code> / <code>:column-fn</code> supplied in the options. If <code>:suffix</code> is provided in <code>opts</code>, that string is appended to the <code>INSERT ...</code> statement. If <code>:alt-clause</code> is provided in <code>opts</code>, it will replace the default IGNORE string.</p>
</div></div></div><div class="public anchor" id="var-for-replace"><h3>for-replace</h3><div class="usage"><code>(for-replace table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Given a table name and a hash map of column names and their values, return a vector of the full <code>REPLACE</code> SQL string and its parameters. Applies any <code>:table-fn</code> / <code>:column-fn</code> supplied in the options. If <code>:suffix</code> is provided in <code>opts</code>, that string is appended to the <code>INSERT ...</code> statement.</p>
</div></div></div><div class="public anchor" id="var-for-replace-multi"><h3>for-replace-multi</h3><div class="usage"><code>(for-replace-multi table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Given a table name, a vector of column names, and a vector of row values (each row is a vector of its values), return a vector of the full <code>REPLACE</code> SQL string and its parameters. Applies any <code>:table-fn</code> / <code>:column-fn</code> supplied in the options. If <code>:suffix</code> is provided in <code>opts</code>, that string is appended to the <code>REPLACE ...</code> statement.</p>
</div></div></div><div class="public anchor" id="var-get-failed.3F"><h3>get-failed?</h3><div class="usage"><code>(get-failed? v)</code></div><div class="doc"><div class="markdown"><p>Returns true if getting from a database failed in post-processing phase (e.g. de-serialization) and the data were broken.</p>
</div></div></div><div class="public anchor" id="var-groups-inverter"><h3>groups-inverter</h3><div class="usage"><code>(groups-inverter f)</code><code>(groups-inverter f a)</code><code>(groups-inverter f a b)</code><code>(groups-inverter f a b c)</code><code>(groups-inverter f a b c & more)</code></div><div class="doc"><div class="markdown"><p>Helper function for transforming a map of sequences keyed with keywords into a map of elements found in those sequences (as keys) associated with results of calling a function on them with additional arguments, including original map’s keys.</p>
<p>In other words: transforms results of <code>clojure.core/group-by</code> into a single map, changing values found in sequences into keys, and associating values to those keys resulting from calling a function.</p>
<p>Takes a function <code>f</code> and additional arguments (zero or more), and returns a function which takes a map <code>m</code>, identity type <code>id-type</code> and a sequence of identifiers <code>ids</code>, and calls <code>f</code> with all arguments and <code>id-type</code> passed on the sequence. Then it calls <code>clojure.core/into</code> to put the result of calling <code>f</code> into a map <code>m</code>.</p>
<p>Example: <code>(groups-inverter get-ids db)</code></p>
<p>In this example a function will be returned, similar to the below:</p>
<p><code>(fn [m id-type ids] (into m (get-ids db id-type)))</code>.</p>
<p>It is used mainly as a transformer in <code>reduce-kv</code> when dealing with multiple user identifiers grouped by identity type. Having a map of vectors grouped by identity type:</p>
<pre><code>{:email [#amelinium.Identity {:id-type :email :value "[email protected]"}],
:id [#amelinium.Identity {:id-type :id :value 1}
#amelinium.Identity {:id-type :id, :value 42}]}
</code></pre>
<p>we can call <code>(reduce-kv (groups-inverter get-ids db) {})</code> to get:</p>
<pre><code>{#amelinium.Identity{:id-type :id, :value 1} 1
#amelinium.Identity{:id-type :id, :value 42} 42
#amelinium.Identity{:id-type :email, :value "[email protected]"} 1}
</code></pre>
<p>The <code>get-ids</code> will be called for each identity group, receiving a list of identities and passed arguments with identity type. After getting numerical user identifiers it will associate them with identity objects in a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L741">view source</a></div></div><div class="public anchor" id="var-id-from-db"><h3>id-from-db</h3><div class="usage"><code>(id-from-db v)</code></div><div class="doc"><div class="markdown"><p>Converts the given ID retrieved from a database to a value suitable to be used in Clojure programs. If <code>v</code> is a number or a keyword, it is returned as is. Otherwise it is converted to a keyword.</p>
</div></div></div><div class="public anchor" id="var-id-to-db"><h3>id-to-db</h3><div class="usage"><code>(id-to-db v)</code></div><div class="doc"><div class="markdown"><p>Converts the given ID to a value suitable to be stored in a database. If <code>v</code> is a number, it is passed as is. Otherwise it is converted to a string.</p>
</div></div></div><div class="public anchor" id="var-idname"><h3>idname</h3><div class="usage"><code>(idname v)</code></div><div class="doc"><div class="markdown"><p>If the given value <code>v</code> is an ident, it returns its (optional) namespace and name joined with a dot character. Otherwise it returns the string representation of the given object with slashes replaced by dot characters.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L71">view source</a></div></div><div class="public anchor" id="var-idname-simple"><h3>idname-simple</h3><div class="usage"><code>(idname-simple v)</code></div><div class="doc"><div class="markdown"><p>If the given value <code>v</code> is an ident, it returns its name. Otherwise it returns the string representation of the given object or <code>nil</code> if the string is empty.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L83">view source</a></div></div><div class="public anchor" id="var-insert-multi-or.21"><h3>insert-multi-or!</h3><div class="usage"><code>(insert-multi-or! connectable table cols rows)</code><code>(insert-multi-or! connectable table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to make inserting columns/rows easier. Same as insert-or! but supports multiple rows to be inserted at once.</p>
</div></div></div><div class="public anchor" id="var-insert-or.21"><h3>insert-or!</h3><div class="usage"><code>(insert-or! connectable table key-map)</code><code>(insert-or! connectable table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make inserting hash maps easier. Given a connectable object, a table name, and a data hash map, inserts the data as a single row in the database and attempts to return a map of generated keys. By default it uses <code>INSERT OR IGNORE</code> but the <code>IGNORE</code> can be changed to anything by supplying :alt-clause option in opts map.</p>
</div></div></div><div class="public anchor" id="var-insert-or-ignore.21"><h3>insert-or-ignore!</h3><div class="usage"><code>(insert-or-ignore! connectable table key-map)</code><code>(insert-or-ignore! connectable table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make inserting hash maps easier. Given a connectable object, a table name, and a data hash map, inserts the data as a single row in the database and attempts to return a map of generated keys.</p>
</div></div></div><div class="public anchor" id="var-insert-or-ignore-multi.21"><h3>insert-or-ignore-multi!</h3><div class="usage"><code>(insert-or-ignore-multi! connectable table cols rows)</code><code>(insert-or-ignore-multi! connectable table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to make inserting columns/rows easier. Same as insert-multi! but supports :alt-clause option key.</p>
</div></div></div><div class="public anchor" id="var-insert-or-replace.21"><h3>insert-or-replace!</h3><div class="usage"><code>(insert-or-replace! connectable table key-map)</code><code>(insert-or-replace! connectable table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make inserting hash maps easier. Given a connectable object, a table name, and a data hash map, inserts the data as a single row in the database and attempts to return a map of generated keys.</p>
</div></div></div><div class="public anchor" id="var-insert-or-replace-multi.21"><h3>insert-or-replace-multi!</h3><div class="usage"><code>(insert-or-replace-multi! connectable table cols rows)</code><code>(insert-or-replace-multi! connectable table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to make inserting columns/rows easier. Same as insert-multi! but supports :alt-clause option key.</p>
</div></div></div><div class="public anchor" id="var-join-.3F"><h3>join-?</h3><div class="usage"><code>(join-? ids)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-join-col-names"><h3>join-col-names</h3><div class="usage"><code>(join-col-names cols)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-join-v.3D.3F"><h3>join-v=?</h3><div class="usage"><code>(join-v=? ids)</code></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-make-kw"><h3>make-kw</h3><div class="usage"><code>(make-kw name)</code><code>(make-kw ns name)</code></div><div class="doc"><div class="markdown"><p>Creates a keyword with the given name and namespace which both can be expressed as strings or idents. If the second argument is <code>nil</code> then a keyword is created using the first argument by simply converting it with the <code>keyword</code> function. If both <code>ns</code> and <code>name</code> are given then the following is applied: if <code>ns</code> or <code>name</code> is a qualified ident, its name and namespace will be joined with a dot character before producing a keyword; additionally, if <code>ns</code> or <code>name</code> is a simple ident, any slash character in its name will be replaced with a dot. If <code>ns</code> or <code>name</code> is not an ident then any slash character in its string representation will be replaced with a dot before creating a keyword.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L130">view source</a></div></div><div class="public anchor" id="var-make-kw-lisp"><h3>make-kw-lisp</h3><div class="usage"><code>(make-kw-lisp name)</code><code>(make-kw-lisp ns name)</code></div><div class="doc"><div class="markdown"><p>Creates a keyword with the given name and namespace which both can be expressed as strings or idents. All underscore characters will be replaced by hyphens. If the second argument is <code>nil</code> then a keyword is created using the first argument by simply converting it with the <code>keyword</code> function. If any given ident is namespaced, only its name is used.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L172">view source</a></div></div><div class="public anchor" id="var-make-kw-simple"><h3>make-kw-simple</h3><div class="usage"><code>(make-kw-simple name)</code><code>(make-kw-simple ns name)</code></div><div class="doc"><div class="markdown"><p>Creates a keyword with the given name and namespace which both can be expressed as strings or idents. If the second argument is <code>nil</code> then a keyword is created using the first argument by simply converting it with the <code>keyword</code> function. If any given ident is namespaced, only its name is used.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L147">view source</a></div></div><div class="public anchor" id="var-make-kw-snake"><h3>make-kw-snake</h3><div class="usage"><code>(make-kw-snake name)</code><code>(make-kw-snake ns name)</code></div><div class="doc"><div class="markdown"><p>Creates a keyword with the given name and namespace which both can be expressed as strings or idents. All hyphen characters will be replaced by underscores. If the second argument is <code>nil</code> then a keyword is created using the first argument by simply converting it with the <code>keyword</code> function. If any given ident is namespaced, only its name is used.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L159">view source</a></div></div><div class="public anchor" id="var-query"><h3>query</h3><div class="usage"><code>(query connectable sql-params)</code><code>(query connectable sql-params opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to provide a query alias.</p>
<p>Given a connectable object, and a vector of SQL and its parameters, returns a vector of hash maps of rows that match.</p>
</div></div></div><div class="public anchor" id="var-quoted"><h3>quoted</h3><div class="usage"><code>(quoted s)</code></div><div class="doc"><div class="markdown"><p>Quotes the given string according to MySQL / MariaDB quoting rules.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L65">view source</a></div></div><div class="public anchor" id="var-replace.21"><h3>replace!</h3><div class="usage"><code>(replace! connectable table key-map)</code><code>(replace! connectable table key-map opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make inserting hash maps easier. Given a connectable object, a table name, and a data hash map, inserts the data as a single row in the database and attempts to return a map of generated keys. By default it uses <code>REPLACE</code>.</p>
</div></div></div><div class="public anchor" id="var-replace-multi.21"><h3>replace-multi!</h3><div class="usage"><code>(replace-multi! connectable table cols rows)</code><code>(replace-multi! connectable table cols rows opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute!</code> to make inserting columns/rows easier. Same as replace! but supports multiple rows to be inserted at once.</p>
</div></div></div><div class="public anchor" id="var-table"><h3>table</h3><div class="usage"><code>(table col-spec)</code><code>(table col-spec _)</code></div><div class="doc"><div class="markdown"><p>Extracts table name as a snake-cased string from <code>col-spec</code> which may be an identifier or a string. If the identifier has a namespace, it will be used, otherwise its name will be used. For string, it will look for a slash or dot character used as a separator between a table and a column name, to extract the table name. If two arguments are given, the second one is ignored.</p>
<p>Example result: <code>"table_name"</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L262">view source</a></div></div><div class="public anchor" id="var-table-col"><h3>table-col</h3><div class="usage"><code>(table-col col-spec)</code><code>(table-col col-spec col-id)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>table-column</code>. Extracts table and column names from <code>col-spec</code> (which may be an identifier or a string) as snake-cased strings of a 2-element vector (first element being a table name, second a column name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a table name. If two arguments are given, names are extracted separately using <code>table</code> and <code>column</code> functions). If string is given (or an object convertable to a string), a dot or slash character will be used as a splitting point to extract table and column name. Single string without any separator character will be considered a table name.</p>
<p>Example results: <code>["table_name" "column_name"]</code>, <code>["table_name" nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L334">view source</a></div></div><div class="public anchor" id="var-table-col-kw"><h3>table-col-kw</h3><div class="usage"><code>(table-col-kw col-id)</code><code>(table-col-kw col-spec col-id)</code></div><div class="doc"><div class="markdown"><p>Alias for <code>table-column-kw</code>. Extracts table and column names from <code>col-spec</code> (which may be an identifier or a string) as lisp-cased keywords of a 2-element vector (first element being a table name, second a column name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a table name. If two arguments are given, names are extracted separately using <code>table-kw</code> and <code>column-kw</code> functions). For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and a name.</p>
<p>Example results: <code>[:table-name :column-name]</code>, <code>[:table-name nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L453">view source</a></div></div><div class="public anchor" id="var-table-column"><h3>table-column</h3><div class="usage"><code>(table-column col-spec)</code><code>(table-column col-spec col-id)</code></div><div class="doc"><div class="markdown"><p>Extracts table and column names from <code>col-spec</code> (which may be an identifier or a string) as snake-cased strings of a 2-element vector (first element being a table name, second a column name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a table name. If two arguments are given, names are extracted separately using <code>table</code> and <code>column</code> functions). If string is given (or an object convertable to a string), a dot or slash character will be used as a splitting point to extract table and column name. Single string without any separator character will be considered a table name.</p>
<p>Example results: <code>["table_name" "column_name"]</code>, <code>["table_name" nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L312">view source</a></div></div><div class="public anchor" id="var-table-column-kw"><h3>table-column-kw</h3><div class="usage"><code>(table-column-kw col-spec)</code><code>(table-column-kw col-spec col-id)</code></div><div class="doc"><div class="markdown"><p>Extracts table and column names from <code>col-spec</code> (which may be an identifier or a string) as lisp-cased keywords of a 2-element vector (first element being a table name, second a column name). If <code>col-spec</code> is an identifier, its namespace and name will be used. If there is no namespace, it will be considered a table name. If two arguments are given, names are extracted separately using <code>table-kw</code> and <code>column-kw</code> functions). For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and a name.</p>
<p>Example results: <code>[:table-name :column-name]</code>, <code>[:table-name nil]</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L434">view source</a></div></div><div class="public anchor" id="var-table-kw"><h3>table-kw</h3><div class="usage"><code>(table-kw col-spec)</code><code>(table-kw table-id _)</code></div><div class="doc"><div class="markdown"><p>Extracts table name as a lisp-cased keyword from <code>col-spec</code> which may be an identifier or a string. If the identifier has a namespace, it will be used, otherwise its name will be used. For strings (or objects convertable to strings), it will detect slash and dot characters as separators of a namespace and name to pick a table name. If two arguments are given, the second one is ignored.</p>
<p>Example result: <code>:table-name</code></p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/db/sql.clj#L384">view source</a></div></div><div class="public anchor" id="var-to-lisp"><h3>to-lisp</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-to-lisp-simple"><h3>to-lisp-simple</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-to-lisp-slashed"><h3>to-lisp-slashed</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-to-snake"><h3>to-snake</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-to-snake-simple"><h3>to-snake-simple</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-to-snake-slashed"><h3>to-snake-slashed</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div></div><div class="public anchor" id="var-update.21"><h3>update!</h3><div class="usage"><code>(update! connectable table key-map where-params)</code><code>(update! connectable table key-map where-params opts)</code></div><div class="doc"><div class="markdown"><p>Syntactic sugar over <code>execute-one!</code> to make certain common updates easier.</p>
<p>Given a connectable object, a table name, a hash map of columns and values to set, and either a hash map of columns and values to search on or a vector of a SQL where clause and parameters, perform an update on the table.</p>
</div></div></div><div class="public anchor" id="var-values-.3F"><h3>values-?</h3><div class="usage"><code>(values-? coll)</code></div><div class="doc"><div class="markdown"></div></div></div></div></body></html>