@syncular/tauri 0.30.3 → 0.30.5

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/index.d.ts CHANGED
@@ -53,6 +53,13 @@ export interface TauriSyncClientConfig {
53
53
  * an existing database fails with `client.identity_mismatch`.
54
54
  */
55
55
  readonly clientId?: string;
56
+ /**
57
+ * Name of the native database to open, for example one replica per
58
+ * signed-in actor. The plugin opens `<database_dir>/<database>.db` from its
59
+ * `SyncularConfig`; a name is 1 to 128 ASCII letters, digits, `-`, `_` or
60
+ * `.` and starts with a letter or digit. Absent ⇒ the plugin's `db_path`.
61
+ */
62
+ readonly database?: string;
56
63
  /** §4.2 client limits, forwarded to the native `create`. */
57
64
  readonly limits?: Record<string, unknown>;
58
65
  /**
package/dist/index.js CHANGED
@@ -698,13 +698,14 @@ export async function createTauriSyncClient(config) {
698
698
  }
699
699
  const client = new TauriSyncClient(tauri, unlisten, config.securityPreflight === true ? 'preflight' : 'active');
700
700
  clientRef.client = client;
701
- // The native side owns the db path (plugin config); the JS side supplies the
702
- // schema, clientId, and limits. `dbPath` is injected by the plugin.
701
+ // The native side owns every path (plugin config); the JS side names a
702
+ // database and supplies the schema, clientId, and limits.
703
703
  const reply = await tauri.invoke(`${PLUGIN}syncular_command`, {
704
704
  command: {
705
705
  method: 'create',
706
706
  params: {
707
707
  ...(config.clientId !== undefined ? { clientId: config.clientId } : {}),
708
+ ...(config.database !== undefined ? { database: config.database } : {}),
708
709
  schema: config.schema,
709
710
  ...(config.limits !== undefined ? { limits: config.limits } : {}),
710
711
  ...(config.realtimePolicy !== undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/tauri",
3
- "version": "0.30.3",
3
+ "version": "0.30.5",
4
4
  "description": "Tauri integration for the Syncular client",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -48,12 +48,12 @@
48
48
  "test": "bun test"
49
49
  },
50
50
  "dependencies": {
51
- "@syncular/client": "0.30.3"
51
+ "@syncular/client": "0.30.5"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@tauri-apps/api": ">=2.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@syncular/react": "0.30.3"
57
+ "@syncular/react": "0.30.5"
58
58
  }
59
59
  }
package/src/index.ts CHANGED
@@ -114,6 +114,13 @@ export interface TauriSyncClientConfig {
114
114
  * an existing database fails with `client.identity_mismatch`.
115
115
  */
116
116
  readonly clientId?: string;
117
+ /**
118
+ * Name of the native database to open, for example one replica per
119
+ * signed-in actor. The plugin opens `<database_dir>/<database>.db` from its
120
+ * `SyncularConfig`; a name is 1 to 128 ASCII letters, digits, `-`, `_` or
121
+ * `.` and starts with a letter or digit. Absent ⇒ the plugin's `db_path`.
122
+ */
123
+ readonly database?: string;
117
124
  /** §4.2 client limits, forwarded to the native `create`. */
118
125
  readonly limits?: Record<string, unknown>;
119
126
  /**
@@ -1037,13 +1044,14 @@ export async function createTauriSyncClient(
1037
1044
  );
1038
1045
  clientRef.client = client;
1039
1046
 
1040
- // The native side owns the db path (plugin config); the JS side supplies the
1041
- // schema, clientId, and limits. `dbPath` is injected by the plugin.
1047
+ // The native side owns every path (plugin config); the JS side names a
1048
+ // database and supplies the schema, clientId, and limits.
1042
1049
  const reply = await tauri.invoke<CommandReply>(`${PLUGIN}syncular_command`, {
1043
1050
  command: {
1044
1051
  method: 'create',
1045
1052
  params: {
1046
1053
  ...(config.clientId !== undefined ? { clientId: config.clientId } : {}),
1054
+ ...(config.database !== undefined ? { database: config.database } : {}),
1047
1055
  schema: config.schema,
1048
1056
  ...(config.limits !== undefined ? { limits: config.limits } : {}),
1049
1057
  ...(config.realtimePolicy !== undefined