@rljson/io-sqlite 0.0.12 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.architecture.md +9 -0
- package/dist/README.blog.md +11 -0
- package/dist/README.contributors.md +32 -0
- package/dist/README.md +24 -0
- package/dist/README.piano.md +42 -0
- package/dist/README.public.md +15 -0
- package/dist/README.trouble.md +23 -0
- package/dist/example.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/io-sqlite.d.ts +60 -0
- package/dist/io-sqlite.js +3128 -0
- package/dist/sql-statements.d.ts +40 -0
- package/dist/src/example.ts +26 -0
- package/package.json +63 -69
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2025 Rljson
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# Contributors Guide
|
|
10
|
+
|
|
11
|
+
- [Prepare](#prepare)
|
|
12
|
+
- [Develop](#develop)
|
|
13
|
+
- [Administrate](#administrate)
|
|
14
|
+
- [Fast Coding](#fast-coding)
|
|
15
|
+
|
|
16
|
+
## Prepare
|
|
17
|
+
|
|
18
|
+
Read [prepare.md](doc/prepare.md)
|
|
19
|
+
|
|
20
|
+
<!-- ........................................................................-->
|
|
21
|
+
|
|
22
|
+
## Develop
|
|
23
|
+
|
|
24
|
+
Read [develop.md](doc/develop.md)
|
|
25
|
+
|
|
26
|
+
## Administrate
|
|
27
|
+
|
|
28
|
+
Read [create-new-repo.md](doc/create-new-repo.md)
|
|
29
|
+
|
|
30
|
+
## Fast Coding
|
|
31
|
+
|
|
32
|
+
Read [fast-coding-guide.md](doc/fast-coding-guide.md)
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2025 Rljson
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @rljson/io-sqlite
|
|
10
|
+
|
|
11
|
+
## Users
|
|
12
|
+
|
|
13
|
+
| File | Purpose |
|
|
14
|
+
| ------------------------------------ | --------------------------- |
|
|
15
|
+
| [README.public.md](README.public.md) | Install and use the package |
|
|
16
|
+
|
|
17
|
+
## Contributors
|
|
18
|
+
|
|
19
|
+
| File | Purpose |
|
|
20
|
+
| ------------------------------------------------ | ----------------------------- |
|
|
21
|
+
| [README.contributors.md](README.contributors.md) | Run, debug, build and publish |
|
|
22
|
+
| [README.architecture.md](README.architecture.md) | Software architecture guide |
|
|
23
|
+
| [README.trouble.md](README.trouble.md) | Errors & solutions |
|
|
24
|
+
| [README.blog.md](README.blog.md) | Blog |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2025 Rljson
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# Coding like a pianist
|
|
10
|
+
|
|
11
|
+
Tricks and tips for high performance coders
|
|
12
|
+
|
|
13
|
+
## Content <!-- omit in toc -->
|
|
14
|
+
|
|
15
|
+
- [Vscode](#vscode)
|
|
16
|
+
- [Quick open files](#quick-open-files)
|
|
17
|
+
- [Multi cursor search and replace](#multi-cursor-search-and-replace)
|
|
18
|
+
|
|
19
|
+
## Vscode
|
|
20
|
+
|
|
21
|
+
### Quick open files
|
|
22
|
+
|
|
23
|
+
❌ Don't open files by clicking through the folder hierarchy.
|
|
24
|
+
|
|
25
|
+
✅ Quick open files by pressing `Cmd+Shift+P`, entering fragments of the
|
|
26
|
+
file name and pressing `enter`.
|
|
27
|
+
|
|
28
|
+
### Multi cursor search and replace
|
|
29
|
+
|
|
30
|
+
❌ Don't use `Cmd+F` to search and replace files
|
|
31
|
+
|
|
32
|
+
✅ Double click a word to be searched and replaced
|
|
33
|
+
|
|
34
|
+
Press `Ctrl+ddd...` to create a multi cursor on all occurrences of the word
|
|
35
|
+
|
|
36
|
+
Modify the word
|
|
37
|
+
|
|
38
|
+
Press `ESC` to finish multi cursor edit
|
|
39
|
+
|
|
40
|
+
When doing this the first time, search will not be case sensitive
|
|
41
|
+
|
|
42
|
+
Press `Cmd+F`, click `Aa` to make `Ctrl+d` multi case sensitive
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2025 Rljson
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @rljson/io-sqlite
|
|
10
|
+
|
|
11
|
+
Todo: Add description here
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
[src/example.ts](src/example.ts)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2025 Rljson
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# Trouble shooting
|
|
10
|
+
|
|
11
|
+
## Table of contents <!-- omit in toc -->
|
|
12
|
+
|
|
13
|
+
- [Vscode Windows: Debugging is not working](#vscode-windows-debugging-is-not-working)
|
|
14
|
+
|
|
15
|
+
## Vscode Windows: Debugging is not working
|
|
16
|
+
|
|
17
|
+
Date: 2025-03-08
|
|
18
|
+
|
|
19
|
+
⚠️ IMPORTANT: On Windows, please check out the repo on drive C. There is a bug
|
|
20
|
+
in the VS Code Vitest extension (v1.14.4), which prevents test debugging from
|
|
21
|
+
working: <https://github.com/vitest-dev/vscode/issues/548> Please check from
|
|
22
|
+
time to time if the issue has been fixed and remove this note once it is
|
|
23
|
+
resolved.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const example: () => void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Io } from '@rljson/io';
|
|
2
|
+
import { Json, JsonValue } from '@rljson/json';
|
|
3
|
+
import { ContentType, Rljson, TableCfg, TableKey } from '@rljson/rljson';
|
|
4
|
+
import { Database } from 'sql.js';
|
|
5
|
+
export declare class IoSqlite implements Io {
|
|
6
|
+
private _ioTools;
|
|
7
|
+
private _isReady;
|
|
8
|
+
private _sql;
|
|
9
|
+
private _map;
|
|
10
|
+
constructor();
|
|
11
|
+
init(): Promise<void>;
|
|
12
|
+
db: Database;
|
|
13
|
+
/**
|
|
14
|
+
* Returns an example database
|
|
15
|
+
*/
|
|
16
|
+
static example: () => Promise<IoSqlite>;
|
|
17
|
+
contentType(request: {
|
|
18
|
+
table: string;
|
|
19
|
+
}): Promise<ContentType>;
|
|
20
|
+
deleteDatabase(): Promise<void>;
|
|
21
|
+
isReady(): Promise<void>;
|
|
22
|
+
dump(): Promise<Rljson>;
|
|
23
|
+
dumpTable(request: {
|
|
24
|
+
table: string;
|
|
25
|
+
}): Promise<Rljson>;
|
|
26
|
+
readRows(request: {
|
|
27
|
+
table: string;
|
|
28
|
+
where: {
|
|
29
|
+
[column: string]: JsonValue;
|
|
30
|
+
};
|
|
31
|
+
}): Promise<Rljson>;
|
|
32
|
+
rowCount(table: string): Promise<number>;
|
|
33
|
+
tableExists(tableKey: TableKey): Promise<boolean>;
|
|
34
|
+
rawTableCfgs(): Promise<TableCfg[]>;
|
|
35
|
+
alltableKeys(): Promise<string[]>;
|
|
36
|
+
write(request: {
|
|
37
|
+
data: Rljson;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
createOrExtendTable(request: {
|
|
40
|
+
tableCfg: TableCfg;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
private _initTableCfgs;
|
|
43
|
+
private _createOrExtendTable;
|
|
44
|
+
private _createTable;
|
|
45
|
+
private _insertTableCfg;
|
|
46
|
+
_addMissingHashes(rljson: Json): void;
|
|
47
|
+
private _extendTable;
|
|
48
|
+
private _readRows;
|
|
49
|
+
private _serializeRow;
|
|
50
|
+
private _parseData;
|
|
51
|
+
parseDataTest(data: Json[], tableCfg: TableCfg): Json[];
|
|
52
|
+
private _dump;
|
|
53
|
+
private _dumpTable;
|
|
54
|
+
private _write;
|
|
55
|
+
_tableExists(tableKey: string): Promise<boolean>;
|
|
56
|
+
_whereString(whereClause: [string, JsonValue][]): string;
|
|
57
|
+
private _isOpen;
|
|
58
|
+
get isOpen(): boolean;
|
|
59
|
+
close(): Promise<void>;
|
|
60
|
+
}
|