@tauri-apps/plugin-sql 2.0.0-beta.6 → 2.0.0-beta.8

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 (2) hide show
  1. package/README.md +20 -1
  2. package/package.json +7 -6
package/README.md CHANGED
@@ -158,7 +158,26 @@ fn main() {
158
158
 
159
159
  ### Applying Migrations
160
160
 
161
- Migrations are applied automatically when the plugin is initialized. The plugin runs these migrations against the database specified by the connection string. Ensure that the migrations are defined in the correct order and are idempotent (safe to run multiple times).
161
+ To apply the migrations when the plugin is initialized, add the connection string to the `tauri.conf.json` file:
162
+
163
+ ```json
164
+ {
165
+ "plugins": {
166
+ "sql": {
167
+ "preload": ["sqlite:mydatabase.db"]
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ Alternatively, the client side `load()` also runs the migrations for a given connection string:
174
+
175
+ ```ts
176
+ import Database from "@tauri-apps/plugin-sql";
177
+ const db = await Database.load("sqlite:mydatabase.db");
178
+ ```
179
+
180
+ Ensure that the migrations are defined in the correct order and are safe to run multiple times.
162
181
 
163
182
  ### Migration Management
164
183
 
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-sql",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.8",
4
4
  "description": "Interface with SQL databases",
5
5
  "license": "MIT or APACHE-2.0",
6
6
  "authors": [
7
7
  "Tauri Programme within The Commons Conservancy"
8
8
  ],
9
+ "repository": "https://github.com/tauri-apps/plugins-workspace",
9
10
  "type": "module",
10
11
  "types": "./dist-js/index.d.ts",
11
12
  "main": "./dist-js/index.cjs",
@@ -15,15 +16,15 @@
15
16
  "import": "./dist-js/index.js",
16
17
  "require": "./dist-js/index.cjs"
17
18
  },
19
+ "scripts": {
20
+ "build": "rollup -c"
21
+ },
18
22
  "files": [
19
23
  "dist-js",
20
24
  "README.md",
21
25
  "LICENSE"
22
26
  ],
23
27
  "dependencies": {
24
- "@tauri-apps/api": "2.0.0-beta.14"
25
- },
26
- "scripts": {
27
- "build": "rollup -c"
28
+ "@tauri-apps/api": "^2.0.0-beta.16"
28
29
  }
29
- }
30
+ }