@powersync/nuxt 0.0.7 → 0.0.9
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/module.json +1 -1
- package/dist/runtime/components/SyncStatusTab.vue +1 -1
- package/dist/runtime/composables/useDiagnosticsLogger.d.ts +4 -4
- package/dist/runtime/composables/useDiagnosticsLogger.js +30 -23
- package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.d.ts +3 -3
- package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.js +20 -18
- package/dist/runtime/utils/DynamicSchemaManager.d.ts +1 -1
- package/dist/runtime/utils/DynamicSchemaManager.js +2 -2
- package/dist/runtime/utils/NuxtPowerSyncDatabase.d.ts +16 -14
- package/dist/runtime/utils/NuxtPowerSyncDatabase.js +16 -20
- package/dist/runtime/utils/RustClientInterceptor.d.ts +1 -1
- package/dist/runtime/utils/RustClientInterceptor.js +2 -2
- package/package.json +11 -11
package/dist/module.json
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<div flex="~ col gap-2">
|
|
55
55
|
<span text="sm gray-500">Upload Progress</span>
|
|
56
56
|
<div flex="~ items-center gap-2">
|
|
57
|
-
<span v-if="syncStatus?.
|
|
57
|
+
<span v-if="syncStatus?.uploading">upload in progress...</span>
|
|
58
58
|
<span v-else text="sm gray-400">No active upload</span>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PowerSyncLogger } from '@powersync/common';
|
|
2
2
|
/**
|
|
3
3
|
* Provides a logger configured for PowerSync diagnostics.
|
|
4
4
|
*
|
|
5
5
|
* This composable creates a logger instance that is automatically configured for diagnostics
|
|
6
6
|
* recording. The logger stores logs in session storage and emits events for real-time log monitoring.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
8
|
+
* @param additional - Optional logger that messages will also be forwarded to.
|
|
9
9
|
*
|
|
10
10
|
* @returns An object containing:
|
|
11
11
|
* - `logger` - The configured ILogHandler instance
|
|
@@ -20,8 +20,8 @@ import { type ILogHandler } from '@powersync/web';
|
|
|
20
20
|
* // Use it in your PowerSync setup if needed
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export declare const useDiagnosticsLogger: (
|
|
24
|
-
logger:
|
|
23
|
+
export declare const useDiagnosticsLogger: (additional?: PowerSyncLogger) => {
|
|
24
|
+
logger: PowerSyncLogger;
|
|
25
25
|
logsStorage: import("unstorage").Storage<import("unstorage").StorageValue>;
|
|
26
26
|
emitter: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
|
|
27
27
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createConsoleLogger, LogLevels } from "@powersync/common";
|
|
2
2
|
import { createStorage } from "unstorage";
|
|
3
3
|
import localStorageDriver from "unstorage/drivers/session-storage";
|
|
4
4
|
import mitt from "mitt";
|
|
@@ -6,28 +6,35 @@ const emitter = mitt();
|
|
|
6
6
|
const logsStorage = createStorage({
|
|
7
7
|
driver: localStorageDriver({ base: "powersync:" })
|
|
8
8
|
});
|
|
9
|
-
export const useDiagnosticsLogger = (
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export const useDiagnosticsLogger = (additional) => {
|
|
10
|
+
const consoleLogger = createConsoleLogger({ minLevel: LogLevels.debug });
|
|
11
|
+
const logger = {
|
|
12
|
+
async log(record) {
|
|
13
|
+
consoleLogger.log(record);
|
|
14
|
+
const logObject = {
|
|
15
|
+
date: /* @__PURE__ */ new Date(),
|
|
16
|
+
message: record.message,
|
|
17
|
+
error: record.error,
|
|
18
|
+
level: nameOfLogLevel(record.level)
|
|
19
|
+
};
|
|
20
|
+
const key = `log:${logObject.date.toISOString()}`;
|
|
21
|
+
await logsStorage.set(key, logObject);
|
|
22
|
+
emitter.emit("log", { key, value: logObject });
|
|
23
|
+
additional?.log(record);
|
|
14
24
|
}
|
|
15
|
-
}
|
|
16
|
-
logger.setLevel(LogLevel.DEBUG);
|
|
17
|
-
logger.setHandler(async (messages, context) => {
|
|
18
|
-
consoleHandler(messages, context);
|
|
19
|
-
const messageArray = Array.from(messages);
|
|
20
|
-
const mainMessage = String(messageArray[0] ?? "Empty log message");
|
|
21
|
-
const extra = messageArray.length > 1 ? messageArray.length === 2 ? messageArray[1] : messageArray.slice(1) : void 0;
|
|
22
|
-
const logObject = {
|
|
23
|
-
date: /* @__PURE__ */ new Date(),
|
|
24
|
-
type: context.level.name.toLowerCase(),
|
|
25
|
-
args: [mainMessage, extra, context]
|
|
26
|
-
};
|
|
27
|
-
const key = `log:${logObject.date.toISOString()}`;
|
|
28
|
-
await logsStorage.set(key, logObject);
|
|
29
|
-
emitter.emit("log", { key, value: logObject });
|
|
30
|
-
await customHandler?.(messages, context);
|
|
31
|
-
});
|
|
25
|
+
};
|
|
32
26
|
return { logger, logsStorage, emitter };
|
|
33
27
|
};
|
|
28
|
+
const levelNames = [
|
|
29
|
+
["ERROR", LogLevels.error],
|
|
30
|
+
["WARNING", LogLevels.warn],
|
|
31
|
+
["INFO", LogLevels.info],
|
|
32
|
+
["DEBUG", LogLevels.debug],
|
|
33
|
+
["TRACE", LogLevels.trace]
|
|
34
|
+
];
|
|
35
|
+
function nameOfLogLevel(level) {
|
|
36
|
+
for (const [name, minLevel] of levelNames) {
|
|
37
|
+
if (level >= minLevel) return name;
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CommonPowerSyncDatabase, PowerSyncBackendConnector, SyncOptions, SyncStatus, UploadQueueStats } from '@powersync/common';
|
|
2
2
|
import type { ComputedRef, Ref } from 'vue';
|
|
3
3
|
export type BucketRow = {
|
|
4
4
|
name: string;
|
|
@@ -33,9 +33,9 @@ type ReadonlyRef<T> = Readonly<Ref<T>>;
|
|
|
33
33
|
* Uses named types so the signature stays readable in docs and IDE.
|
|
34
34
|
*/
|
|
35
35
|
export interface UsePowerSyncInspectorDiagnosticsReturn {
|
|
36
|
-
db: Ref<
|
|
36
|
+
db: Ref<CommonPowerSyncDatabase> | undefined;
|
|
37
37
|
connector: ComputedRef<PowerSyncBackendConnector | null>;
|
|
38
|
-
connectionOptions: ComputedRef<
|
|
38
|
+
connectionOptions: ComputedRef<SyncOptions | null>;
|
|
39
39
|
isDiagnosticSchemaSetup: ReadonlyRef<boolean>;
|
|
40
40
|
/** Current sync status. Typed as SyncStatus for a concise doc signature; at runtime it may be a readonly proxy. */
|
|
41
41
|
syncStatus: ReadonlyRef<SyncStatus>;
|
|
@@ -2,6 +2,7 @@ import { usePowerSync, useStatus } from "@powersync/vue";
|
|
|
2
2
|
import { ref, computed, readonly, onMounted, onUnmounted } from "vue";
|
|
3
3
|
import { computedAsync } from "@vueuse/core";
|
|
4
4
|
import { usePowerSyncInspector } from "./usePowerSyncInspector.js";
|
|
5
|
+
import { SyncStatusSnapshot } from "@powersync/shared-internals";
|
|
5
6
|
const BUCKETS_QUERY = `
|
|
6
7
|
WITH
|
|
7
8
|
oplog_by_table AS
|
|
@@ -73,12 +74,12 @@ export function usePowerSyncInspectorDiagnostics() {
|
|
|
73
74
|
const hasSynced = ref(syncStatus.value?.hasSynced || false);
|
|
74
75
|
const isConnected = ref(syncStatus.value?.connected || false);
|
|
75
76
|
const isSyncing = ref(false);
|
|
76
|
-
const isDownloading = ref(syncStatus.value?.
|
|
77
|
-
const isUploading = ref(syncStatus.value?.
|
|
77
|
+
const isDownloading = ref(syncStatus.value?.downloading || false);
|
|
78
|
+
const isUploading = ref(syncStatus.value?.uploading || false);
|
|
78
79
|
const lastSyncedAt = ref(syncStatus.value?.lastSyncedAt || null);
|
|
79
|
-
const uploadError = ref(syncStatus.value?.
|
|
80
|
-
const downloadError = ref(syncStatus.value?.
|
|
81
|
-
const downloadProgressDetails = ref(syncStatus.value?.
|
|
80
|
+
const uploadError = ref(syncStatus.value?.uploadError || null);
|
|
81
|
+
const downloadError = ref(syncStatus.value?.downloadError || null);
|
|
82
|
+
const downloadProgressDetails = ref(syncStatus.value?.downloadProgress || null);
|
|
82
83
|
const bucketRows = ref(null);
|
|
83
84
|
const tableRows = ref(null);
|
|
84
85
|
const uploadQueueStats = ref(null);
|
|
@@ -111,7 +112,7 @@ export function usePowerSyncInspectorDiagnostics() {
|
|
|
111
112
|
const uploadQueueSize = computed(() => formatBytes(uploadQueueStats.value?.size ?? 0));
|
|
112
113
|
const uploadQueueCount = computed(() => uploadQueueStats.value?.count ?? 0);
|
|
113
114
|
const clearData = async () => {
|
|
114
|
-
await db.value?.
|
|
115
|
+
await db.value?.disconnect();
|
|
115
116
|
const connector2 = db.value.connector;
|
|
116
117
|
const connectionOptions2 = db.value.connectionOptions;
|
|
117
118
|
await db.value?.disconnectAndClear();
|
|
@@ -122,14 +123,16 @@ export function usePowerSyncInspectorDiagnostics() {
|
|
|
122
123
|
};
|
|
123
124
|
async function refreshState() {
|
|
124
125
|
if (db.value) {
|
|
125
|
-
const {
|
|
126
|
-
"SELECT
|
|
126
|
+
const { status: rawStatus } = await db.value.get(
|
|
127
|
+
"SELECT powersync_offline_sync_status() as status"
|
|
127
128
|
);
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
const status = new SyncStatusSnapshot(JSON.parse(rawStatus), null);
|
|
130
|
+
const hasSyned = status.hasSynced;
|
|
131
|
+
uploadQueueStats.value = await db.value.getUploadQueueStats(true);
|
|
132
|
+
if (hasSyned && !syncStatus.value.downloading) {
|
|
130
133
|
bucketRows.value = await db.value.getAll(BUCKETS_QUERY);
|
|
131
134
|
tableRows.value = await db.value.getAll(TABLES_QUERY);
|
|
132
|
-
} else if (
|
|
135
|
+
} else if (hasSyned) {
|
|
133
136
|
bucketRows.value = await db.value.getAll(BUCKETS_QUERY_FAST);
|
|
134
137
|
if (tableRows.value == null) {
|
|
135
138
|
tableRows.value = await db.value.getAll(TABLES_QUERY);
|
|
@@ -146,16 +149,16 @@ export function usePowerSyncInspectorDiagnostics() {
|
|
|
146
149
|
statusChanged: (newStatus) => {
|
|
147
150
|
hasSynced.value = !!newStatus.hasSynced;
|
|
148
151
|
isConnected.value = !!newStatus.connected;
|
|
149
|
-
isDownloading.value = !!newStatus.
|
|
150
|
-
isUploading.value = !!newStatus.
|
|
152
|
+
isDownloading.value = !!newStatus.downloading;
|
|
153
|
+
isUploading.value = !!newStatus.uploading;
|
|
151
154
|
lastSyncedAt.value = newStatus.lastSyncedAt || null;
|
|
152
|
-
uploadError.value = newStatus.
|
|
153
|
-
downloadError.value = newStatus.
|
|
154
|
-
downloadProgressDetails.value = newStatus.
|
|
155
|
+
uploadError.value = newStatus.uploadError || null;
|
|
156
|
+
downloadError.value = newStatus.downloadError || null;
|
|
157
|
+
downloadProgressDetails.value = newStatus.downloadProgress || null;
|
|
155
158
|
if (newStatus?.hasSynced === void 0 || newStatus?.priorityStatusEntries?.length && newStatus.priorityStatusEntries.length > 0) {
|
|
156
159
|
hasSynced.value = newStatus?.priorityStatusEntries.every((entry) => entry.hasSynced) ?? false;
|
|
157
160
|
}
|
|
158
|
-
if (newStatus?.
|
|
161
|
+
if (newStatus?.downloading || newStatus?.uploading) {
|
|
159
162
|
isSyncing.value = true;
|
|
160
163
|
} else {
|
|
161
164
|
isSyncing.value = false;
|
|
@@ -169,7 +172,6 @@ export function usePowerSyncInspectorDiagnostics() {
|
|
|
169
172
|
}
|
|
170
173
|
},
|
|
171
174
|
{
|
|
172
|
-
rawTableNames: true,
|
|
173
175
|
tables: ["ps_oplog", "ps_buckets", "ps_data_local__local_bucket_data", "ps_crud"],
|
|
174
176
|
throttleMs: 500
|
|
175
177
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DBAdapter } from '@powersync/web';
|
|
2
2
|
import { Schema } from '@powersync/web';
|
|
3
|
-
import type { SyncDataBucketJSON } from '@powersync/
|
|
3
|
+
import type { SyncDataBucketJSON } from '@powersync/shared-internals/internal/sync_protocol';
|
|
4
4
|
/**
|
|
5
5
|
* Record fields from downloaded data, then build a schema from it.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Column, ColumnType,
|
|
1
|
+
import { Column, ColumnType, ResolvedTable, Schema } from "@powersync/web";
|
|
2
2
|
import { DiagnosticsAppSchema as AppSchema } from "./AppSchema.js";
|
|
3
3
|
import { JsSchemaGenerator } from "./JsSchemaGenerator.js";
|
|
4
4
|
export class DynamicSchemaManager {
|
|
@@ -62,7 +62,7 @@ export class DynamicSchemaManager {
|
|
|
62
62
|
const base = AppSchema;
|
|
63
63
|
const tables = [...base.tables];
|
|
64
64
|
for (const [key, value] of Object.entries(this.tables)) {
|
|
65
|
-
const table = new
|
|
65
|
+
const table = new ResolvedTable({
|
|
66
66
|
name: key,
|
|
67
67
|
columns: Object.entries(value).map(
|
|
68
68
|
([cname, ctype]) => new Column({
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WebPowerSyncDatabase, type DisconnectAndClearOptions, type PowerSyncBackendConnector, type WebPowerSyncDatabaseOptions, type SyncOptions, type CommonPowerSyncDatabase, type PowerSyncDatabaseConstructor } from '@powersync/web';
|
|
2
|
+
import { type StreamingSyncImplementation, type CreateSyncImplementationOptions } from '@powersync/shared-internals';
|
|
3
|
+
export declare class NuxtDatabaseImplementation extends WebPowerSyncDatabase {
|
|
4
|
+
private schemaManager;
|
|
5
|
+
private _connector;
|
|
6
|
+
private useDiagnostics;
|
|
7
|
+
get dbOptions(): WebPowerSyncDatabaseOptions;
|
|
8
|
+
get connector(): PowerSyncBackendConnector | null;
|
|
9
|
+
constructor(options: WebPowerSyncDatabaseOptions);
|
|
10
|
+
protected generateSyncStreamImplementation(connector: PowerSyncBackendConnector, options: CreateSyncImplementationOptions): StreamingSyncImplementation;
|
|
11
|
+
connect(connector: PowerSyncBackendConnector, options?: SyncOptions): Promise<void>;
|
|
12
|
+
disconnect(): Promise<void>;
|
|
13
|
+
disconnectAndClear(options?: DisconnectAndClearOptions): Promise<void>;
|
|
14
|
+
}
|
|
2
15
|
/**
|
|
3
16
|
* An extended PowerSync database class that includes diagnostic capabilities for use with the PowerSync Inspector.
|
|
4
17
|
*
|
|
@@ -24,17 +37,6 @@ import { PowerSyncDatabase, type DisconnectAndClearOptions, type PowerSyncBacken
|
|
|
24
37
|
* - Automatically configures logging when diagnostics are enabled
|
|
25
38
|
* - When diagnostics are disabled, behaves like a standard `PowerSyncDatabase`
|
|
26
39
|
*/
|
|
27
|
-
export declare
|
|
28
|
-
|
|
29
|
-
private _connector;
|
|
30
|
-
private _connectionOptions;
|
|
31
|
-
private useDiagnostics;
|
|
32
|
-
get dbOptions(): WebPowerSyncDatabaseOptions;
|
|
33
|
-
get connector(): PowerSyncBackendConnector | null;
|
|
34
|
-
get connectionOptions(): PowerSyncConnectionOptions | null;
|
|
35
|
-
constructor(options: WebPowerSyncDatabaseOptions);
|
|
36
|
-
protected generateSyncStreamImplementation(connector: PowerSyncBackendConnector, options: RequiredAdditionalConnectionOptions): StreamingSyncImplementation;
|
|
37
|
-
connect(connector: PowerSyncBackendConnector, options?: PowerSyncConnectionOptions): Promise<void>;
|
|
38
|
-
disconnect(): Promise<void>;
|
|
39
|
-
disconnectAndClear(options?: DisconnectAndClearOptions): Promise<void>;
|
|
40
|
+
export declare const NuxtPowerSyncDatabase: PowerSyncDatabaseConstructor<WebPowerSyncDatabaseOptions>;
|
|
41
|
+
export interface NuxtPowerSyncDatabase extends CommonPowerSyncDatabase {
|
|
40
42
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
WebPowerSyncDatabase,
|
|
3
3
|
Schema,
|
|
4
4
|
SharedWebStreamingSyncImplementation,
|
|
5
5
|
WebRemote,
|
|
6
|
-
WebStreamingSyncImplementation
|
|
6
|
+
WebStreamingSyncImplementation,
|
|
7
|
+
LogLevels
|
|
7
8
|
} from "@powersync/web";
|
|
8
9
|
import { usePowerSyncInspector } from "../composables/usePowerSyncInspector.js";
|
|
9
10
|
import { useDiagnosticsLogger } from "../composables/useDiagnosticsLogger.js";
|
|
10
11
|
import { shallowRef } from "vue";
|
|
11
12
|
import { useRuntimeConfig } from "#app";
|
|
12
13
|
import { RustClientInterceptor } from "./RustClientInterceptor.js";
|
|
13
|
-
export class
|
|
14
|
+
export class NuxtDatabaseImplementation extends WebPowerSyncDatabase {
|
|
14
15
|
schemaManager;
|
|
15
16
|
_connector = null;
|
|
16
|
-
_connectionOptions = null;
|
|
17
17
|
useDiagnostics = false;
|
|
18
18
|
get dbOptions() {
|
|
19
19
|
return this.options;
|
|
@@ -21,20 +21,16 @@ export class NuxtPowerSyncDatabase extends PowerSyncDatabase {
|
|
|
21
21
|
get connector() {
|
|
22
22
|
return this._connector ?? super.connector;
|
|
23
23
|
}
|
|
24
|
-
get connectionOptions() {
|
|
25
|
-
return this._connectionOptions ?? super.connectionOptions;
|
|
26
|
-
}
|
|
27
24
|
constructor(options) {
|
|
28
25
|
const useDiagnostics = useRuntimeConfig().public.powerSyncModuleOptions.useDiagnostics ?? false;
|
|
29
26
|
if (useDiagnostics) {
|
|
30
27
|
const { logger } = useDiagnosticsLogger();
|
|
31
28
|
const { getCurrentSchemaManager, diagnosticsSchema } = usePowerSyncInspector();
|
|
32
29
|
const currentSchemaManager = getCurrentSchemaManager();
|
|
33
|
-
options
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
30
|
+
if ("database" in options) {
|
|
31
|
+
options.database.enableMultiTabs = true;
|
|
32
|
+
options.broadcastLogs = true;
|
|
33
|
+
}
|
|
38
34
|
options.logger = logger;
|
|
39
35
|
options.schema = new Schema([...options.schema.tables, ...diagnosticsSchema.tables]);
|
|
40
36
|
super(options);
|
|
@@ -55,13 +51,13 @@ export class NuxtPowerSyncDatabase extends PowerSyncDatabase {
|
|
|
55
51
|
shallowRef(this),
|
|
56
52
|
shallowRef(schemaManager)
|
|
57
53
|
);
|
|
58
|
-
if (this.
|
|
59
|
-
if (!this.
|
|
54
|
+
if (this.resolvedOpenOptions.enableMultiTabs) {
|
|
55
|
+
if (!this.enableBroadcastLogs) {
|
|
60
56
|
const warning = `
|
|
61
57
|
Multiple tabs are enabled, but broadcasting of logs is disabled.
|
|
62
58
|
Logs for shared sync worker will only be available in the shared worker context
|
|
63
59
|
`;
|
|
64
|
-
logger ? logger.warn
|
|
60
|
+
logger ? logger.log({ level: LogLevels.warn, message: warning }) : console.warn(warning);
|
|
65
61
|
}
|
|
66
62
|
return new SharedWebStreamingSyncImplementation({
|
|
67
63
|
...options,
|
|
@@ -72,7 +68,9 @@ export class NuxtPowerSyncDatabase extends PowerSyncDatabase {
|
|
|
72
68
|
await connector.uploadData(this);
|
|
73
69
|
},
|
|
74
70
|
logger,
|
|
75
|
-
db: this.database
|
|
71
|
+
db: this.database,
|
|
72
|
+
logLevel: this.resolvedOpenOptions.databaseWorkerLogLevel ?? LogLevels.info,
|
|
73
|
+
enableBroadcastLogs: this.enableBroadcastLogs
|
|
76
74
|
});
|
|
77
75
|
} else {
|
|
78
76
|
return new WebStreamingSyncImplementation({
|
|
@@ -83,7 +81,7 @@ export class NuxtPowerSyncDatabase extends PowerSyncDatabase {
|
|
|
83
81
|
await this.waitForReady();
|
|
84
82
|
await connector.uploadData(this);
|
|
85
83
|
},
|
|
86
|
-
identifier: "
|
|
84
|
+
identifier: "database" in this.options ? this.options.database.dbFilename : "diagnostics-sync",
|
|
87
85
|
logger
|
|
88
86
|
});
|
|
89
87
|
}
|
|
@@ -93,17 +91,15 @@ export class NuxtPowerSyncDatabase extends PowerSyncDatabase {
|
|
|
93
91
|
}
|
|
94
92
|
async connect(connector, options) {
|
|
95
93
|
this._connector = connector;
|
|
96
|
-
this._connectionOptions = options ?? null;
|
|
97
94
|
await super.connect(connector, options);
|
|
98
95
|
}
|
|
99
96
|
async disconnect() {
|
|
100
97
|
this._connector = null;
|
|
101
|
-
this._connectionOptions = null;
|
|
102
98
|
await super.disconnect();
|
|
103
99
|
}
|
|
104
100
|
async disconnectAndClear(options) {
|
|
105
101
|
this._connector = null;
|
|
106
|
-
this._connectionOptions = null;
|
|
107
102
|
await super.disconnectAndClear(options);
|
|
108
103
|
}
|
|
109
104
|
}
|
|
105
|
+
export const NuxtPowerSyncDatabase = NuxtDatabaseImplementation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColumnType, PowerSyncDatabase } from '@powersync/web';
|
|
2
|
-
import { PowerSyncControlCommand, SqliteBucketStorage } from '@powersync/
|
|
2
|
+
import { PowerSyncControlCommand, SqliteBucketStorage } from '@powersync/shared-internals';
|
|
3
3
|
import type { DynamicSchemaManager } from './DynamicSchemaManager.js';
|
|
4
4
|
import type { ShallowRef } from 'vue';
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BasePowerSyncDatabase, PowerSyncControlCommand, SqliteBucketStorage } from "@powersync/shared-internals";
|
|
2
2
|
export class RustClientInterceptor extends SqliteBucketStorage {
|
|
3
3
|
constructor(db, schemaManager) {
|
|
4
|
-
super(db.value.database,
|
|
4
|
+
super(db.value.database, BasePowerSyncDatabase.transactionMutex);
|
|
5
5
|
this.schemaManager = schemaManager;
|
|
6
6
|
this.rdb = db.value.database;
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/nuxt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"bson": "^6.10.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@powersync/
|
|
57
|
-
"@powersync/
|
|
58
|
-
"@powersync/
|
|
55
|
+
"@powersync/kysely-driver": "^2.0.1",
|
|
56
|
+
"@powersync/vue": "^0.6.0",
|
|
57
|
+
"@powersync/web": "^2.1.0",
|
|
58
|
+
"@powersync/shared-internals": "^1.1.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"@powersync/kysely-driver": {
|
|
@@ -66,16 +66,16 @@
|
|
|
66
66
|
"@journeyapps/wa-sqlite": "^1.7.0",
|
|
67
67
|
"@nuxt/module-builder": "^1.0.2",
|
|
68
68
|
"@nuxt/schema": "^4.3.1",
|
|
69
|
-
"@nuxt/test-utils": "^4.0.
|
|
69
|
+
"@nuxt/test-utils": "^4.0.3",
|
|
70
70
|
"comlink": "^4.4.2",
|
|
71
71
|
"nuxt": "^4.3.1",
|
|
72
|
-
"vitest": "^
|
|
72
|
+
"vitest": "^4.1.10",
|
|
73
73
|
"vue": "^3.5.30",
|
|
74
74
|
"vue-tsc": "^3.2.5",
|
|
75
|
-
"@powersync/
|
|
76
|
-
"@powersync/
|
|
77
|
-
"@powersync/
|
|
78
|
-
"@powersync/common": "
|
|
75
|
+
"@powersync/vue": "0.6.0",
|
|
76
|
+
"@powersync/web": "2.1.0",
|
|
77
|
+
"@powersync/kysely-driver": "2.0.1",
|
|
78
|
+
"@powersync/common": "2.0.0"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"prebuild": "nuxt-module-build prepare",
|