@powersync/web 0.0.0-dev-20241203152232 → 0.0.0-dev-20250127153955

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 (41) hide show
  1. package/README.md +33 -0
  2. package/dist/3cb48be086dd9edd02ff.wasm +0 -0
  3. package/dist/df958358cadf945bd0fe.wasm +0 -0
  4. package/dist/f9c8ada26c59f5bf4339.wasm +0 -0
  5. package/dist/fe5693c7678cf12e05ac.wasm +0 -0
  6. package/dist/index.umd.js +245 -25
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/worker/SharedSyncImplementation.umd.js +6 -5
  9. package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
  10. package/dist/worker/WASQLiteDB.umd.js +73 -17
  11. package/dist/worker/WASQLiteDB.umd.js.map +1 -1
  12. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js +45 -0
  13. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map +1 -0
  14. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js +45 -0
  15. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map +1 -0
  16. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js +2 -2
  17. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map +1 -1
  18. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +2 -2
  19. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +1 -1
  20. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js +39 -0
  21. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map +1 -1
  22. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js +39 -0
  23. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map +1 -1
  24. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js +39 -0
  25. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map +1 -1
  26. package/lib/package.json +5 -5
  27. package/lib/src/db/PowerSyncDatabase.d.ts +9 -1
  28. package/lib/src/db/PowerSyncDatabase.js +15 -2
  29. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +1 -0
  30. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +1 -0
  31. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +12 -2
  32. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js +66 -12
  33. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.d.ts +5 -0
  34. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +3 -1
  35. package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +29 -5
  36. package/lib/src/db/adapters/web-sql-flags.d.ts +10 -0
  37. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +1 -2
  38. package/lib/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +6 -6
  40. package/dist/24cd027f23123a1360de.wasm +0 -0
  41. package/dist/f042552714d86563f127.wasm +0 -0
package/README.md CHANGED
@@ -28,6 +28,39 @@ Install it in your app with:
28
28
  npm install @journeyapps/wa-sqlite
29
29
  ```
30
30
 
31
+ ### Encryption with Multiple Ciphers
32
+
33
+ To enable encryption you need to specify an encryption key when instantiating the PowerSync database.
34
+
35
+ > The PowerSync Web SDK uses the ChaCha20 cipher algorithm by [default](https://utelle.github.io/SQLite3MultipleCiphers/docs/ciphers/cipher_chacha20/).
36
+
37
+ ```typescript
38
+ export const db = new PowerSyncDatabase({
39
+ // The schema you defined
40
+ schema: AppSchema,
41
+ database: {
42
+ // Filename for the SQLite database — it's important to only instantiate one instance per file.
43
+ dbFilename: 'example.db'
44
+ // Optional. Directory where the database file is located.'
45
+ // dbLocation: 'path/to/directory'
46
+ },
47
+ // Encryption key for the database.
48
+ encryptionKey: 'your-encryption-key'
49
+ });
50
+
51
+ // If you are using a custom WASQLiteOpenFactory or WASQLiteDBAdapter, you need specify the encryption key inside the construtor
52
+ export const db = new PowerSyncDatabase({
53
+ schema: AppSchema,
54
+ database: new WASQLiteOpenFactory({
55
+ //new WASQLiteDBAdapter
56
+ dbFilename: 'example.db',
57
+ vfs: WASQLiteVFS.OPFSCoopSyncVFS,
58
+ // Encryption key for the database.
59
+ encryptionKey: 'your-encryption-key'
60
+ })
61
+ });
62
+ ```
63
+
31
64
  ## Webpack
32
65
 
33
66
  See the [example Webpack config](https://github.com/powersync-ja/powersync-js/blob/main/demos/example-webpack/webpack.config.js) for details on polyfills and requirements.
Binary file
Binary file
Binary file
Binary file