@powersync/common 0.0.0-dev-20240920103931 → 0.0.0-dev-20250207081035
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/bundle.mjs +3 -3
- package/lib/client/AbstractPowerSyncDatabase.d.ts +12 -13
- package/lib/client/AbstractPowerSyncDatabase.js +49 -36
- package/lib/client/compilableQueryWatch.d.ts +7 -0
- package/lib/client/compilableQueryWatch.js +37 -0
- package/lib/client/runOnSchemaChange.d.ts +2 -0
- package/lib/client/runOnSchemaChange.js +23 -0
- package/lib/client/sync/bucket/SqliteBucketStorage.js +2 -4
- package/lib/client/sync/stream/AbstractRemote.js +7 -3
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.d.ts +24 -5
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +13 -7
- package/lib/db/DBAdapter.d.ts +4 -0
- package/lib/db/crud/SyncStatus.d.ts +2 -0
- package/lib/db/crud/SyncStatus.js +5 -1
- package/lib/db/schema/Column.d.ts +1 -1
- package/lib/db/schema/Column.js +3 -3
- package/lib/db/schema/Schema.d.ts +1 -1
- package/lib/db/schema/Schema.js +10 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/package.json +2 -2
package/lib/db/schema/Schema.js
CHANGED
|
@@ -11,6 +11,16 @@ export class Schema {
|
|
|
11
11
|
tables;
|
|
12
12
|
constructor(tables) {
|
|
13
13
|
if (Array.isArray(tables)) {
|
|
14
|
+
/*
|
|
15
|
+
We need to validate that the tables have a name here because a user could pass in an array
|
|
16
|
+
of Tables that don't have a name because they are using the V2 syntax.
|
|
17
|
+
Therefore, 'convertToClassicTables' won't be called on the tables resulting in a runtime error.
|
|
18
|
+
*/
|
|
19
|
+
for (const table of tables) {
|
|
20
|
+
if (table.name === '') {
|
|
21
|
+
throw new Error("It appears you are trying to create a new Schema with an array instead of an object. Passing in an object instead of an array into 'new Schema()' may resolve your issue.");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
this.tables = tables;
|
|
15
25
|
}
|
|
16
26
|
else {
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export * from './client/SQLOpenFactory.js';
|
|
|
4
4
|
export * from './client/connection/PowerSyncBackendConnector.js';
|
|
5
5
|
export * from './client/connection/PowerSyncCredentials.js';
|
|
6
6
|
export * from './client/sync/bucket/BucketStorageAdapter.js';
|
|
7
|
+
export { runOnSchemaChange } from './client/runOnSchemaChange.js';
|
|
8
|
+
export { CompilableQueryWatchHandler, compilableQueryWatch } from './client/compilableQueryWatch.js';
|
|
7
9
|
export { UpdateType, CrudEntry, OpId } from './client/sync/bucket/CrudEntry.js';
|
|
8
10
|
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
9
11
|
export * from './client/sync/bucket/CrudBatch.js';
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from './client/SQLOpenFactory.js';
|
|
|
4
4
|
export * from './client/connection/PowerSyncBackendConnector.js';
|
|
5
5
|
export * from './client/connection/PowerSyncCredentials.js';
|
|
6
6
|
export * from './client/sync/bucket/BucketStorageAdapter.js';
|
|
7
|
+
export { runOnSchemaChange } from './client/runOnSchemaChange.js';
|
|
8
|
+
export { compilableQueryWatch } from './client/compilableQueryWatch.js';
|
|
7
9
|
export { UpdateType, CrudEntry } from './client/sync/bucket/CrudEntry.js';
|
|
8
10
|
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
9
11
|
export * from './client/sync/bucket/CrudBatch.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/common",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20250207081035",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsc -b && rollup -c rollup.config.mjs",
|
|
61
61
|
"build:prod": "tsc -b --sourceMap false && rollup -c rollup.config.mjs --sourceMap false",
|
|
62
|
-
"clean": "rm -rf lib dist tsconfig.tsbuildinfo",
|
|
62
|
+
"clean": "rm -rf lib dist tsconfig.tsbuildinfo node_modules",
|
|
63
63
|
"test": "vitest"
|
|
64
64
|
}
|
|
65
65
|
}
|