@tauri-apps/plugin-sql
Advanced tools
+7
-6
| { | ||
| "name": "@tauri-apps/plugin-sql", | ||
| "version": "2.0.0-beta.7", | ||
| "version": "2.0.0-beta.8", | ||
| "description": "Interface with SQL databases", | ||
@@ -9,2 +9,3 @@ "license": "MIT or APACHE-2.0", | ||
| ], | ||
| "repository": "https://github.com/tauri-apps/plugins-workspace", | ||
| "type": "module", | ||
@@ -19,2 +20,5 @@ "types": "./dist-js/index.d.ts", | ||
| }, | ||
| "scripts": { | ||
| "build": "rollup -c" | ||
| }, | ||
| "files": [ | ||
@@ -26,7 +30,4 @@ "dist-js", | ||
| "dependencies": { | ||
| "@tauri-apps/api": "2.0.0-beta.15" | ||
| }, | ||
| "scripts": { | ||
| "build": "rollup -c" | ||
| "@tauri-apps/api": "^2.0.0-beta.16" | ||
| } | ||
| } | ||
| } |
+20
-1
@@ -161,4 +161,23 @@  | ||
| 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). | ||
| To apply the migrations when the plugin is initialized, add the connection string to the `tauri.conf.json` file: | ||
| ```json | ||
| { | ||
| "plugins": { | ||
| "sql": { | ||
| "preload": ["sqlite:mydatabase.db"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| Alternatively, the client side `load()` also runs the migrations for a given connection string: | ||
| ```ts | ||
| import Database from "@tauri-apps/plugin-sql"; | ||
| const db = await Database.load("sqlite:mydatabase.db"); | ||
| ``` | ||
| Ensure that the migrations are defined in the correct order and are safe to run multiple times. | ||
| ### Migration Management | ||
@@ -165,0 +184,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
19546
1.66%213
9.79%+ Added
- Removed