@@ -17,51 +17,10 @@ pooling, write serialization, and proper resource management.
1717 * ** Optimized Connection Pooling** : Separate read and write pools for concurrent reads,
1818 even while writing
1919 * ** Write Serialization** : Exclusive write access through connection manager
20- * ** Migration Support** : Uses SQLx's database migration system
20+ * ** Migration Support** : Uses SQLx's database migration system (coming soon)
2121 * ** Custom Configuration** : Configure read pool size and idle timeouts
2222 * ** Type Safety** : Full TypeScript bindings
23- * ** Resource Management** : Proper cleanup on application exit
24-
25- ## Project Structure
26-
27- This project is organized as a Cargo workspace with the following structure:
28-
29- ``` text
30- tauri-plugin-sqlite/
31- ├── crates/
32- │ └── sqlx-sqlite-conn-mgr/ # SQLx SQLite connection manager
33- │ ├── src/
34- │ │ ├── config.rs # Database configuration types
35- │ │ ├── database.rs # Core database wrapper
36- │ │ ├── error.rs # Error types
37- │ │ ├── lib.rs # Public API
38- │ │ ├── registry.rs # Database registry
39- │ │ └── write_guard.rs # Write access guard
40- │ ├── Cargo.toml
41- │ └── README.md
42- ├── src/ # Tauri plugin implementation
43- │ ├── commands.rs # Plugin commands (Phase 2)
44- │ ├── error.rs # Error types
45- │ └── lib.rs # Plugin initialization
46- ├── guest-js/ # JavaScript/TypeScript API
47- │ ├── index.ts # Database class and types
48- │ └── tsconfig.json
49- ├── permissions/ # Tauri permission definitions
50- │ ├── autogenerated/ # Generated permission files
51- │ ├── schemas/ # Permission schemas
52- │ └── default.toml # Default permission set
53- ├── dist-js/ # Built JavaScript (generated)
54- │ ├── index.js # ESM build
55- │ ├── index.cjs # CommonJS build
56- │ └── index.d.ts # TypeScript declarations
57- ├── .github/ # CI/CD workflows
58- ├── Cargo.toml # Workspace configuration
59- ├── package.json # NPM package configuration
60- ├── rollup.config.js # JavaScript build configuration
61- ├── api-iife.js # Browser IIFE bundle (generated)
62- ├── build.rs # Build script
63- └── README.md # This file
64- ```
23+ * ** Resource Management** : Proper cleanup on application exit (coming soon)
6524
6625## Crates
6726
@@ -162,12 +121,6 @@ import Database from '@silvermine/tauri-plugin-sqlite'
162121
163122// Connect to a database (path is relative to app config directory)
164123const db = await Database .load (' mydb.db' )
165-
166- // Or with custom connection configuration
167- const db = await Database .load (' mydb.db' , {
168- maxReadConnections: 10 , // Default: 6
169- idleTimeoutSecs: 60 // Default: 30
170- })
171124```
172125
173126> ** Note:** Database paths are relative to the app's config directory. Unlike
@@ -386,19 +339,6 @@ const filtered = await db.fetchAll<User[]>(
386339> ** Note:** Use ` execute() ` and ` executeTransaction() ` for write operations.
387340> For SELECT queries, use ` fetchAll() ` or ` fetchOne() ` .
388341
389- ## Configuration
390-
391- ### Connection Pool Options
392-
393- Configure the connection pool when loading a database:
394-
395- ``` typescript
396- const db = await Database .load (' mydb.db' , {
397- maxReadConnections: 10 , // Max concurrent read connections (default: 6)
398- idleTimeoutSecs: 60 // Idle timeout in seconds (default: 30)
399- })
400- ```
401-
402342### Architecture
403343
404344The plugin uses ` sqlx-sqlite-conn-mgr ` for optimized connection management:
@@ -435,8 +375,8 @@ Connect to a database and return a Database instance.
435375
436376``` typescript
437377const db = await Database .load (' mydb.db' , {
438- maxReadConnections: 10 ,
439- idleTimeoutSecs: 60
378+ maxReadConnections: 10 , // defaults to 6 if no config is provided
379+ idleTimeoutSecs: 60 // defaults to 30 if no config is provided
440380})
441381```
442382
@@ -528,8 +468,8 @@ interface WriteQueryResult {
528468}
529469
530470interface CustomConfig {
531- maxReadConnections? : number // Default: 6
532- idleTimeoutSecs? : number // Default: 30
471+ maxReadConnections? : number
472+ idleTimeoutSecs? : number
533473}
534474```
535475
@@ -614,7 +554,6 @@ With this setup, `tauri dev` shows all plugin and app logs, while `tauri build`
614554a release binary that contains no logging from this plugin or your app-level ` tracing `
615555calls.
616556
617-
618557## Development Standards
619558
620559This project follows the
0 commit comments