Skip to content

Commit b81824d

Browse files
committed
readme/doc
1 parent b98756f commit b81824d

File tree

3 files changed

+105
-24
lines changed

3 files changed

+105
-24
lines changed

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,71 @@
1-
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2-
[](#nativescript-akylas-sqlite)
1+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️--><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
12+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
21+
<h1 align="center">@nativescript-community/sqlite</h1>
22+
<p align="center">
23+
<a href="https://npmcharts.com/compare/@nativescript-community/sqlite?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/sqlite.svg" height="20"/></a>
24+
<a href="https://www.npmjs.com/package/@nativescript-community/sqlite"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/sqlite.svg" height="20"/></a>
25+
</p>
26+
27+
<p align="center">
28+
<b>SQLite for Nativescript</b></br>
29+
<sub><sub>
30+
</p>
31+
32+
<br />
33+
34+
35+
36+
[](#table-of-contents)
37+
338

4-
# Nativescript: Akylas Sqlite
39+
[](#table-of-contents)
40+
41+
## Table of Contents
542

6-
[![npm](https://img.shields.io/npm/v/@nativescript-community/sqlite.svg)](https://www.npmjs.com/package/@nativescript-community/sqlite)
7-
[![npm](https://img.shields.io/npm/dt/@nativescript-community/sqlite.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/sqlite)
43+
* [Installation](#installation)
44+
* [Usage](#usage)
845

946

47+
[](#installation)
48+
49+
1050
[](#installation)
1151

1252
## Installation
53+
Run the following command from the root of your project:
1354

14-
```
15-
ns plugin add @nativescript-community/sqlite
16-
```
55+
`ns plugin add @nativescript-community/sqlite`
1756

1857

58+
[](#usage)
59+
60+
1961
[](#usage)
2062

2163
## Usage
2264

2365
You should take care of wrapping sqlite calls to your preferred async option (promises, observables, async/await). And catch any exceptions thrown.
2466

2567
```typescript
26-
import { openOrCreate, deleteDatabase } from "nativescript-akylas-sqlite";
68+
import { openOrCreate, deleteDatabase } from "@nativescript-community/sqlite";
2769

2870
const sqlite = openOrCreate("path/to/db");
2971
sqlite.execute("CREATE TABLE names (id INT, name TEXT)");

docs/assets/highlight.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
:root {
2-
--light-hl-0: #001080;
3-
--dark-hl-0: #9CDCFE;
2+
--light-hl-0: #AF00DB;
3+
--dark-hl-0: #C586C0;
44
--light-hl-1: #000000;
55
--dark-hl-1: #D4D4D4;
6-
--light-hl-2: #AF00DB;
7-
--dark-hl-2: #C586C0;
6+
--light-hl-2: #001080;
7+
--dark-hl-2: #9CDCFE;
88
--light-hl-3: #A31515;
99
--dark-hl-3: #CE9178;
1010
--light-hl-4: #0000FF;

docs/index.html

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,67 @@
1212
<div class="col-8 col-content">
1313
<div class="tsd-page-title">
1414
<h2>SQLite for Nativescript</h2></div>
15-
<div class="tsd-panel tsd-typography"><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
16-
<p><a href="#nativescript-akylas-sqlite"></a></p>
15+
<div class="tsd-panel tsd-typography"><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️--><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
16+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
35+
<h1 align="center">@nativescript-community/sqlite</h1>
36+
<p align="center">
37+
<a href="https://npmcharts.com/compare/@nativescript-community/sqlite?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/sqlite.svg" height="20"/></a>
38+
<a href="https://www.npmjs.com/package/@nativescript-community/sqlite"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/sqlite.svg" height="20"/></a>
39+
</p>
1740

18-
<a href="#nativescript-akylas-sqlite" id="nativescript-akylas-sqlite" style="color: inherit; text-decoration: none;">
19-
<h1>Nativescript: Akylas Sqlite</h1>
41+
<p align="center">
42+
<b>SQLite for Nativescript</b></br>
43+
<sub><sub>
44+
</p>
45+
46+
<br />
47+
48+
49+
50+
<p><a href="#table-of-contents"></a></p>
51+
<p><a href="#table-of-contents"></a></p>
52+
53+
<a href="#table-of-contents" id="table-of-contents" style="color: inherit; text-decoration: none;">
54+
<h2>Table of Contents</h2>
2055
</a>
21-
<p><a href="https://www.npmjs.com/package/@nativescript-community/sqlite"><img src="https://img.shields.io/npm/v/@nativescript-community/sqlite.svg" alt="npm"></a>
22-
<a href="https://www.npmjs.com/package/@nativescript-community/sqlite"><img src="https://img.shields.io/npm/dt/@nativescript-community/sqlite.svg?label=npm%20downloads" alt="npm"></a></p>
56+
<ul>
57+
<li><a href="#installation">Installation</a></li>
58+
<li><a href="#usage">Usage</a></li>
59+
</ul>
60+
<p><a href="#installation"></a></p>
2361
<p><a href="#installation"></a></p>
2462

2563
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
2664
<h2>Installation</h2>
2765
</a>
28-
<pre><code><span class="hl-0">ns</span><span class="hl-1"> </span><span class="hl-0">plugin</span><span class="hl-1"> </span><span class="hl-0">add</span><span class="hl-1"> @</span><span class="hl-0">nativescript</span><span class="hl-1">-</span><span class="hl-0">community</span><span class="hl-1">/</span><span class="hl-0">sqlite</span>
29-
</code></pre>
66+
<p>Run the following command from the root of your project:</p>
67+
<p><code>ns plugin add @nativescript-community/sqlite</code></p>
68+
<p><a href="#usage"></a></p>
3069
<p><a href="#usage"></a></p>
3170

3271
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
3372
<h2>Usage</h2>
3473
</a>
3574
<p>You should take care of wrapping sqlite calls to your preferred async option (promises, observables, async/await). And catch any exceptions thrown.</p>
36-
<pre><code class="language-typescript"><span class="hl-2">import</span><span class="hl-1"> { </span><span class="hl-0">openOrCreate</span><span class="hl-1">, </span><span class="hl-0">deleteDatabase</span><span class="hl-1"> } </span><span class="hl-2">from</span><span class="hl-1"> </span><span class="hl-3">&quot;nativescript-akylas-sqlite&quot;</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">sqlite</span><span class="hl-1"> = </span><span class="hl-6">openOrCreate</span><span class="hl-1">(</span><span class="hl-3">&quot;path/to/db&quot;</span><span class="hl-1">);</span><br/><span class="hl-0">sqlite</span><span class="hl-1">.</span><span class="hl-6">execute</span><span class="hl-1">(</span><span class="hl-3">&quot;CREATE TABLE names (id INT, name TEXT)&quot;</span><span class="hl-1">);</span><br/><span class="hl-0">sqlite</span><span class="hl-1">.</span><span class="hl-6">transaction</span><span class="hl-1">(</span><span class="hl-0">cancelTransaction</span><span class="hl-1"> </span><span class="hl-4">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">// Calling cancelTransaction will rollback all changes made to db</span><br/><span class="hl-1"> </span><span class="hl-0">names</span><span class="hl-1">.</span><span class="hl-6">forEach</span><span class="hl-1">((</span><span class="hl-0">name</span><span class="hl-1">, </span><span class="hl-0">id</span><span class="hl-1">) </span><span class="hl-4">=&gt;</span><br/><span class="hl-1"> </span><span class="hl-0">sqlite</span><span class="hl-1">.</span><span class="hl-6">execute</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-3">&quot;INSERT INTO names (id, name) VALUES (?, ?)&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> [</span><span class="hl-0">id</span><span class="hl-1">, </span><span class="hl-0">name</span><span class="hl-1">]</span><br/><span class="hl-1"> )</span><br/><span class="hl-1"> );</span><br/><span class="hl-1">});</span>
75+
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">openOrCreate</span><span class="hl-1">, </span><span class="hl-2">deleteDatabase</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">&quot;@nativescript-community/sqlite&quot;</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">sqlite</span><span class="hl-1"> = </span><span class="hl-6">openOrCreate</span><span class="hl-1">(</span><span class="hl-3">&quot;path/to/db&quot;</span><span class="hl-1">);</span><br/><span class="hl-2">sqlite</span><span class="hl-1">.</span><span class="hl-6">execute</span><span class="hl-1">(</span><span class="hl-3">&quot;CREATE TABLE names (id INT, name TEXT)&quot;</span><span class="hl-1">);</span><br/><span class="hl-2">sqlite</span><span class="hl-1">.</span><span class="hl-6">transaction</span><span class="hl-1">(</span><span class="hl-2">cancelTransaction</span><span class="hl-1"> </span><span class="hl-4">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">// Calling cancelTransaction will rollback all changes made to db</span><br/><span class="hl-1"> </span><span class="hl-2">names</span><span class="hl-1">.</span><span class="hl-6">forEach</span><span class="hl-1">((</span><span class="hl-2">name</span><span class="hl-1">, </span><span class="hl-2">id</span><span class="hl-1">) </span><span class="hl-4">=&gt;</span><br/><span class="hl-1"> </span><span class="hl-2">sqlite</span><span class="hl-1">.</span><span class="hl-6">execute</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-3">&quot;INSERT INTO names (id, name) VALUES (?, ?)&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> [</span><span class="hl-2">id</span><span class="hl-1">, </span><span class="hl-2">name</span><span class="hl-1">]</span><br/><span class="hl-1"> )</span><br/><span class="hl-1"> );</span><br/><span class="hl-1">});</span>
3776
</code></pre>
3877
<p><a href="#demos-and-development"></a></p>
3978

@@ -45,7 +84,7 @@ <h2>Demos and Development</h2>
4584
<h3>Repo Setup</h3>
4685
</a>
4786
<p>The repo uses submodules. If you did not clone with <code> --recursive</code> then you need to call</p>
48-
<pre><code><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-0">submodule</span><span class="hl-1"> </span><span class="hl-0">update</span><span class="hl-1"> --</span><span class="hl-0">init</span>
87+
<pre><code><span class="hl-2">git</span><span class="hl-1"> </span><span class="hl-2">submodule</span><span class="hl-1"> </span><span class="hl-2">update</span><span class="hl-1"> --</span><span class="hl-2">init</span>
4988
</code></pre>
5089
<p>The package manager used to install and link dependencies must be <code>pnpm</code> or <code>yarn</code>. <code>npm</code> wont work.</p>
5190
<p>To develop and test:
@@ -113,7 +152,7 @@ <h3>modifying submodules</h3>
113152
</a>
114153
<p>The repo uses https:// for submodules which means you won&#39;t be able to push directly into the submodules.
115154
One easy solution is t modify <code>~/.gitconfig</code> and add</p>
116-
<pre><code><span class="hl-1">[</span><span class="hl-0">url</span><span class="hl-1"> </span><span class="hl-3">&quot;ssh://git@github.com/&quot;</span><span class="hl-1">]</span><br/><span class="hl-1"> </span><span class="hl-0">pushInsteadOf</span><span class="hl-1"> = </span><span class="hl-8">https</span><span class="hl-1">:</span><span class="hl-7">//github.com/</span>
155+
<pre><code><span class="hl-1">[</span><span class="hl-2">url</span><span class="hl-1"> </span><span class="hl-3">&quot;ssh://git@github.com/&quot;</span><span class="hl-1">]</span><br/><span class="hl-1"> </span><span class="hl-2">pushInsteadOf</span><span class="hl-1"> = </span><span class="hl-8">https</span><span class="hl-1">:</span><span class="hl-7">//github.com/</span>
117156
</code></pre>
118157
<p><a href="#questions"></a></p>
119158

0 commit comments

Comments
 (0)