Skip to content

Commit 49299b6

Browse files
authored
Merge pull request #151 from powersync-ja/diagnostics-app
Diagnostics app
2 parents 7a05cae + cb04453 commit 49299b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1935
-125
lines changed

.changeset/shy-suns-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@powersync/common": patch
3+
---
4+
5+
Fix type of Schema.tables

.changeset/stale-insects-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@powersync/common": patch
3+
---
4+
5+
Fix disconnectAndClear() not clearing ps_untyped

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Demo applications are located in the [`demos/`](./demos/) directory. Also see ou
5555
- [demos/example-vite](./demos/example-vite/README.md): A minimal example demonstrating bundling with Vite.
5656
- [demos/example-nextjs](./demos/example-nextjs/README.md): An example demonstrating setup with Next.js.
5757

58+
## Tools
59+
60+
- [tools/diagnostics-app](./tools/diagnostics-app): A standalone web app that presents stats about a user's local database (incl. tables and sync buckets).
61+
5862
# Development
5963

6064
This monorepo uses pnpm.

packages/common/src/client/AbstractPowerSyncDatabase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
367367
await tx.execute(`DELETE FROM ${PSInternalTable.OPLOG}`);
368368
await tx.execute(`DELETE FROM ${PSInternalTable.CRUD}`);
369369
await tx.execute(`DELETE FROM ${PSInternalTable.BUCKETS}`);
370+
await tx.execute(`DELETE FROM ${PSInternalTable.UNTYPED}`);
370371

371372
const tableGlob = clearLocal ? 'ps_data_*' : 'ps_data__*';
372373

packages/common/src/client/sync/bucket/BucketStorageAdapter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export enum PSInternalTable {
4242
DATA = 'ps_data',
4343
CRUD = 'ps_crud',
4444
BUCKETS = 'ps_buckets',
45-
OPLOG = 'ps_oplog'
45+
OPLOG = 'ps_oplog',
46+
UNTYPED = 'ps_untyped'
4647
}
4748

4849
export interface BucketStorageListener extends BaseListener {

packages/common/src/db/schema/Schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export class Schema<S extends SchemaType = SchemaType> {
1616
*/
1717
readonly types: SchemaTableType<S>;
1818
readonly props: S;
19-
constructor(public tables: ClassicTable[] | S) {
19+
readonly tables: ClassicTable[];
20+
21+
constructor(tables: ClassicTable[] | S) {
2022
if (Array.isArray(tables)) {
2123
this.tables = tables;
2224
} else {

0 commit comments

Comments
 (0)