-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
318 lines (241 loc) · 67.1 KB
/
index.js
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1);
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(2);
document.querySelector('main#content').innerHTML = `
${__webpack_require__(3)}
${__webpack_require__(4)}
${__webpack_require__(5)}
${__webpack_require__(25)}
${__webpack_require__(26)}
`;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = "<nav class=\"main\">\n <a href=\"#\" onclick=\"document.body.scrollTop = 0; window.location.hash = '#'\">InlineDB</a>\n <a href=\"#getting-started\">Getting Started</a>\n <a href=\"#api\">API</a>\n <a href=\"#examples\">Examples</a>\n <a href=\"https://github.com/inlinedb/inlinedb\" target=\"_blank\">Github</a>\n</nav>\n";
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = "<header>\n <section class=\"banner\">\n <p>\n <img alt=\"inlinedb\" src=\"https://raw.githubusercontent.com/inlinedb/inlinedb-icons/master/idb.png\">\n </p>\n\n <h1>\n InlineDB\n </h1>\n\n <p>\n <a href=\"https://www.npmjs.com/package/inlinedb\"><img src=\"https://img.shields.io/npm/v/inlinedb.svg\"></a>\n <a href=\"https://www.npmjs.com/package/inlinedb\"><img src=\"https://img.shields.io/npm/dm/inlinedb.svg\"></a>\n </p>\n\n <p>\n <a href=\"https://travis-ci.org/inlinedb/inlinedb\"><img src=\"https://img.shields.io/travis/inlinedb/inlinedb.svg?label=units\"></a>\n <a href=\"https://travis-ci.org/inlinedb/inlinedb-e2e\"><img src=\"https://img.shields.io/travis/inlinedb/inlinedb-e2e.svg?label=e2e\"></a>\n <a href='https://coveralls.io/github/inlinedb/inlinedb?branch=master'><img src='https://coveralls.io/repos/github/inlinedb/inlinedb/badge.svg?branch=master' alt='Coverage Status'/></a>\n </p>\n </section>\n\n <article>\n InlineDB is a portable JSON and file system based database. It is designed to work with node applications that\n require a simple database to store and maintain data. For example, one could store settings for an app, store\n user profiles and high scores for a game, an electron app that want to cache various data objects, or hook up with\n expressjs to serve a todo app.\n </article>\n\n <article>\n Explore the <a href=\"#api\">API</a> to find more about InlineDB. Since it is a \"lite\" database, it has some limitations.\n View the <a href=\"#limitaions\">limitations</a> section for more information.\n </article>\n</header>\n";
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"\">\n <h1>Contents</h1>\n<ul>\n<li>\n<p><a href=\"#getting-started\">Getting Started</a></p>\n<ul>\n<li><a href=\"#getting-started-installation\">Installation</a></li>\n<li><a href=\"#getting-started-basic-usage\">Basic usage</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#api\">API</a></p>\n<ul>\n<li><a href=\"#api-database\">Database</a></li>\n<li><a href=\"#api-table\">Table</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#examples\">Examples</a></p>\n</li>\n<li>\n<p>Limitations</p>\n</li>\n<li>\n<p>Contributing</p>\n</li>\n<li>\n<p><a href=\"#license\">License</a></p>\n</li>\n</ul>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
__webpack_require__(6) +
__webpack_require__(7) +
__webpack_require__(8) +
__webpack_require__(10) +
__webpack_require__(11) +
__webpack_require__(24) +
"";
/***/ }),
/* 6 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"getting-started\">\n <h1>Getting Started</h1>\n<h2 id=\"getting-started-installation\">Installation</h2>\n<p>Install using npm:</p>\n<pre><code class=\"language-bash\"><span class=\"token function\">npm</span> <span class=\"token function\">install</span> inlinedb\n</code></pre>\n<h2 id=\"getting-started-basic-usage\">Basic Usage</h2>\n<p>Up and running in no time:</p>\n<pre><code class=\"language-js\"><span class=\"token keyword\">import</span> InlindeDB <span class=\"token keyword\">from</span> <span class=\"token string\">'inlinedb'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// create a new database</span>\n<span class=\"token keyword\">const</span> idbName <span class=\"token operator\">=</span> <span class=\"token string\">'my-database'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">const</span> idb <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">InlindeDB</span><span class=\"token punctuation\">(</span>idbName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// and create a new table</span>\n<span class=\"token keyword\">const</span> tableName <span class=\"token operator\">=</span> <span class=\"token string\">'my-table'</span><span class=\"token punctuation\">;</span>\nidb<span class=\"token punctuation\">.</span><span class=\"token function\">createTable</span><span class=\"token punctuation\">(</span>tableName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<p>View <a href=\"#api\">API</a> for more options</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"api\">\n <h1>API</h1>\n<p>InlineDB has following APIs:</p>\n<ul>\n<li><a href=\"#api-database\">Database</a></li>\n<li><a href=\"#api-table\">Table</a></li>\n</ul>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"api-database\">\n <h1>Database</h1>\n<p><code>Database</code> is the main interface in creating and manage a database for an application.</p>\n<h4>Methods:</h4>\n<ul>\n<li><a href=\"#api-database-create-database\">Create database</a></li>\n<li><a href=\"#api-database-create-table\">Create table</a></li>\n<li><a href=\"#api-database-list-tables\">List tables</a></li>\n<li><a href=\"#api-database-drop-table\">Drop table</a></li>\n<li><a href=\"#api-database-drop-database\">Drop database</a></li>\n</ul>\n<h2 id=\"api-database-create-database\">Create database</h2>\n<p>A database can be created using the <code>new</code> operator:</p>\n<pre><code class=\"language-js\"><span class=\"token keyword\">const</span> idb <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">InlineDB</span><span class=\"token punctuation\">(</span>idbName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:center\">Required</th>\n<th style=\"text-align:center\">Type</th>\n<th style=\"text-align:center\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">idbName</td>\n<td style=\"text-align:center\">Yes</td>\n<td style=\"text-align:center\"><em>String</em></td>\n<td style=\"text-align:center\"><em>None</em></td>\n<td style=\"text-align:left\">Name of the database to create</td>\n</tr>\n</tbody>\n</table>\n<h4>Throws</h4>\n<ul>\n<li>When <code>idbName</code> is not provided.</li>\n<li>When <code>idbName</code> is not a string.</li>\n<li>When <code>idbName</code> does not match <code>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*</code> pattern.\n<ul>\n<li>see <a href=\"#api-naming-conventions\">naming conventions</a> for examples.</li>\n</ul>\n</li>\n</ul>\n<h4>Returns</h4>\n<p>An instance of <a href=\"#api-database\"><code>Database</code></a>.</p>\n<h2 id=\"api-database-create-table\">Create table</h2>\n<p>Creates an instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">createTable</span><span class=\"token punctuation\">(</span>tableName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">tableName</td>\n<td style=\"text-align:left\">Yes</td>\n<td style=\"text-align:left\"><em>String</em></td>\n<td style=\"text-align:left\"><em>None</em></td>\n<td style=\"text-align:left\">Name of the table to create</td>\n</tr>\n</tbody>\n</table>\n<h4>Throws</h4>\n<ul>\n<li>When <code>tableName</code> is not provided.</li>\n<li>When <code>tableName</code> is not a string.</li>\n<li>When <code>tableName</code> does not match <code>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*</code> pattern.\n<ul>\n<li>see <a href=\"#api-naming-conventions\">naming conventions</a> for examples.</li>\n</ul>\n</li>\n</ul>\n<h4>Returns</h4>\n<p>An instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n<h2 id=\"api-database-list-tables\">List tables</h2>\n<p>Lists table that are created so far in the database.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">listTables</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<h4>Returns</h4>\n<p>An array of table names (<code>Array<String></code>).</p>\n<h2 id=\"api-database-drop-table\">Drop table</h2>\n<p>Deletes a table permanently.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">dropTable</span><span class=\"token punctuation\">(</span>tableName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">tableName</td>\n<td style=\"text-align:left\">Yes</td>\n<td style=\"text-align:left\"><em>String</em></td>\n<td style=\"text-align:left\"><em>None</em></td>\n<td style=\"text-align:left\">Name of the table to drop</td>\n</tr>\n</tbody>\n</table>\n<h4>Returns</h4>\n<p>Current instance of <a href=\"#api-database\"><code>Database</code></a>.</p>\n<h2 id=\"api-database-drop-database\">Drop database</h2>\n<p>Deletes the database permanently.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">drop</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<h4>Returns</h4>\n<p>Nothing (<code>undefined</code>).</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
__webpack_require__(9) +
"";
/***/ }),
/* 9 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"api-naming-conventions\">\n <h1>Naming Conventions</h1>\n<p>Example for valid names:</p>\n<pre><code class=\"language-wiki\">my-database\nMyTable\nmy-db-1\nmyFirstTable\nDB1\nTaBlE_uSeRs\n</code></pre>\n<p>Example for invalid names:</p>\n<pre><code class=\"language-wiki\">my database\n_table\nname_\n<span class=\"token punctuation\">#</span>mytable\n.database\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 10 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"api-table\">\n <h1>Table</h1>\n<p>A table is created from a database instance using <a href=\"#api-database\"><code>Database</code></a><code>::</code><a href=\"#api-database-create-table\"><code>createTable</code></a> method.\nAll data manipulation operations are transactional i.e until saved, none of the mutative queries are executed</p>\n<h4>Methods</h4>\n<ul>\n<li><a href=\"#api-table-insert-rows\">Insert rows</a></li>\n<li><a href=\"#api-table-query-rows\">Query rows</a></li>\n<li><a href=\"#api-table-update-rows\">Update rows</a></li>\n<li><a href=\"#api-table-delete-rows\">Delete rows</a></li>\n<li><a href=\"#api-table-save-queries\">Save queries</a></li>\n<li><a href=\"#api-table-revert-queries\">Revert queries</a></li>\n</ul>\n<h2 id=\"api-table-insert-rows\">Insert rows</h2>\n<p>Queues a query to insert the given rows.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">insert</span><span class=\"token punctuation\">(</span>row<span class=\"token punctuation\">[</span><span class=\"token punctuation\">,</span> row<span class=\"token punctuation\">,</span> <span class=\"token operator\">...</span>rows<span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">…rows</td>\n<td style=\"text-align:left\">Yes</td>\n<td style=\"text-align:left\"><em>Object</em> list</td>\n<td style=\"text-align:left\"><em>None</em></td>\n<td style=\"text-align:left\">One or more objects to be inserted into the table</td>\n</tr>\n</tbody>\n</table>\n<h4>Throws</h4>\n<ul>\n<li>When one or more <code>rows</code> is not provided.</li>\n<li>When one of the <code>rows</code> is not an object.</li>\n</ul>\n<h4>Returns</h4>\n<p>The current instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n<h4>Notes</h4>\n<ul>\n<li>Does not mutate the table until <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-save-queries\"><code>save</code></a> is called.</li>\n<li>Can be reverted before saving using <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-revert-queries\"><code>revert</code></a>.</li>\n</ul>\n<h2 id=\"api-table-query-rows\">Query rows</h2>\n<p>Queries rows matched by the <code>filter</code>.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">[</span>filter<span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">filter</td>\n<td style=\"text-align:left\">No</td>\n<td style=\"text-align:left\">one of <em><ul><li>Number</li><li>Array<number></number></li><li>Function</li></ul></em></td>\n<td style=\"text-align:left\"><code>[Function:</code> <code>()</code> <code>=></code> <code>true]</code></td>\n<td style=\"text-align:left\">Takes in an <code>id</code> or an array of <code>ids</code> or a filter function that will be matched against row</td>\n</tr>\n</tbody>\n</table>\n<h4>Returns</h4>\n<p>A <code>Promise</code> that resolves to a an array of rows that is matched by the given filter.</p>\n<h2 id=\"api-table-update-rows\">Update rows</h2>\n<p>Queues a query to update the rows that are matched by the given <code>filter</code>, and run given <code>update</code> on each of the filtered row to get the updated row.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">update</span><span class=\"token punctuation\">(</span>update<span class=\"token punctuation\">[</span><span class=\"token punctuation\">,</span> filter<span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">update</td>\n<td style=\"text-align:left\">Yes</td>\n<td style=\"text-align:left\"><em>Function</em></td>\n<td style=\"text-align:left\"><em>None</em></td>\n<td style=\"text-align:left\">A non mutative function that will be run on each row</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">filter</td>\n<td style=\"text-align:left\">No</td>\n<td style=\"text-align:left\">one of <em><ul><li>Number</li><li>Array<number></number></li><li>Function</li></ul></em></td>\n<td style=\"text-align:left\"><code>[Function:</code> <code>()</code> <code>=></code> <code>true]</code></td>\n<td style=\"text-align:left\">Takes in an <code>id</code> or an array of <code>ids</code> or a filter function that will be matched against row</td>\n</tr>\n</tbody>\n</table>\n<h4>Throws</h4>\n<ul>\n<li>When <code>udpate</code> is not a function.</li>\n<li>When <code>udpate</code> might mutate the row.</li>\n<li>When <code>udpate</code> might return a value other than an <code>Object</code>.</li>\n</ul>\n<h4>Returns</h4>\n<p>The current instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n<h4>Notes</h4>\n<ul>\n<li>Does not mutate the table until <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-save-queries\"><code>save</code></a> is called.</li>\n<li>Can be reverted before saving using <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-revert-queries\"><code>revert</code></a>.</li>\n</ul>\n<h2 id=\"api-table-delete-rows\">Delete rows</h2>\n<p>Queues a query to delete the rows that are matched by the given <code>filter</code>.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token keyword\">delete</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">[</span>filter<span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Param</th>\n<th style=\"text-align:left\">Required</th>\n<th style=\"text-align:left\">Type</th>\n<th style=\"text-align:left\">Default</th>\n<th style=\"text-align:left\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">filter</td>\n<td style=\"text-align:left\">No</td>\n<td style=\"text-align:left\">one of <em><ul><li>Number</li><li>Array<number></number></li><li>Function</li></ul></em></td>\n<td style=\"text-align:left\"><code>[Function:</code> <code>()</code> <code>=></code> <code>true]</code></td>\n<td style=\"text-align:left\">Takes in an <code>id</code> or an array of <code>ids</code> or a filter function that will be matched against row</td>\n</tr>\n</tbody>\n</table>\n<h4>Returns</h4>\n<p>The current instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n<h4>Notes</h4>\n<ul>\n<li>Does not mutate the table until <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-save-queries\"><code>save</code></a> is called.</li>\n<li>Can be reverted before saving using <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-revert-queries\"><code>revert</code></a>.</li>\n</ul>\n<h2 id=\"api-table-save-queries\">Save queries</h2>\n<p>Saves queued queries to the table. Once done, it empties the query queue.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">save</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<h4>Returns</h4>\n<p>A <code>Promise</code> that would resolve once the queries are successfully saved to table.</p>\n<h2 id=\"api-table-revert-queries\">Revert queries</h2>\n<p>Empties the pending query queue.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">revert</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<h4>Returns</h4>\n<p>The current instance of <a href=\"#api-table\"><code>Table</code></a>.</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples\">\n <h1>Examples</h1>\n<ul>\n<li><a href=\"#examples-create-database\">Create a database</a></li>\n<li><a href=\"#examples-create-table\">Create a table</a></li>\n<li><a href=\"#examples-insert-rows\">Insert rows into a table</a></li>\n<li><a href=\"#examples-query-rows\">Query rows from a table</a></li>\n<li><a href=\"#examples-update-rows\">Update rows in a table</a></li>\n<li><a href=\"#examples-delete-rows\">Delete rows form a table</a></li>\n<li><a href=\"#examples-chaining\">Chaining operations</a></li>\n<li><a href=\"#examples-save-queries\">Save queries to a table</a></li>\n<li><a href=\"#examples-revert-queries\">Revert queries</a></li>\n<li><a href=\"#examples-drop-table\">Delete a table</a></li>\n<li><a href=\"#examples-list-tables\">List all tables</a></li>\n<li><a href=\"#examples-drop-database\">Drop a database</a></li>\n</ul>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
__webpack_require__(12) +
__webpack_require__(13) +
__webpack_require__(14) +
__webpack_require__(15) +
__webpack_require__(16) +
__webpack_require__(17) +
__webpack_require__(18) +
__webpack_require__(19) +
__webpack_require__(20) +
__webpack_require__(21) +
__webpack_require__(22) +
__webpack_require__(23) +
"";
/***/ }),
/* 12 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-create-database\">\n <h1>Create a database</h1>\n<p>Import the InlineDB library to instantiate a new database.</p>\n<pre><code class=\"language-js\"><span class=\"token keyword\">import</span> InlindeDB <span class=\"token keyword\">from</span> <span class=\"token string\">'inlinedb'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">const</span> idbName <span class=\"token operator\">=</span> <span class=\"token string\">'my-database'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">const</span> idb <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">InlindeDB</span><span class=\"token punctuation\">(</span>idbName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<p>If the database is already exists, running <code>new InlineDB</code> will return an instance that runs on the existing database.\nOtherwise it will create a new database in the system and will return an instance for that.</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 13 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-create-table\">\n <h1>Create a table</h1>\n<p>Use the idb instance to create a table. At this point there will be no table created in the system.</p>\n<pre><code class=\"language-js\"><span class=\"token keyword\">const</span> tableName <span class=\"token operator\">=</span> <span class=\"token string\">'my-table'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">const</span> table <span class=\"token operator\">=</span> idb<span class=\"token punctuation\">.</span><span class=\"token function\">createTable</span><span class=\"token punctuation\">(</span>tableName<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 14 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-insert-rows\">\n <h1>Insert rows into a table</h1>\n<p>Multiple rows can be inserted into the table, but at least one row must be provided.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">insert</span><span class=\"token punctuation\">(</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column awesome'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column match'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column random'</span><span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n<p>There is no rule on how the row should look like, except that it should be an <code>Object</code> and should be serializable.\nSo no <code>Date</code>, <code>Symbol</code>, or <code>Function</code>. Some of these might be supported in future.</p>\n<p>There will be an <code>$idbID</code> assigned to each row on insertion. This value is just an auto-incremented value on each\ninsertion. One can maintain their own ID or use this to identify rows in the table.</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-query-rows\">\n <h1>Query rows from a table</h1>\n<p>Querying can be achieved using an <code>$idbID</code>, an array of <code>$idbID</code>, or a custom function, or nothing in which case it will\nreturn everything. Querying is done asynchronously, so it will return a promise that will resolve to queried data.</p>\n<h4>Using no filter</h4>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span> console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 2'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column match'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n<h4>Using id</h4>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token number\">1</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span> console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n<h4>Using ids</h4>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">[</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token number\">2</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span> console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 2'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n<h4>Using a function</h4>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span>row <span class=\"token operator\">=></span> row<span class=\"token punctuation\">.</span>column <span class=\"token operator\">===</span> <span class=\"token string\">'column match'</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span> console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column match'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 16 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-update-rows\">\n <h1>Update rows in a table</h1>\n<p>Updating rows takes two parameters. An update function that is required and an optional filter.</p>\n<p>The update function should not mutate the row, instead it should return a new updated row. Also it should return an\n<code>Object</code> that can be serialized, just like when inserting rows. Returning anything else will result in an error.</p>\n<p>The filter function works just like the <a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-query-rows\"><code>query</code></a>\n<a href=\"#examples-query-rows\"><code>filter</code></a>. It can be an <code>$idbID</code>, an array of <code>$idbID</code>, or a custom function, or nothing in which case\nit will update everything.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">update</span><span class=\"token punctuation\">(</span>\n row <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token operator\">...</span>row<span class=\"token punctuation\">,</span>\n column<span class=\"token punctuation\">:</span> <span class=\"token string\">'updated column'</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n row <span class=\"token operator\">=></span> row<span class=\"token punctuation\">.</span>$idbID <span class=\"token operator\"><</span> <span class=\"token number\">3</span>\n<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'updated column'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'updated column'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column match'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n<p>An update function may return an object too, which will be merged with the original row on <code>::</code><a href=\"#api-table-save-queries\"><code>save</code></a>.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">update</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'override'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'override'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'override'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'override'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-delete-rows\">\n <h1>Delete rows from a table</h1>\n<p>Deleting rows takes an optional <a href=\"#examples-query-rows\"><code>filter</code></a> similar to\n<a href=\"#api-table\"><code>Table</code></a><code>::</code><a href=\"#api-table-query-rows\"><code>query</code></a>. It can be an <code>$idbID</code>, an array of <code>$idbID</code>, or a\ncustom function, or nothing in which case it will delete everything.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token keyword\">delete</span><span class=\"token punctuation\">(</span><span class=\"token number\">1</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'updated column'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column match'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 18 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-chaining\">\n <h1>Chaining operations</h1>\n<p>Since its all <code>Promise</code> and <code>this</code>, all the operations can be easily chained.</p>\n<pre><code class=\"language-js\"><span class=\"token keyword\">import</span> InlineDB <span class=\"token keyword\">from</span> <span class=\"token string\">'inlinedb'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">const</span> table <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">InlineDB</span><span class=\"token punctuation\">(</span><span class=\"token string\">'my-database'</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">createTable</span><span class=\"token punctuation\">(</span><span class=\"token string\">'my-table'</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">insert</span><span class=\"token punctuation\">(</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column 1'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column 2'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column 3'</span><span class=\"token punctuation\">}</span>\n <span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">update</span><span class=\"token punctuation\">(</span>\n row <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token operator\">...</span>row<span class=\"token punctuation\">,</span>\n column<span class=\"token punctuation\">:</span> <span class=\"token string\">'updated column'</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n row <span class=\"token operator\">=></span> row<span class=\"token punctuation\">.</span>$idbID <span class=\"token operator\"><</span> <span class=\"token number\">3</span>\n <span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token keyword\">delete</span><span class=\"token punctuation\">(</span><span class=\"token number\">1</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ntable<span class=\"token punctuation\">.</span><span class=\"token function\">save</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span> console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'updated column'</span>\n<span class=\"token comment\" spellcheck=\"true\">// },</span>\n<span class=\"token comment\" spellcheck=\"true\">// {</span>\n<span class=\"token comment\" spellcheck=\"true\">// $idbID: 3,</span>\n<span class=\"token comment\" spellcheck=\"true\">// column: 'column 3'</span>\n<span class=\"token comment\" spellcheck=\"true\">// }</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 19 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-save-queries\">\n <h1>Save queries to a table</h1>\n<p>All the mutative queries, <code>::</code><a href=\"#api-table-query-rows\"><code>insert</code></a>, <code>::</code><a href=\"#api-table-update-rows\"><code>update</code></a> and\n<code>::</code><a href=\"#api-table-delete-rows\"><code>delete</code></a> are not executed immediately, until saved. This gives the ability to\n<code>::</code><a href=\"#api-table-revert-queries\"><code>revert</code></a> the queries and a transactional feeling.</p>\n<p>Note that after creating a new table, only on saving the data will be written to the system.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span>\n <span class=\"token comment\" spellcheck=\"true\">// []</span>\n <span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n table<span class=\"token punctuation\">.</span><span class=\"token function\">insert</span><span class=\"token punctuation\">(</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column 1'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'column 2'</span><span class=\"token punctuation\">}</span>\n <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n \n <span class=\"token keyword\">return</span> table<span class=\"token punctuation\">.</span><span class=\"token function\">save</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span>\n <span class=\"token comment\" spellcheck=\"true\">// [</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n <span class=\"token comment\" spellcheck=\"true\">// },</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 2'</span>\n <span class=\"token comment\" spellcheck=\"true\">// }</span>\n <span class=\"token comment\" spellcheck=\"true\">// ]</span>\n <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 20 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-revert-queries\">\n <h1>Revert queries</h1>\n<p>All the queued queries can reverted to the last <code>::</code><a href=\"#api-table-save-queries\"><code>save</code></a>.</p>\n<pre><code class=\"language-js\">table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span>\n <span class=\"token comment\" spellcheck=\"true\">// [</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n <span class=\"token comment\" spellcheck=\"true\">// },</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 2'</span>\n <span class=\"token comment\" spellcheck=\"true\">// }</span>\n <span class=\"token comment\" spellcheck=\"true\">// ]</span>\n <span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n table<span class=\"token punctuation\">.</span><span class=\"token function\">update</span><span class=\"token punctuation\">(</span>\n <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>column<span class=\"token punctuation\">:</span> <span class=\"token string\">'updated column'</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n \n table<span class=\"token punctuation\">.</span><span class=\"token function\">revert</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n \n <span class=\"token keyword\">return</span> table<span class=\"token punctuation\">.</span><span class=\"token function\">save</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> table<span class=\"token punctuation\">.</span><span class=\"token function\">query</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span>rows <span class=\"token operator\">=></span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>rows<span class=\"token punctuation\">)</span>\n <span class=\"token comment\" spellcheck=\"true\">// [</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 1,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 1'</span>\n <span class=\"token comment\" spellcheck=\"true\">// },</span>\n <span class=\"token comment\" spellcheck=\"true\">// {</span>\n <span class=\"token comment\" spellcheck=\"true\">// $idbID: 2,</span>\n <span class=\"token comment\" spellcheck=\"true\">// column: 'column 2'</span>\n <span class=\"token comment\" spellcheck=\"true\">// }</span>\n <span class=\"token comment\" spellcheck=\"true\">// ]</span>\n <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 21 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-drop-table\">\n <h1>Drop table</h1>\n<p>Deleting a table is irreversible. It will delete the table from the system.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">dropTable</span><span class=\"token punctuation\">(</span><span class=\"token string\">'my-table'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 22 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-list-tables\">\n <h1>List all tables</h1>\n<p>Listing all tables will return an array of table names.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">listTables</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\" spellcheck=\"true\">// [</span>\n<span class=\"token comment\" spellcheck=\"true\">// 'my-table'</span>\n<span class=\"token comment\" spellcheck=\"true\">// 'user-table'</span>\n<span class=\"token comment\" spellcheck=\"true\">// 'highscores'</span>\n<span class=\"token comment\" spellcheck=\"true\">// 'todos'</span>\n<span class=\"token comment\" spellcheck=\"true\">// ]</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 23 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"examples-drop-database\">\n <h1>Drop database</h1>\n<p>Deleting a database is irreversible. It will delete the database from the system and all the tables associated with it.</p>\n<pre><code class=\"language-js\">idb<span class=\"token punctuation\">.</span><span class=\"token function\">drop</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports =
({"template":"<html><head></head><body><section class=\"docs-section\" id=\"license\">\n <h1>License</h1>\n<p>MIT License</p>\n<p>Copyright © 2017 InlineDB</p>\n<p>Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:</p>\n<p>The above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.</p>\n<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.</p>\n\n \n <a class=\"link-to-top\" style=\"cursor: pointer\" onclick=\"document.body.scrollTop = 0; window.location.hash = '';\">\n <span style=\"font-size: 1.5em\">↑</span> Top\n </a>\n </section> \n</body></html>"}).template +
"";
/***/ }),
/* 25 */
/***/ (function(module, exports) {
module.exports = "<footer>\n <div class=\"logo\">\n <img alt=\"inlinedb\" src=\"https://raw.githubusercontent.com/inlinedb/inlinedb-icons/master/idb.png\">\n <h3>InlineDB</h3>\n </div>\n <nav>\n <a href=\"#getting-started\">Getting Started</a>\n <a href=\"#api\">API</a>\n <a href=\"#examples\">Examples</a>\n </nav>\n <div class=\"info\">\n <div class=\"author\">\n Gopikrishna Sathyamurthy\n </div>\n <div class=\"links\">\n <a href=\"http://github.com/Gopikrishna19\" target=\"_blank\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32px\" height=\"32px\" viewBox=\"0 0 512 512\">\n <g>\n <path d=\"M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M408.027,408.027\n c-19.76,19.759-42.756,35.267-68.354,46.094c-6.502,2.75-13.105,5.164-19.801,7.246V423c0-20.167-6.916-35-20.75-44.5\n c8.668-0.833,16.625-2,23.875-3.5s14.918-3.667,23-6.5c8.084-2.833,15.334-6.208,21.75-10.125c6.418-3.917,12.584-9,18.5-15.25\n c5.918-6.25,10.875-13.333,14.875-21.25s7.168-17.417,9.5-28.5c2.334-11.083,3.5-23.292,3.5-36.625c0-25.833-8.416-47.833-25.25-66\n c7.668-20,6.834-41.75-2.5-65.25l-6.25-0.75c-4.332-0.5-12.125,1.333-23.375,5.5s-23.875,11-37.875,20.5\n c-19.832-5.5-40.416-8.25-61.749-8.25c-21.5,0-42,2.75-61.5,8.25c-8.833-6-17.208-10.958-25.125-14.875s-14.25-6.583-19-8\n s-9.167-2.292-13.25-2.625s-6.708-0.417-7.875-0.25s-2,0.333-2.5,0.5c-9.333,23.667-10.167,45.417-2.5,65.25\n c-16.833,18.167-25.25,40.167-25.25,66c0,13.333,1.167,25.542,3.5,36.625s5.5,20.583,9.5,28.5s8.958,15,14.875,21.25\n s12.083,11.333,18.5,15.25s13.667,7.292,21.75,10.125s15.75,5,23,6.5s15.208,2.667,23.875,3.5c-13.667,9.333-20.5,24.167-20.5,44.5\n v39.115c-7.549-2.247-14.99-4.902-22.3-7.994c-25.597-10.827-48.594-26.335-68.353-46.094\n c-19.758-19.758-35.267-42.756-46.093-68.354C46.679,313.195,41,285.043,41,256s5.679-57.195,16.879-83.675\n c10.827-25.597,26.335-48.594,46.093-68.353c19.758-19.759,42.756-35.267,68.353-46.093C198.805,46.679,226.957,41,256,41\n s57.195,5.679,83.676,16.879c25.598,10.827,48.594,26.335,68.354,46.093c19.758,19.758,35.266,42.756,46.092,68.353\n C465.32,198.805,471,226.957,471,256s-5.68,57.195-16.879,83.675C443.295,365.271,427.785,388.27,408.027,408.027z\"/>\n </g>\n </svg>\n </a>\n <a href=\"https://www.linkedin.com/in/gopikrishna-sathyamurthy/\" target=\"_blank\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32px\" height=\"32px\" viewBox=\"0 0 430.117 430.117\">\n <g>\n <path id=\"LinkedIn\" d=\"M430.117,261.543V420.56h-92.188V272.193c0-37.271-13.334-62.707-46.703-62.707\n c-25.473,0-40.632,17.142-47.301,33.724c-2.432,5.928-3.058,14.179-3.058,22.477V420.56h-92.219c0,0,1.242-251.285,0-277.32h92.21\n v39.309c-0.187,0.294-0.43,0.611-0.606,0.896h0.606v-0.896c12.251-18.869,34.13-45.824,83.102-45.824\n C384.633,136.724,430.117,176.361,430.117,261.543z M52.183,9.558C20.635,9.558,0,30.251,0,57.463\n c0,26.619,20.038,47.94,50.959,47.94h0.616c32.159,0,52.159-21.317,52.159-47.94C103.128,30.251,83.734,9.558,52.183,9.558z\n M5.477,420.56h92.184v-277.32H5.477V420.56z\"/>\n </g>\n </svg>\n </a>\n </div>\n </div>\n</footer>\n";
/***/ }),
/* 26 */
/***/ (function(module, exports) {
module.exports = "<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-100424155-1', 'auto');\n ga('send', 'pageview');\n\n</script>\n";
/***/ })
/******/ ]);