-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.randomseed.utils.db.types.html
13 lines (13 loc) · 17.8 KB
/
io.randomseed.utils.db.types.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.db.types 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">Random:utils</span> <span class="project-version">1.2.34</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></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>io</span></div></div></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>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.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-5 current"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.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-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.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-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</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="io.randomseed.utils.db.types.html#var-add-all-accessors"><div class="inner"><span>add-all-accessors</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-all-readers"><div class="inner"><span>add-all-readers</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-all-setters"><div class="inner"><span>add-all-setters</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-reader-blob"><div class="inner"><span>add-reader-blob</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-reader-date"><div class="inner"><span>add-reader-date</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-setter-date"><div class="inner"><span>add-setter-date</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-setter-ip-address"><div class="inner"><span>add-setter-ip-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-setter-phone-number"><div class="inner"><span>add-setter-phone-number</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-add-setter-uuid"><div class="inner"><span>add-setter-uuid</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-map"><div class="inner"><span>opts-map</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-simple-map"><div class="inner"><span>opts-simple-map</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-simple-vec"><div class="inner"><span>opts-simple-vec</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-slashed-map"><div class="inner"><span>opts-slashed-map</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-slashed-vec"><div class="inner"><span>opts-slashed-vec</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-opts-vec"><div class="inner"><span>opts-vec</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-lisp"><div class="inner"><span>to-lisp</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-lisp-simple"><div class="inner"><span>to-lisp-simple</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-lisp-slashed"><div class="inner"><span>to-lisp-slashed</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-snake"><div class="inner"><span>to-snake</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-snake-simple"><div class="inner"><span>to-snake-simple</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-to-snake-slashed"><div class="inner"><span>to-snake-slashed</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.db.types.html#var-utc-time-zone"><div class="inner"><span>utc-time-zone</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.db.types</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Opinionated database type conversions.</p>
</div></div><div class="public anchor" id="var-add-all-accessors"><h3>add-all-accessors</h3><div class="usage"><code>(add-all-accessors)</code></div><div class="doc"><div class="markdown"><p>Adds all opinionated readers and setters by calling <code>add-all-readers</code> and <code>add-all-setters</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L185">view source</a></div></div><div class="public anchor" id="var-add-all-readers"><h3>add-all-readers</h3><div class="usage"><code>(add-all-readers)</code></div><div class="doc"><div class="markdown"><p>Adds all opinionated readers by calling <code>add-reader-date</code> and <code>add-reader-blob</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L64">view source</a></div></div><div class="public anchor" id="var-add-all-setters"><h3>add-all-setters</h3><div class="usage"><code>(add-all-setters)</code></div><div class="doc"><div class="markdown"><p>Adds all opinionated setters by calling <code>add-setter-date</code> and <code>add-setter-ip-address</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L177">view source</a></div></div><div class="public anchor" id="var-add-reader-blob"><h3>add-reader-blob</h3><div class="usage"><code>(add-reader-blob)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.result-set/ReadableColumn</code> protocol to support binary large object (BLOB) conversions, so <code>java.sql.Blob</code> data are converted to an array of bytes (<code>bytes[]</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L50">view source</a></div></div><div class="public anchor" id="var-add-reader-date"><h3>add-reader-date</h3><div class="usage"><code>(add-reader-date)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.result-set/ReadableColumn</code> protocol to support date/time conversions so <code>java.sql.Date</code> data are passed as-is and <code>java.sql.Timestamp</code> data are converted to <code>java.sql.Timestamp</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L31">view source</a></div></div><div class="public anchor" id="var-add-setter-date"><h3>add-setter-date</h3><div class="usage"><code>(add-setter-date)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.prepare/SettableParameter</code> protocol to support date/time conversions so <code>java.sql.Date</code> data are saved using <code>.setDate</code> method and <code>java.sql.Timestamp</code>, <code>java.time.Instant</code>, <code>java.time.ZonedTime</code>, <code>java.time.LocalDate</code>, <code>java.time.LocalDateTime</code> and <code>java.util.Date</code> are saved with <code>.setTimestamp</code>. Also note that <code>java.time.Instant</code>, <code>java.time.ZonedDateTime</code> and <code>java.util.Date</code> are explicitly converted to UTC before saving.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L72">view source</a></div></div><div class="public anchor" id="var-add-setter-ip-address"><h3>add-setter-ip-address</h3><div class="usage"><code>(add-setter-ip-address)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.prepare/SettableParameter</code> protocol to support IP address conversions so <code>inet.ipaddr.ipv4.IPv4Address</code> data are converted to <code>inet.ipaddr.ipv6.IPv6Address</code>, then to an array of bytes and then saved using <code>.setBytes</code> method. Similarly, <code>inet.ipaddr.ipv6.IPv6Address</code> data are converted to an array of bytes and then saved with <code>.setBytes</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L129">view source</a></div></div><div class="public anchor" id="var-add-setter-phone-number"><h3>add-setter-phone-number</h3><div class="usage"><code>(add-setter-phone-number)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.prepare/SettableParameter</code> protocol to support phone number conversions so <code>com.google.i18n.phonenumbers/Phonenumber$PhoneNumber</code> data are converted to strings (in E.164 format) and then saved.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L163">view source</a></div></div><div class="public anchor" id="var-add-setter-uuid"><h3>add-setter-uuid</h3><div class="usage"><code>(add-setter-uuid)</code></div><div class="doc"><div class="markdown"><p>Extends <code>next.jdbc.prepare/SettableParameter</code> protocol to support UUID conversions so <code>java.util.UUID</code> data are converted to an array of bytes and then saved using <code>.setBytes</code> method.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L149">view source</a></div></div><div class="public anchor" id="var-opts-map"><h3>opts-map</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L319">view source</a></div></div><div class="public anchor" id="var-opts-simple-map"><h3>opts-simple-map</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L327">view source</a></div></div><div class="public anchor" id="var-opts-simple-vec"><h3>opts-simple-vec</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L351">view source</a></div></div><div class="public anchor" id="var-opts-slashed-map"><h3>opts-slashed-map</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L335">view source</a></div></div><div class="public anchor" id="var-opts-slashed-vec"><h3>opts-slashed-vec</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L359">view source</a></div></div><div class="public anchor" id="var-opts-vec"><h3>opts-vec</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L343">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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L312">view source</a></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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L313">view source</a></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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L314">view source</a></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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L315">view source</a></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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L316">view source</a></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 class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db.clj#L317">view source</a></div></div><div class="public anchor" id="var-utc-time-zone"><h3>utc-time-zone</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/db/types.clj#L26">view source</a></div></div></div></body></html>