When to use this skill
ALWAYS use this skill when the user mentions:
- Using SQLite, MySQL, or PostgreSQL in Tauri / 在 Tauri 中使用 SQLite、MySQL 或 PostgreSQL
- SQL migrations or connection configuration / SQL 迁移或连接配置
- Secure frontend query access / 前端安全查询访问
Trigger phrases include:
- "sql", "sqlite", "postgres", "mysql", "migration"
- "Database", "Migration", "Connection Configuration", "SQL"
How to use this skill
- Select the database engine and connection string
- Configure migrations in tauri.conf.json
- Enable SQL plugin capabilities with scoped access
- Validate queries and error handling in the app flow
Outputs
- Database integration plan / 数据库集成方案
- Minimal-permission capability checklist / 最小权限能力清单
Scope
- Boundary: SQL plugin configuration and usage only
- Key points: Migrations setup and capability scoping
References
- https://v2.tauri.app/llms.txt
- https://v2.tauri.app/plugin/sql/
- https://v2.tauri.app/zh-cn/plugin/sql/
Keywords
tauri sql, sqlite, postgres, mysql, migrations, database
Common Gotchas (Gotchas)
- Version Compatibility: Pay attention to compatibility between framework versions and dependency libraries; APIs may differ across versions.
- Configuration File Format: Configuration file format errors are the most common issue; it is recommended to use the editor's syntax checking.
- Environment Variables: Ensure all necessary environment variables are set correctly, and do not hardcode sensitive information.
- Dependency Conflicts: When multiple versions coexist, watch out for dependency conflicts and use lock files to pin versions.
- Performance Pitfalls: Pay attention to performance optimization in large-data scenarios, and avoid common issues such as N+1 queries.
Usage Workflow
Step 1: Environment Preparation
Ensure the necessary dependencies and tools are installed in the development environment.
Step 2: Configuration Initialization
Perform basic configuration according to project requirements.
Step 3: Using Core Features
Implement core features according to the example code.
Step 4: Test Verification
Run tests to ensure the functionality works properly.
Step 5: Deployment and Launch
After development is complete, proceed with deployment and monitoring.