all repos — litestore @ 9a3e59b556f96ffec02ff77f13797d174d054aa8

A minimalist nosql document store.

Fixed doc layout problems; Nim deprecation warnings.
h3rald h3rald@h3rald.com
Sun, 27 Dec 2015 12:18:03 +0100
commit

9a3e59b556f96ffec02ff77f13797d174d054aa8

parent

9096b38771ae0cdceac0216ed39f9ca2614eda75

M LiteStore_UserGuide.htmLiteStore_UserGuide.htm

@@ -187,9 +187,9 @@ </ul>

</li> </ul> </li> - <li><a href="#info..LiteStore.Information.">info (LiteStore Information)</a> + <li><a href="#dir..LiteStore.Directory.">dir (LiteStore Directory)</a> <ul> - <li><a href="#OPTIONS.info">OPTIONS info</a> + <li><a href="#OPTIONS.dir">OPTIONS dir</a> <ul> <li><a href="#Example">Example</a></li> </ul>

@@ -424,12 +424,12 @@

<p>The easiest way to get LiteStore is by downloading one of the prebuilt binaries from the [Github Release Page][release]:</p> <ul> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3litestore_v1.0.3_macosx_x64.zip">LiteStore for Mac OS X (x64)</a> &ndash; Compiled on OS X El Capitan (LLVM CLANG 7.0.0)</li> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_windows_x64.zip">LiteStore for Windows (x64)</a> &ndash; Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_windows_x86.zip">LiteStore for Windows (x86)</a> &ndash; Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_x64.zip">LiteStore for Linux (x64)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_x86.zip">LiteStore for Linux (x86)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li> -<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_arm.zip">LiteStore for Linux (ARM)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.2)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4litestore_v1.0.4_macosx_x64.zip">LiteStore for Mac OS X (x64)</a> &ndash; Compiled on OS X El Capitan (LLVM CLANG 7.0.0)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_windows_x64.zip">LiteStore for Windows (x64)</a> &ndash; Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_windows_x86.zip">LiteStore for Windows (x86)</a> &ndash; Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_x64.zip">LiteStore for Linux (x64)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_x86.zip">LiteStore for Linux (x86)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li> +<li><a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_arm.zip">LiteStore for Linux (ARM)</a> &ndash; Cross-compiled on OS X El Capitan (GNU GCC 4.8.2)</li> </ul>

@@ -457,10 +457,10 @@

<p>To get the app up and running (assuming that you have the <span class="cmd">litestore</span> executable in your path):</p> <ol> -<li>Download the default <a href="https://github.com/h3rald/litestore/releases/download/v1.0.3/data.db">data.db</a> file. This file is a LiteStore data store file containing the sample app.</li> +<li>Download the default <a href="https://github.com/h3rald/litestore/releases/download/v1.0.4/data.db">data.db</a> file. This file is a LiteStore data store file containing the sample app.</li> <li>Go to the local directory in which you downloaded the <span class="cmd">data.db</span> file.</li> <li>Run <span class="cmd">litestore -s:data.db</span></li> -<li>Go to <a href="http://localhost:9500/docs/admin/index.html">http://localhost:9500/docs/admin/index.html</a>.</li> +<li>Go to <a href="http://localhost:9500/docs/admin/index.html">localhost:9500/docs/admin/index.html</a>.</li> </ol>

@@ -639,7 +639,7 @@ <p>To access a LiteStore resource, use URLs composed in the following way:</p>

<p><code>http:&lt;hostname&gt;:&lt;port&gt;/v&lt;version&gt;/&lt;resource&gt;/&lt;id&gt;</code></p> -<p>Example: <a href="http://localhost:9500/v1/docs/admin/index.html">http://localhost:9500/v1/docs/admin/index.html</a></p> +<p>Example: <a href="http://localhost:9500/v1/docs/admin/index.html">localhost:9500/v1/docs/admin/index.html</a></p> <div class="note"><p>Remarks</p>

@@ -725,11 +725,11 @@ ]

} </code></pre> -<h3 id="info..LiteStore.Information.">info (LiteStore Information)<a href="#document-top" title="Go to top"></a></h3> +<h3 id="dir..LiteStore.Directory.">dir (LiteStore Directory)<a href="#document-top" title="Go to top"></a></h3> <p>This resource can be queried to retrieve files within the served directory (specied via <strong>-d</strong>).</p> -<h4 id="OPTIONS.info">OPTIONS info<a href="#document-top" title="Go to top"></a></h4> +<h4 id="OPTIONS.dir">OPTIONS dir<a href="#document-top" title="Go to top"></a></h4> <p>Returns the allowed HTTP verbs for this resource.</p>

@@ -1005,7 +1005,7 @@ <li>It is currently only possible to change tags, not other parts of a document.</li>

</ul> </div> -<pre><code>$ curl -i -X PATCH 'http://localhost:9500/docs/test.json' --header "Content-Type:application/json" -d '[{"op":"add","path":"/tags/3","value":"test1"},{"op":"add","path":"/tags/4","value":"test2"},{"op":"add","path":"/tags/5","value":"test3"}]' +<pre><code>$ curl -i -X PATCH 'http://localhost:9500/docs/test.json' --header "Content-Type:application/json" -d '[{"op":"add", "path":"/tags/3", "value":"test1"},{"op":"add", "path":"/tags/4", "value":"test2"},{"op":"add", "path":"/tags/5", "value":"test3"}]' HTTP/1.1 200 OK Content-Length: 187 Content-Type: application/json

@@ -1045,7 +1045,7 @@ </ul>

</div> <div id="footer"> - <p><span class="copy"></span> Fabio Cevasco &ndash; November 29, 2015</p> + <p><span class="copy"></span> Fabio Cevasco &ndash; December 27, 2015</p> <p><span>Powered by</span> <a href="https://h3rald.com/hastyscribe"><span class="hastyscribe"></span></a></p> </div> </body>
M admin/md/api.mdadmin/md/api.md

@@ -11,10 +11,10 @@ To access a LiteStore resource, use URLs composed in the following way:

`http:<hostname>:<port>/v<version>/<resource>/<id>` -Example: <http://localhost:9500/v1/docs/admin/index.html> +Example: [localhost:9500/v1/docs/admin/index.html](http://localhost:9500/v1/docs/admin/index.html) > %note% > Remarks > > * If the version is omitted, the latest version of the LiteStore API will be used by default. The previous URL can be therefore written as <http://localhost:9500/docs/admin/index.html>. -> * In a somewhat non-standard way, IDs of LiteStore documents can contain slashes. The main reason behind this is that this makes it possible to implement a virtual file system with LiteStore easily, and serve up web pages as you would from an ordinary filesystem.+> * In a somewhat non-standard way, IDs of LiteStore documents can contain slashes. The main reason behind this is that this makes it possible to implement a virtual file system with LiteStore easily, and serve up web pages as you would from an ordinary filesystem.
M admin/md/getting-started.mdadmin/md/getting-started.md

@@ -5,12 +5,12 @@ ### Downloading Pre-built Binaries

The easiest way to get LiteStore is by downloading one of the prebuilt binaries from the [Github Release Page][release]: - * [LiteStore for Mac OS X (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.3litestore_v1.0.3_macosx_x64.zip) -- Compiled on OS X El Capitan (LLVM CLANG 7.0.0) - * [LiteStore for Windows (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_windows_x64.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2) - * [LiteStore for Windows (x86)](https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_windows_x86.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2) - * [LiteStore for Linux (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_x64.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1) - * [LiteStore for Linux (x86)](https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_x86.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1) - * [LiteStore for Linux (ARM)](https://github.com/h3rald/litestore/releases/download/v1.0.3/litestore_v1.0.3_linux_arm.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.2) + * [LiteStore for Mac OS X (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.4litestore_v1.0.4_macosx_x64.zip) -- Compiled on OS X El Capitan (LLVM CLANG 7.0.0) + * [LiteStore for Windows (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_windows_x64.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2) + * [LiteStore for Windows (x86)](https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_windows_x86.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2) + * [LiteStore for Linux (x64)](https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_x64.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1) + * [LiteStore for Linux (x86)](https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_x86.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1) + * [LiteStore for Linux (ARM)](https://github.com/h3rald/litestore/releases/download/v1.0.4/litestore_v1.0.4_linux_arm.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.2) ### Installing using Nimble

@@ -32,7 +32,7 @@ A simple but functional Administration App is available to manage LiteStore, create documents interactively, view and search content, etc.

To get the app up and running (assuming that you have the [litestore](class:cmd) executable in your path): -1. Download the default [data.db](https://github.com/h3rald/litestore/releases/download/v1.0.3/data.db) file. This file is a LiteStore data store file containing the sample app. +1. Download the default [data.db](https://github.com/h3rald/litestore/releases/download/v1.0.4/data.db) file. This file is a LiteStore data store file containing the sample app. 2. Go to the local directory in which you downloaded the [data.db](class:cmd) file. 3. Run [litestore -s:data.db](class:cmd) -4. Go to <http://localhost:9500/docs/admin/index.html>. +4. Go to [localhost:9500/docs/admin/index.html](http://localhost:9500/docs/admin/index.html).
M lib/config.nimlib/config.nim

@@ -29,13 +29,13 @@ version = e.value

else: discard of cfgError: - stderr.writeln("Configuration error.") + stderr.writeLine("Configuration error.") quit(1) else: discard close(p) else: - stderr.writeln("Cannot process configuration file.") + stderr.writeLine("Cannot process configuration file.") quit(2)
M lib/logger.nimlib/logger.nim

@@ -14,7 +14,7 @@

proc msg(logger: Logger, kind, message: string, params: varargs[string, `$`]) = let s = format(message, params) if kind == "WARNING": - stderr.writeln(currentTime(true) & " " & kind & ": " & s) + stderr.writeLine(currentTime(true) & " " & kind & ": " & s) else: echo currentTime(true), " ", kind, ": ", s
M lib/utils.nimlib/utils.nim

@@ -153,7 +153,7 @@ for tag in tags:

store.db.exec(SQL_INSERT_TAG, tag, docid) proc destroyDocumentSystemTags*(store: Datastore, docid: string) = - let n = store.db.execAffectedRows(SQL_DELETE_DOCUMENT_SYSTEM_TAGS, docid) + discard store.db.execAffectedRows(SQL_DELETE_DOCUMENT_SYSTEM_TAGS, docid) proc fail*(code: int, msg: string) = LOG.error(msg)

@@ -175,7 +175,7 @@ result.code = code

result.content = """{"error":"$1"}""" % message result.headers = ctJsonHeader() -proc resDocumentNotFound*(id): Response = +proc resDocumentNotFound*(id: string): Response = resError(Http404, "Document '$1' not found." % id) proc eWarn*() =