@symbiote-native/sqlite 0.1.0

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 (128) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +283 -0
  3. package/build/angular/index.d.ts +2 -0
  4. package/build/angular/index.js +2 -0
  5. package/build/angular/sqlite.service.d.ts +41 -0
  6. package/build/angular/sqlite.service.js +127 -0
  7. package/build/core/index.d.ts +10 -0
  8. package/build/core/index.js +6 -0
  9. package/build/core/native-database.d.ts +65 -0
  10. package/build/core/native-database.js +13 -0
  11. package/build/core/native-module.d.ts +25 -0
  12. package/build/core/native-module.js +17 -0
  13. package/build/core/native-session.d.ts +20 -0
  14. package/build/core/native-session.js +1 -0
  15. package/build/core/native-statement.d.ts +45 -0
  16. package/build/core/native-statement.js +6 -0
  17. package/build/core/param-utils.d.ts +28 -0
  18. package/build/core/param-utils.js +126 -0
  19. package/build/core/path-utils.d.ts +6 -0
  20. package/build/core/path-utils.js +29 -0
  21. package/build/core/query-utils.d.ts +17 -0
  22. package/build/core/query-utils.js +37 -0
  23. package/build/core/sqlite-database.d.ts +246 -0
  24. package/build/core/sqlite-database.js +427 -0
  25. package/build/core/sqlite-session.d.ts +84 -0
  26. package/build/core/sqlite-session.js +121 -0
  27. package/build/core/sqlite-statement.d.ts +96 -0
  28. package/build/core/sqlite-statement.js +321 -0
  29. package/build/core/sqlite-tagged-query.d.ts +73 -0
  30. package/build/core/sqlite-tagged-query.js +119 -0
  31. package/build/core/storage.d.ts +107 -0
  32. package/build/core/storage.js +382 -0
  33. package/build/core/types.d.ts +30 -0
  34. package/build/core/types.js +1 -0
  35. package/build/react/index.d.ts +2 -0
  36. package/build/react/index.js +2 -0
  37. package/build/react/sqlite-context.d.ts +25 -0
  38. package/build/react/sqlite-context.js +129 -0
  39. package/build/solid/index.d.ts +2 -0
  40. package/build/solid/index.js +2 -0
  41. package/build/solid/sqlite-context.d.ts +23 -0
  42. package/build/solid/sqlite-context.js +106 -0
  43. package/build/svelte/SQLiteProvider.svelte +88 -0
  44. package/build/svelte/SQLiteProvider.svelte.d.ts +13 -0
  45. package/build/svelte/index.d.ts +3 -0
  46. package/build/svelte/index.js +5 -0
  47. package/build/svelte/sqlite-context.d.ts +11 -0
  48. package/build/svelte/sqlite-context.js +23 -0
  49. package/build/vue/index.d.ts +2 -0
  50. package/build/vue/index.js +2 -0
  51. package/build/vue/sqlite-context.d.ts +21 -0
  52. package/build/vue/sqlite-context.js +69 -0
  53. package/build-ngc/angular/index.d.ts +2 -0
  54. package/build-ngc/angular/index.js +3 -0
  55. package/build-ngc/angular/index.js.map +1 -0
  56. package/build-ngc/angular/sqlite.service.d.ts +44 -0
  57. package/build-ngc/angular/sqlite.service.js +85 -0
  58. package/build-ngc/angular/sqlite.service.js.map +1 -0
  59. package/build-ngc/core/index.d.ts +10 -0
  60. package/build-ngc/core/index.js +7 -0
  61. package/build-ngc/core/index.js.map +1 -0
  62. package/build-ngc/core/native-database.d.ts +65 -0
  63. package/build-ngc/core/native-database.js +14 -0
  64. package/build-ngc/core/native-database.js.map +1 -0
  65. package/build-ngc/core/native-module.d.ts +25 -0
  66. package/build-ngc/core/native-module.js +18 -0
  67. package/build-ngc/core/native-module.js.map +1 -0
  68. package/build-ngc/core/native-session.d.ts +20 -0
  69. package/build-ngc/core/native-session.js +2 -0
  70. package/build-ngc/core/native-session.js.map +1 -0
  71. package/build-ngc/core/native-statement.d.ts +45 -0
  72. package/build-ngc/core/native-statement.js +7 -0
  73. package/build-ngc/core/native-statement.js.map +1 -0
  74. package/build-ngc/core/param-utils.d.ts +28 -0
  75. package/build-ngc/core/param-utils.js +127 -0
  76. package/build-ngc/core/param-utils.js.map +1 -0
  77. package/build-ngc/core/path-utils.d.ts +6 -0
  78. package/build-ngc/core/path-utils.js +30 -0
  79. package/build-ngc/core/path-utils.js.map +1 -0
  80. package/build-ngc/core/query-utils.d.ts +17 -0
  81. package/build-ngc/core/query-utils.js +38 -0
  82. package/build-ngc/core/query-utils.js.map +1 -0
  83. package/build-ngc/core/sqlite-database.d.ts +246 -0
  84. package/build-ngc/core/sqlite-database.js +428 -0
  85. package/build-ngc/core/sqlite-database.js.map +1 -0
  86. package/build-ngc/core/sqlite-session.d.ts +84 -0
  87. package/build-ngc/core/sqlite-session.js +122 -0
  88. package/build-ngc/core/sqlite-session.js.map +1 -0
  89. package/build-ngc/core/sqlite-statement.d.ts +96 -0
  90. package/build-ngc/core/sqlite-statement.js +322 -0
  91. package/build-ngc/core/sqlite-statement.js.map +1 -0
  92. package/build-ngc/core/sqlite-tagged-query.d.ts +73 -0
  93. package/build-ngc/core/sqlite-tagged-query.js +120 -0
  94. package/build-ngc/core/sqlite-tagged-query.js.map +1 -0
  95. package/build-ngc/core/storage.d.ts +107 -0
  96. package/build-ngc/core/storage.js +383 -0
  97. package/build-ngc/core/storage.js.map +1 -0
  98. package/build-ngc/core/types.d.ts +30 -0
  99. package/build-ngc/core/types.js +2 -0
  100. package/build-ngc/core/types.js.map +1 -0
  101. package/native-link.json +12 -0
  102. package/package.json +141 -0
  103. package/src/angular/index.ts +2 -0
  104. package/src/angular/sqlite.service.ts +114 -0
  105. package/src/core/index.ts +40 -0
  106. package/src/core/native-database.ts +118 -0
  107. package/src/core/native-module.ts +57 -0
  108. package/src/core/native-session.ts +64 -0
  109. package/src/core/native-statement.ts +85 -0
  110. package/src/core/param-utils.ts +163 -0
  111. package/src/core/path-utils.ts +38 -0
  112. package/src/core/query-utils.ts +45 -0
  113. package/src/core/sqlite-database.ts +676 -0
  114. package/src/core/sqlite-session.ts +165 -0
  115. package/src/core/sqlite-statement.ts +578 -0
  116. package/src/core/sqlite-tagged-query.ts +160 -0
  117. package/src/core/storage.ts +492 -0
  118. package/src/core/types.ts +33 -0
  119. package/src/react/index.ts +2 -0
  120. package/src/react/sqlite-context.tsx +244 -0
  121. package/src/solid/index.ts +2 -0
  122. package/src/solid/sqlite-context.ts +156 -0
  123. package/src/svelte/SQLiteProvider.svelte +88 -0
  124. package/src/svelte/index.ts +6 -0
  125. package/src/svelte/sqlite-context.ts +32 -0
  126. package/src/svelte/svelte-compile.test-helper.ts +135 -0
  127. package/src/vue/index.ts +2 -0
  128. package/src/vue/sqlite-context.ts +105 -0
@@ -0,0 +1,383 @@
1
+ // Ported from expo-sqlite's Storage.ts (.vendors/expo @ origin/sdk-57,
2
+ // packages/expo-sqlite/src/Storage.ts), renamed with this repo's `I`-prefix convention.
3
+ //
4
+ // Published on its own subpath (`@symbiote-native/sqlite/kv-store`) rather than the package
5
+ // root — see the README for why.
6
+ import AwaitLock from 'await-lock';
7
+ import { openDatabaseAsync, openDatabaseSync } from './sqlite-database';
8
+ import { normalizeStorageIndex } from './param-utils';
9
+ const DATABASE_VERSION = 1;
10
+ const STATEMENT_GET = 'SELECT value FROM storage WHERE key = ?;';
11
+ const STATEMENT_SET = 'INSERT INTO storage (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value;';
12
+ const STATEMENT_REMOVE = 'DELETE FROM storage WHERE key = ?;';
13
+ const STATEMENT_GET_ALL_KEYS = 'SELECT key FROM storage;';
14
+ const STATEMENT_CLEAR = 'DELETE FROM storage;';
15
+ const STATEMENT_LENGTH = 'SELECT COUNT(*) as count FROM storage;';
16
+ const STATEMENT_GET_KEY_BY_INDEX = 'SELECT key FROM storage LIMIT 1 OFFSET ?;';
17
+ const MIGRATION_STATEMENT_0 = 'CREATE TABLE IF NOT EXISTS storage (key TEXT PRIMARY KEY NOT NULL, value TEXT);';
18
+ /**
19
+ * A key-value store backed by SQLite. The constructor's `databaseName` is the database file
20
+ * name used for storage.
21
+ */
22
+ export class SQLiteStorage {
23
+ databaseName;
24
+ db = null;
25
+ awaitLock = new AwaitLock();
26
+ constructor(databaseName) {
27
+ this.databaseName = databaseName;
28
+ }
29
+ //#region Asynchronous API
30
+ /** Retrieves the value for the given key. */
31
+ async getItemAsync(key) {
32
+ this.checkValidInput(key);
33
+ const db = await this.getDbAsync();
34
+ const result = await db.getFirstAsync(STATEMENT_GET, key);
35
+ return result?.value ?? null;
36
+ }
37
+ /**
38
+ * Sets the value for the given key. A function computes the new value from the previous one.
39
+ */
40
+ async setItemAsync(key, value) {
41
+ this.checkValidInput(key, value);
42
+ const db = await this.getDbAsync();
43
+ if (typeof value === 'function') {
44
+ await db.withExclusiveTransactionAsync(async (tx) => {
45
+ const prevResult = await tx.getFirstAsync(STATEMENT_GET, key);
46
+ const prevValue = prevResult?.value ?? null;
47
+ const nextValue = value(prevValue);
48
+ this.checkValidInput(key, nextValue);
49
+ await tx.runAsync(STATEMENT_SET, key, nextValue);
50
+ });
51
+ return;
52
+ }
53
+ await db.runAsync(STATEMENT_SET, key, value);
54
+ }
55
+ /** Removes the value for the given key. Returns whether a row was actually removed. */
56
+ async removeItemAsync(key) {
57
+ this.checkValidInput(key);
58
+ const db = await this.getDbAsync();
59
+ const result = await db.runAsync(STATEMENT_REMOVE, key);
60
+ return result.changes > 0;
61
+ }
62
+ /** Retrieves every key stored. */
63
+ async getAllKeysAsync() {
64
+ const db = await this.getDbAsync();
65
+ const result = await db.getAllAsync(STATEMENT_GET_ALL_KEYS);
66
+ return result.map(({ key }) => key);
67
+ }
68
+ /** Clears every key-value pair. Returns whether anything was actually cleared. */
69
+ async clearAsync() {
70
+ const db = await this.getDbAsync();
71
+ const result = await db.runAsync(STATEMENT_CLEAR);
72
+ return result.changes > 0;
73
+ }
74
+ /** Closes the database connection. */
75
+ async closeAsync() {
76
+ await this.awaitLock.acquireAsync();
77
+ try {
78
+ if (this.db) {
79
+ await this.db.closeAsync();
80
+ this.db = null;
81
+ }
82
+ }
83
+ finally {
84
+ this.awaitLock.release();
85
+ }
86
+ }
87
+ /** Retrieves the number of key-value pairs stored. */
88
+ async getLengthAsync() {
89
+ const db = await this.getDbAsync();
90
+ const result = await db.getFirstAsync(STATEMENT_LENGTH);
91
+ return result?.count ?? 0;
92
+ }
93
+ /** Retrieves the key at the given index. */
94
+ async getKeyByIndexAsync(index) {
95
+ const db = await this.getDbAsync();
96
+ const offset = normalizeStorageIndex(index);
97
+ if (offset == null) {
98
+ return null;
99
+ }
100
+ const result = await db.getFirstAsync(STATEMENT_GET_KEY_BY_INDEX, offset);
101
+ return result?.key ?? null;
102
+ }
103
+ //#endregion
104
+ //#region Synchronous API
105
+ /**
106
+ * Retrieves the value for the given key.
107
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
108
+ */
109
+ getItemSync(key) {
110
+ this.checkValidInput(key);
111
+ const db = this.getDbSync();
112
+ const result = db.getFirstSync(STATEMENT_GET, key);
113
+ return result?.value ?? null;
114
+ }
115
+ /**
116
+ * Sets the value for the given key. A function computes the new value from the previous one.
117
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
118
+ */
119
+ setItemSync(key, value) {
120
+ this.checkValidInput(key, value);
121
+ const db = this.getDbSync();
122
+ if (typeof value === 'function') {
123
+ db.withTransactionSync(() => {
124
+ const prevResult = db.getFirstSync(STATEMENT_GET, key);
125
+ const prevValue = prevResult?.value ?? null;
126
+ const nextValue = value(prevValue);
127
+ this.checkValidInput(key, nextValue);
128
+ db.runSync(STATEMENT_SET, key, nextValue);
129
+ });
130
+ return;
131
+ }
132
+ db.runSync(STATEMENT_SET, key, value);
133
+ }
134
+ /**
135
+ * Removes the value for the given key. Returns whether a row was actually removed.
136
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
137
+ */
138
+ removeItemSync(key) {
139
+ this.checkValidInput(key);
140
+ const db = this.getDbSync();
141
+ const result = db.runSync(STATEMENT_REMOVE, key);
142
+ return result.changes > 0;
143
+ }
144
+ /**
145
+ * Retrieves every key stored.
146
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
147
+ */
148
+ getAllKeysSync() {
149
+ const db = this.getDbSync();
150
+ const result = db.getAllSync(STATEMENT_GET_ALL_KEYS);
151
+ return result.map(({ key }) => key);
152
+ }
153
+ /**
154
+ * Clears every key-value pair. Returns whether anything was actually cleared.
155
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
156
+ */
157
+ clearSync() {
158
+ const db = this.getDbSync();
159
+ const result = db.runSync(STATEMENT_CLEAR);
160
+ return result.changes > 0;
161
+ }
162
+ /**
163
+ * Closes the database connection.
164
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
165
+ */
166
+ closeSync() {
167
+ if (this.db) {
168
+ this.db.closeSync();
169
+ this.db = null;
170
+ }
171
+ }
172
+ /**
173
+ * Retrieves the number of key-value pairs stored.
174
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
175
+ */
176
+ getLengthSync() {
177
+ const db = this.getDbSync();
178
+ const result = db.getFirstSync(STATEMENT_LENGTH);
179
+ return result?.count ?? 0;
180
+ }
181
+ /**
182
+ * Retrieves the key at the given index.
183
+ * > **Note:** Running heavy tasks with this function can block the JavaScript thread.
184
+ */
185
+ getKeyByIndexSync(index) {
186
+ const db = this.getDbSync();
187
+ const offset = normalizeStorageIndex(index);
188
+ if (offset == null) {
189
+ return null;
190
+ }
191
+ const result = db.getFirstSync(STATEMENT_GET_KEY_BY_INDEX, offset);
192
+ return result?.key ?? null;
193
+ }
194
+ //#endregion
195
+ //#region react-native-async-storage compatible API
196
+ /** Alias for `getItemAsync()`. */
197
+ async getItem(key) {
198
+ return this.getItemAsync(key);
199
+ }
200
+ /** Alias for `setItemAsync()`. */
201
+ async setItem(key, value) {
202
+ await this.setItemAsync(key, value);
203
+ }
204
+ /** Alias for `removeItemAsync()`. */
205
+ async removeItem(key) {
206
+ await this.removeItemAsync(key);
207
+ }
208
+ /** Alias for `getAllKeysAsync()`. */
209
+ async getAllKeys() {
210
+ return this.getAllKeysAsync();
211
+ }
212
+ /** Alias for `clearAsync()`. */
213
+ async clear() {
214
+ await this.clearAsync();
215
+ }
216
+ /** Merges the given value with the existing value for the key — a deep merge for JSON. */
217
+ async mergeItem(key, value) {
218
+ this.checkValidInput(key, value);
219
+ await this.setItemAsync(key, prevValue => {
220
+ if (prevValue == null) {
221
+ return value;
222
+ }
223
+ const prevJSON = JSON.parse(prevValue);
224
+ const newJSON = JSON.parse(value);
225
+ const mergedJSON = mergeDeep(prevJSON, newJSON);
226
+ return JSON.stringify(mergedJSON);
227
+ });
228
+ }
229
+ /** Retrieves the values for the given keys. */
230
+ async multiGet(keys) {
231
+ return Promise.all(keys.map(async (key) => {
232
+ this.checkValidInput(key);
233
+ return [key, await this.getItemAsync(key)];
234
+ }));
235
+ }
236
+ /** Sets multiple key-value pairs. */
237
+ async multiSet(keyValuePairs) {
238
+ const db = await this.getDbAsync();
239
+ await db.withExclusiveTransactionAsync(async (tx) => {
240
+ for (const [key, value] of keyValuePairs) {
241
+ this.checkValidInput(key, value);
242
+ await tx.runAsync(STATEMENT_SET, key, value);
243
+ }
244
+ });
245
+ }
246
+ /** Removes the values for the given keys. */
247
+ async multiRemove(keys) {
248
+ const db = await this.getDbAsync();
249
+ await db.withExclusiveTransactionAsync(async (tx) => {
250
+ for (const key of keys) {
251
+ this.checkValidInput(key);
252
+ await tx.runAsync(STATEMENT_REMOVE, key);
253
+ }
254
+ });
255
+ }
256
+ /** Merges multiple key-value pairs — a deep merge for JSON existing values. */
257
+ async multiMerge(keyValuePairs) {
258
+ const db = await this.getDbAsync();
259
+ await db.withExclusiveTransactionAsync(async (tx) => {
260
+ for (const [key, value] of keyValuePairs) {
261
+ this.checkValidInput(key, value);
262
+ const prevValue = await tx.getFirstAsync(STATEMENT_GET, key);
263
+ if (prevValue == null) {
264
+ await tx.runAsync(STATEMENT_SET, key, value);
265
+ continue;
266
+ }
267
+ const prevJSON = JSON.parse(prevValue.value);
268
+ const newJSON = JSON.parse(value);
269
+ const mergedJSON = mergeDeep(prevJSON, newJSON);
270
+ await tx.runAsync(STATEMENT_SET, key, JSON.stringify(mergedJSON));
271
+ }
272
+ });
273
+ }
274
+ /** Alias for `closeAsync()`. */
275
+ async close() {
276
+ await this.closeAsync();
277
+ }
278
+ //#endregion
279
+ //#region Internals
280
+ async getDbAsync() {
281
+ await this.awaitLock.acquireAsync();
282
+ try {
283
+ if (!this.db) {
284
+ const db = await openDatabaseAsync(this.databaseName);
285
+ await this.maybeMigrateDbAsync(db);
286
+ this.db = db;
287
+ }
288
+ }
289
+ finally {
290
+ this.awaitLock.release();
291
+ }
292
+ return this.db;
293
+ }
294
+ getDbSync() {
295
+ // Unlike getDbAsync(), this cannot take `awaitLock` — it is promise-based and this method is
296
+ // synchronous. The migration is idempotent instead, so the next open repairs a database a
297
+ // race left without a `storage` table.
298
+ if (!this.db) {
299
+ const db = openDatabaseSync(this.databaseName);
300
+ this.maybeMigrateDbSync(db);
301
+ this.db = db;
302
+ }
303
+ return this.db;
304
+ }
305
+ maybeMigrateDbAsync(db) {
306
+ return db.withTransactionAsync(async () => {
307
+ const result = await db.getFirstAsync('PRAGMA user_version');
308
+ const currentDbVersion = result?.user_version ?? 0;
309
+ // Baseline schema, deliberately outside the version ladder below — `CREATE TABLE IF NOT
310
+ // EXISTS` is a no-op on a healthy database and also repairs one a raced first-run
311
+ // migration left at `user_version >= 1` with no `storage` table. A new column has to be
312
+ // added here too, so fresh and repaired databases both get it.
313
+ await db.execAsync(MIGRATION_STATEMENT_0);
314
+ // Version ladder: add each new migration below, gated on `currentDbVersion`. Since the
315
+ // baseline above already carries every column, a ladder entry adding one has to tolerate
316
+ // it already being there — gate it on `PRAGMA table_info(storage)`, or a fresh database
317
+ // fails the migration with `duplicate column name`.
318
+ if (currentDbVersion >= DATABASE_VERSION) {
319
+ return;
320
+ }
321
+ await db.execAsync(`PRAGMA user_version = ${DATABASE_VERSION}`);
322
+ });
323
+ }
324
+ maybeMigrateDbSync(db) {
325
+ db.withTransactionSync(() => {
326
+ const result = db.getFirstSync('PRAGMA user_version');
327
+ const currentDbVersion = result?.user_version ?? 0;
328
+ // Keep in sync with maybeMigrateDbAsync(), which documents the two steps below.
329
+ db.execSync(MIGRATION_STATEMENT_0);
330
+ if (currentDbVersion >= DATABASE_VERSION) {
331
+ return;
332
+ }
333
+ db.execSync(`PRAGMA user_version = ${DATABASE_VERSION}`);
334
+ });
335
+ }
336
+ checkValidInput(...input) {
337
+ const [key, value] = input;
338
+ if (typeof key !== 'string') {
339
+ throw new Error(`[SQLiteStorage] Using ${typeof key} type for key is not supported. Use string instead. Key passed: ${String(key)}`);
340
+ }
341
+ if (input.length > 1 &&
342
+ typeof value !== 'string' &&
343
+ typeof value !== 'function') {
344
+ throw new Error(`[SQLiteStorage] Using ${typeof value} type for value is not supported. Use string instead. Key passed: ${key}. Value passed : ${String(value)}`);
345
+ }
346
+ }
347
+ }
348
+ /** Recursively merges two JSON-decoded values, concatenating arrays and merging objects. */
349
+ function mergeDeep(target, source) {
350
+ if (typeof target !== 'object' || target === null || Array.isArray(target)) {
351
+ return source;
352
+ }
353
+ if (typeof source !== 'object' || source === null || Array.isArray(source)) {
354
+ return target;
355
+ }
356
+ // I/O edge: both are JSON.parse() output narrowed only to "non-null, non-array object" above —
357
+ // JSON itself carries no further static shape to check against.
358
+ const targetRecord = target;
359
+ const sourceRecord = source;
360
+ const output = { ...targetRecord };
361
+ for (const key of Object.keys(sourceRecord)) {
362
+ const sourceValue = sourceRecord[key];
363
+ if (Array.isArray(sourceValue)) {
364
+ const existing = output[key];
365
+ output[key] = (Array.isArray(existing) ? existing : []).concat(sourceValue);
366
+ }
367
+ else if (typeof sourceValue === 'object' && sourceValue !== null) {
368
+ output[key] = mergeDeep(targetRecord[key], sourceValue);
369
+ }
370
+ else {
371
+ output[key] = sourceValue;
372
+ }
373
+ }
374
+ return output;
375
+ }
376
+ /**
377
+ * A drop-in replacement for `AsyncStorage` from `@react-native-async-storage/async-storage`.
378
+ */
379
+ export const AsyncStorage = new SQLiteStorage('ExpoSQLiteStorage');
380
+ export default AsyncStorage;
381
+ /** Alias for `AsyncStorage`, given the storage offers more than asynchronous methods. */
382
+ export const Storage = AsyncStorage;
383
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/core/stor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vD,MAAM,YAAY,GAAG,MAAiC,CAAC;IACvD,MAAM,MAAM,GAA4B,EAAE,GAAG,YAAY,EAAE,CAAC;IAE5D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAC5D,WAAW,CACZ,CAAC;QACJ,CAAC;aAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACnE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAEnE,eAAe,YAAY,CAAC;AAE5B,yFAAyF;AACzF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { SQLiteDatabase } from './sqlite-database';
2
+ import type { ISQLiteOpenOptions } from './native-database';
3
+ /** The event payload for `addDatabaseChangeListener`. */
4
+ export type IDatabaseChangeEvent = {
5
+ /** The database name — `main` by default, or another name set via `ATTACH DATABASE`. */
6
+ databaseName: string;
7
+ /** The absolute file path to the database. */
8
+ databaseFilePath: string;
9
+ /** The table name. */
10
+ tableName: string;
11
+ /** The changed row ID. */
12
+ rowId: number;
13
+ };
14
+ /**
15
+ * Called once, right after the native handle opens and before `openDatabaseAsync`/
16
+ * `openDatabaseSync` returns the database — e.g. to run `execAsync`/`execSync` migrations.
17
+ *
18
+ * **Deviation from upstream:** expo-sqlite only exposes this as a `SQLiteProviderProps.onInit`
19
+ * field, called by its React `<SQLiteProvider>` after opening, before rendering children. This
20
+ * package has no Provider yet (per-adapter Provider/hook wrappers are a later, separate pass —
21
+ * see the README), so `onInit` is exposed directly on `openDatabaseAsync`/`openDatabaseSync`
22
+ * instead, giving any adapter — or plain module-scope code with no view tree at all — the same
23
+ * "run this once right after open" hook without needing a Provider to exist first. A future
24
+ * Provider can still accept its own `onInit` prop and either forward it here or call the
25
+ * callback itself; that choice is left to that later pass.
26
+ */
27
+ export type IOnInitCallback = (db: SQLiteDatabase) => Promise<void> | void;
28
+ export type IOpenDatabaseOptions = ISQLiteOpenOptions & {
29
+ onInit?: IOnInitCallback;
30
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ {
2
+ "android": {
3
+ "gradleProjectName": "expo-sqlite",
4
+ "modules": [
5
+ {
6
+ "importPath": "expo.modules.sqlite.SQLiteModule",
7
+ "className": "SQLiteModule",
8
+ "nativeName": "ExpoSQLite"
9
+ }
10
+ ]
11
+ }
12
+ }
package/package.json ADDED
@@ -0,0 +1,141 @@
1
+ {
2
+ "name": "@symbiote-native/sqlite",
3
+ "version": "0.1.0",
4
+ "description": "expo-sqlite wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Database / Statement / Session (transactions, changesets), a Bun-style SQL tagged-template helper, and a SQLite-backed key-value store.",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "react-native",
8
+ "symbiote-native",
9
+ "expo-sqlite",
10
+ "react",
11
+ "vue",
12
+ "svelte",
13
+ "solid",
14
+ "angular",
15
+ "sqlite",
16
+ "database",
17
+ "storage"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/OneEyed1366/symbiote-native.git",
22
+ "directory": "packages/sqlite"
23
+ },
24
+ "homepage": "https://github.com/OneEyed1366/symbiote-native/tree/master/packages/sqlite#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/OneEyed1366/symbiote-native/issues"
27
+ },
28
+ "author": "Andrey Prokopenko <psevdoproger@gmail.com>",
29
+ "type": "module",
30
+ "main": "./build/core/index.js",
31
+ "module": "./build/core/index.js",
32
+ "types": "./build/core/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./build/core/index.d.ts",
36
+ "default": "./build/core/index.js"
37
+ },
38
+ "./kv-store": {
39
+ "types": "./build/core/storage.d.ts",
40
+ "default": "./build/core/storage.js"
41
+ },
42
+ "./react": {
43
+ "types": "./build/react/index.d.ts",
44
+ "default": "./build/react/index.js"
45
+ },
46
+ "./vue": {
47
+ "types": "./build/vue/index.d.ts",
48
+ "default": "./build/vue/index.js"
49
+ },
50
+ "./svelte": {
51
+ "types": "./build/svelte/index.d.ts",
52
+ "default": "./build/svelte/index.js"
53
+ },
54
+ "./solid": {
55
+ "types": "./build/solid/index.d.ts",
56
+ "default": "./build/solid/index.js"
57
+ },
58
+ "./angular": {
59
+ "types": "./build-ngc/angular/index.d.ts",
60
+ "default": "./build-ngc/angular/index.js"
61
+ }
62
+ },
63
+ "files": [
64
+ "src",
65
+ "build",
66
+ "build-ngc",
67
+ "native-link.json",
68
+ "!src/**/*.test.*",
69
+ "!src/**/*.spec.*",
70
+ "!src/**/*.detox.*",
71
+ "!src/core/native-fakes.ts",
72
+ "!src/core/better-sqlite3-ambient.d.ts"
73
+ ],
74
+ "publishConfig": {
75
+ "access": "public"
76
+ },
77
+ "dependencies": {
78
+ "expo-sqlite": "57.0.2",
79
+ "expo-modules-core": "57.0.5",
80
+ "await-lock": "^2.2.2"
81
+ },
82
+ "peerDependencies": {
83
+ "react-native": ">=0.86",
84
+ "react": ">=19.0.0",
85
+ "vue": ">=3.5.0",
86
+ "@vue/runtime-core": "^3.5.13",
87
+ "svelte": ">=5.56.0",
88
+ "solid-js": ">=1.9.0",
89
+ "@angular/core": ">=20",
90
+ "@angular/common": ">=20"
91
+ },
92
+ "peerDependenciesMeta": {
93
+ "react": {
94
+ "optional": true
95
+ },
96
+ "vue": {
97
+ "optional": true
98
+ },
99
+ "@vue/runtime-core": {
100
+ "optional": true
101
+ },
102
+ "svelte": {
103
+ "optional": true
104
+ },
105
+ "solid-js": {
106
+ "optional": true
107
+ },
108
+ "@angular/core": {
109
+ "optional": true
110
+ },
111
+ "@angular/common": {
112
+ "optional": true
113
+ }
114
+ },
115
+ "devDependencies": {
116
+ "@types/node": "^26.0.0",
117
+ "@types/react": "^19.2.0",
118
+ "@types/react-reconciler": "^0.32.2",
119
+ "better-sqlite3": "^13.0.3",
120
+ "typescript": "~6.0.0",
121
+ "react": "19.2.3",
122
+ "react-reconciler": "^0.33.0",
123
+ "vue": "^3.5.38",
124
+ "@vue/runtime-core": "^3.5.13",
125
+ "svelte": "^5.56.0",
126
+ "solid-js": "^1.9.14",
127
+ "@angular/core": "~22.0.8",
128
+ "@angular/common": "~22.0.8",
129
+ "@angular/compiler": "~22.0.8",
130
+ "@angular/compiler-cli": "~22.0.8",
131
+ "@symbiote-native/svelte": "3.0.2",
132
+ "@symbiote-native/test-utils": "0.4.2",
133
+ "@symbiote-native/engine": "1.3.0"
134
+ },
135
+ "scripts": {
136
+ "clean": "rm -rf build-ngc",
137
+ "ng:build": "pnpm run clean && ngc -p tsconfig.angular.json",
138
+ "typecheck": "tsc --build",
139
+ "format": "prettier --write \"src/**/*.{ts,tsx}\""
140
+ }
141
+ }
@@ -0,0 +1,2 @@
1
+ export * from '../core';
2
+ export * from './sqlite.service';