tauri-app-sql
When to use this skill
ALWAYS use this skill when the user mentions:
- Using SQLite, MySQL, or PostgreSQL in a Tauri app
- SQL migrations or database schema setup
- Running queries from the frontend
Trigger phrases include:
- "sql", "sqlite", "database", "postgres", "mysql", "migration", "db plugin"
How to use this skill
- Install the SQL plugin (with SQLite feature):
cargo add tauri-plugin-sql --features sqlite - Register the plugin with migrations in your Tauri builder:
use tauri_plugin_sql::{Migration, MigrationKind}; let migrations = vec![Migration { version: 1, description: "create_users", sql: "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);", kind: MigrationKind::Up, }]; tauri::Builder::default() .plugin(tauri_plugin_sql::Builder::new().add_migrations("sqlite:app.db", migrations).build()) - Configure capabilities in
src-tauri/capabilities/default.json:{ "permissions": ["sql:allow-load", "sql:allow-execute", "sql:allow-select"] } - Query from the frontend:
import Database from '@tauri-apps/plugin-sql'; const db = await Database.load('sqlite:app.db'); await db.execute('INSERT INTO users (name) VALUES (?)', ['Alice']); const users = await db.select<{ id: number; name: string }[]>('SELECT * FROM users'); - Use parameterized queries to prevent SQL injection
- Keep migrations versioned and run them automatically on app startup
Outputs
- SQL plugin setup with SQLite/Postgres/MySQL
- Migration system with versioned schemas
- Frontend query patterns with parameterized inputs
References
Keywords
tauri sql, sqlite, database, postgres, mysql, migrations, queries
More from partme-ai/full-stack-skills
vite
Guidance for Vite using the official Guide, Config Reference, and Plugins pages. Use when the user needs Vite setup, configuration, or plugin selection details.
68vue3
Guidance for Vue 3 using the official guide and API reference. Use when the user needs Vue 3 concepts, patterns, or API details to build components, apps, and tooling.
54electron
Build cross-platform desktop applications with Electron, covering main/renderer process architecture, IPC communication, BrowserWindow management, menus, tray icons, packaging, and security best practices. Use when the user asks about Electron, needs to create desktop applications, implement Electron features, or build cross-platform desktop apps.
51uniapp-project
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
40ascii-terminal-animation-pack
Plan and generate terminal ASCII animations/screensaver-style output (FPS, refresh rules, loop policy, low-flicker guidance), with a static poster frame and an optional local demo script.
34ascii-image-to-ascii
“Convert an image into ASCII art (readable + detail variants, width/charset controls, optional ANSI), for terminal previews and plain-text image substitutes.”
34