@powersync/op-sqlite 0.0.0-dev-20260202162549 → 0.0.0-dev-20260216124709

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.
Files changed (45) hide show
  1. package/lib/commonjs/db/OPSQLiteConnection.js +106 -0
  2. package/lib/commonjs/db/OPSQLiteConnection.js.map +1 -0
  3. package/lib/commonjs/db/OPSqliteAdapter.js +261 -0
  4. package/lib/commonjs/db/OPSqliteAdapter.js.map +1 -0
  5. package/lib/commonjs/db/OPSqliteDBOpenFactory.js +26 -0
  6. package/lib/commonjs/db/OPSqliteDBOpenFactory.js.map +1 -0
  7. package/lib/commonjs/db/SqliteOptions.js +41 -0
  8. package/lib/commonjs/db/SqliteOptions.js.map +1 -0
  9. package/lib/commonjs/index.js +19 -0
  10. package/lib/commonjs/index.js.map +1 -0
  11. package/lib/commonjs/package.json +1 -0
  12. package/lib/module/db/OPSQLiteConnection.js +101 -0
  13. package/lib/module/db/OPSQLiteConnection.js.map +1 -0
  14. package/lib/module/db/OPSqliteAdapter.js +257 -0
  15. package/lib/module/db/OPSqliteAdapter.js.map +1 -0
  16. package/lib/module/db/OPSqliteDBOpenFactory.js +21 -0
  17. package/lib/module/db/OPSqliteDBOpenFactory.js.map +1 -0
  18. package/lib/module/db/SqliteOptions.js +39 -0
  19. package/lib/module/db/SqliteOptions.js.map +1 -0
  20. package/lib/module/index.js +4 -0
  21. package/lib/module/index.js.map +1 -0
  22. package/lib/module/package.json +1 -0
  23. package/lib/typescript/commonjs/package.json +1 -0
  24. package/lib/typescript/commonjs/src/db/OPSQLiteConnection.d.ts +28 -0
  25. package/lib/typescript/commonjs/src/db/OPSQLiteConnection.d.ts.map +1 -0
  26. package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts +46 -0
  27. package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts.map +1 -0
  28. package/lib/typescript/commonjs/src/db/OPSqliteDBOpenFactory.d.ts +12 -0
  29. package/lib/typescript/commonjs/src/db/OPSqliteDBOpenFactory.d.ts.map +1 -0
  30. package/lib/typescript/commonjs/src/db/SqliteOptions.d.ts +69 -0
  31. package/lib/typescript/commonjs/src/db/SqliteOptions.d.ts.map +1 -0
  32. package/lib/typescript/commonjs/src/index.d.ts +2 -0
  33. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  34. package/lib/typescript/module/package.json +1 -0
  35. package/lib/typescript/module/src/db/OPSQLiteConnection.d.ts +28 -0
  36. package/lib/typescript/module/src/db/OPSQLiteConnection.d.ts.map +1 -0
  37. package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts +46 -0
  38. package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts.map +1 -0
  39. package/lib/typescript/module/src/db/OPSqliteDBOpenFactory.d.ts +12 -0
  40. package/lib/typescript/module/src/db/OPSqliteDBOpenFactory.d.ts.map +1 -0
  41. package/lib/typescript/module/src/db/SqliteOptions.d.ts +69 -0
  42. package/lib/typescript/module/src/db/SqliteOptions.d.ts.map +1 -0
  43. package/lib/typescript/module/src/index.d.ts +2 -0
  44. package/lib/typescript/module/src/index.d.ts.map +1 -0
  45. package/package.json +3 -3
@@ -0,0 +1,12 @@
1
+ import { DBAdapter, SQLOpenFactory, SQLOpenOptions } from '@powersync/common';
2
+ import { SqliteOptions } from './SqliteOptions';
3
+ export interface OPSQLiteOpenFactoryOptions extends SQLOpenOptions {
4
+ sqliteOptions?: SqliteOptions;
5
+ }
6
+ export declare class OPSqliteOpenFactory implements SQLOpenFactory {
7
+ protected options: OPSQLiteOpenFactoryOptions;
8
+ private sqliteOptions;
9
+ constructor(options: OPSQLiteOpenFactoryOptions);
10
+ openDB(): DBAdapter;
11
+ }
12
+ //# sourceMappingURL=OPSqliteDBOpenFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OPSqliteDBOpenFactory.d.ts","sourceRoot":"","sources":["../../../../../src/db/OPSqliteDBOpenFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAA0B,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IAChE,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AACD,qBAAa,mBAAoB,YAAW,cAAc;IAG5C,SAAS,CAAC,OAAO,EAAE,0BAA0B;IAFzD,OAAO,CAAC,aAAa,CAA0B;gBAEzB,OAAO,EAAE,0BAA0B;IAOzD,MAAM,IAAI,SAAS;CAOpB"}
@@ -0,0 +1,69 @@
1
+ export interface SqliteOptions {
2
+ /**
3
+ * SQLite journal mode. Defaults to [SqliteJournalMode.wal].
4
+ */
5
+ journalMode?: SqliteJournalMode;
6
+ /**
7
+ * SQLite synchronous flag. Defaults to [SqliteSynchronous.normal], which
8
+ * is safe for WAL mode.
9
+ */
10
+ synchronous?: SqliteSynchronous;
11
+ /**
12
+ * Journal/WAL size limit. Defaults to 6MB.
13
+ * The WAL may grow larger than this limit during writes, but SQLite will
14
+ * attempt to truncate the file afterwards.
15
+ */
16
+ journalSizeLimit?: number;
17
+ /**
18
+ * Timeout in milliseconds waiting for locks to be released by other connections.
19
+ * Defaults to 30 seconds.
20
+ * Set to null or zero to fail immediately when the database is locked.
21
+ */
22
+ lockTimeoutMs?: number;
23
+ /**
24
+ * Encryption key for the database.
25
+ * If set, the database will be encrypted using SQLCipher.
26
+ */
27
+ encryptionKey?: string | null;
28
+ /**
29
+ * Where to store SQLite temporary files. Defaults to 'MEMORY'.
30
+ * Setting this to `FILESYSTEM` can cause issues with larger queries or datasets.
31
+ *
32
+ * For details, see: https://www.sqlite.org/pragma.html#pragma_temp_store
33
+ */
34
+ temporaryStorage?: TemporaryStorageOption;
35
+ /**
36
+ * Maximum SQLite cache size. Defaults to 50MB.
37
+ *
38
+ * For details, see: https://www.sqlite.org/pragma.html#pragma_cache_size
39
+ */
40
+ cacheSizeKb?: number;
41
+ /**
42
+ * Load extensions using the path and entryPoint.
43
+ * More info can be found here https://op-engineering.github.io/op-sqlite/docs/api#loading-extensions.
44
+ */
45
+ extensions?: Array<{
46
+ path: string;
47
+ entryPoint?: string;
48
+ }>;
49
+ }
50
+ export declare enum TemporaryStorageOption {
51
+ MEMORY = "memory",
52
+ FILESYSTEM = "file"
53
+ }
54
+ declare enum SqliteJournalMode {
55
+ wal = "WAL",
56
+ delete = "DELETE",
57
+ truncate = "TRUNCATE",
58
+ persist = "PERSIST",
59
+ memory = "MEMORY",
60
+ off = "OFF"
61
+ }
62
+ declare enum SqliteSynchronous {
63
+ normal = "NORMAL",
64
+ full = "FULL",
65
+ off = "OFF"
66
+ }
67
+ export declare const DEFAULT_SQLITE_OPTIONS: Required<SqliteOptions>;
68
+ export {};
69
+ //# sourceMappingURL=SqliteOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteOptions.d.ts","sourceRoot":"","sources":["../../../../../src/db/SqliteOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAE1C;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,UAAU,SAAS;CACpB;AAKD,aAAK,iBAAiB;IAGpB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAGD,aAAK,iBAAiB;IACpB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,aAAa,CAS1D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { OPSqliteOpenFactory, OPSQLiteOpenFactoryOptions } from './db/OPSqliteDBOpenFactory';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powersync/op-sqlite",
3
- "version": "0.0.0-dev-20260202162549",
3
+ "version": "0.0.0-dev-20260216124709",
4
4
  "description": "PowerSync - sync Postgres or MongoDB with SQLite in your React Native app for offline-first and real-time data",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/commonjs/index.js",
@@ -59,13 +59,13 @@
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@op-engineering/op-sqlite": "^13.0.0 || ^14.0.0 || ^15.0.0",
62
- "@powersync/common": "0.0.0-dev-20260202162549",
62
+ "@powersync/common": "0.0.0-dev-20260216124709",
63
63
  "react": "*",
64
64
  "react-native": "*"
65
65
  },
66
66
  "dependencies": {
67
67
  "async-mutex": "^0.5.0",
68
- "@powersync/common": "0.0.0-dev-20260202162549"
68
+ "@powersync/common": "0.0.0-dev-20260216124709"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@op-engineering/op-sqlite": "^15.2.2",