@nymphjs/driver-sqlite3 1.0.0-beta.11 → 1.0.0-beta.110

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/src/conf/d.ts CHANGED
@@ -23,9 +23,19 @@ export interface SQLite3DriverConfig {
23
23
  */
24
24
  timeout: number;
25
25
  /**
26
- * Open for readonly, which is needed for PubSub.
26
+ * Open explicitly for writing.
27
+ *
28
+ * By default, the driver will always open the DB as readonly, and attempt to
29
+ * open another link to perform write operations. If you know that only one
30
+ * instance will be writing, you can force the driver to open for writing by
31
+ * default, which will block any other instance from opening it for writing.
32
+ *
33
+ * One thing to note is that starting a transaction is a write operation, so
34
+ * as long as an instance is in a transaction, no other instances can write.
35
+ *
36
+ * PubSub also needs to open the DB, and it only needs read access.
27
37
  */
28
- readonly: boolean;
38
+ explicitWrite: boolean;
29
39
  /**
30
40
  * Turn on WAL mode.
31
41
  *
@@ -35,6 +45,20 @@ export interface SQLite3DriverConfig {
35
45
  * See: https://www.sqlite.org/wal.html
36
46
  */
37
47
  wal: boolean;
48
+ /**
49
+ * Additional pragma statements to run upon connection.
50
+ *
51
+ * The default pragmas:
52
+ *
53
+ * - journal_mode = WAL;
54
+ * (if wal is set to true)
55
+ * - encoding = "UTF-8";
56
+ * - foreign_keys = 1;
57
+ * - case_sensitive_like = 1;
58
+ *
59
+ * (Don't include the PRAGMA keyword, but do include the semicolon.)
60
+ */
61
+ pragmas: string[];
38
62
  /**
39
63
  * Function that gets called with every SQL string executed.
40
64
  */
@@ -1,11 +1,12 @@
1
- import { SQLite3DriverConfig } from './d';
1
+ import { SQLite3DriverConfig } from './d.js';
2
2
 
3
3
  export default {
4
4
  filename: ':memory:',
5
5
  fileMustExist: false,
6
6
  prefix: 'nymph_',
7
7
  timeout: 10000,
8
- readonly: false,
8
+ explicitWrite: false,
9
9
  wal: false,
10
+ pragmas: [],
10
11
  verbose: undefined,
11
12
  } as SQLite3DriverConfig;
package/src/conf/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { SQLite3DriverConfig } from './d';
1
+ export { SQLite3DriverConfig } from './d.js';
2
2
 
3
- import defaults from './defaults';
3
+ import defaults from './defaults.js';
4
4
  export { defaults as SQLite3DriverConfigDefaults };
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './conf';
1
+ export * from './conf/index.js';
2
2
 
3
- import SQLite3Driver from './SQLite3Driver';
3
+ import SQLite3Driver from './SQLite3Driver.js';
4
4
  export { SQLite3Driver };
5
5
  export default SQLite3Driver;
package/tsconfig.json CHANGED
@@ -2,10 +2,12 @@
2
2
  "extends": "@tsconfig/recommended/tsconfig.json",
3
3
 
4
4
  "compilerOptions": {
5
- "lib": ["ES2021"],
6
- "target": "ES2021",
5
+ "module": "ES2022",
6
+ "moduleResolution": "node",
7
+ "lib": ["ES2022"],
8
+ "target": "ES2022",
7
9
  "noImplicitAny": true,
8
- "removeComments": true,
10
+ "removeComments": false,
9
11
  "sourceMap": true,
10
12
  "outDir": "dist",
11
13
  "resolveJsonModule": true,
package/typedoc.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["../../typedoc.base.json"],
3
+ "entryPoints": ["src/index.ts"]
4
+ }