database-design

Design and optimize SQLite schemas, migrations, and performance patterns for the EMMM2 backend.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/reynalivan/EMMM2 --skill database-design-reynalivan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/reynalivan/EMMM2/tree/main/.agent/skills/database-design
Command: npx skills add https://github.com/reynalivan/EMMM2 --skill database-design-reynalivan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Patterns for reliable SQLite database design, migrations, and performance optimization within the EMMM2 backend.

Core Features & Use Cases

  • Schema Principles: Guidance for designing clean, durable schemas (TEXT PRIMARY KEY UUIDs, timestamps, boolean as INTEGER, and STRICT mode).
  • Migration Workflow: Clear steps to create, edit, and apply migrations using sqlx in a Rust-based workflow.
  • Performance Tuning: Recommendations for WAL mode, indexing strategies, and transactional integrity to ensure fast, safe writes.

Quick Start

Create a new SQLite schema following the principles and initialize migrations using the workflow described.

Frequently Asked Questions about database-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a SQLite schema with UUIDs and automatic timestamps?

Designing a SQLite schema with UUIDs involves using TEXT PRIMARY KEY columns and enabling automatic timestamp generation. This approach enforces strict-mode tables and ensures clean, durable schema structures for local storage.

What is the best way to manage SQLite migrations using sqlx in Rust?

The best way to manage SQLite migrations using sqlx in Rust is to follow a structured workflow that creates, edits, and applies migration files. This ensures reliable database schema evolution and transactional integrity during development and production scenarios.

When do I need WAL mode for SQLite performance tuning?

You need WAL mode for SQLite performance tuning when optimizing for fast and safe concurrent writes. Enabling Write-Ahead Logging improves transactional integrity and read-write performance in production-like application scenarios.

Does SQLite strict mode work with sqlx and Rust?

SQLite strict mode works with sqlx and Rust by enforcing strict table definitions that reject mismatched data types. This ensures schema integrity by validating boolean INTEGER values and text constraints during database operations.

Why should I use TEXT PRIMARY KEY instead of INTEGER for SQLite UUIDs?

You should use TEXT PRIMARY KEY instead of INTEGER for SQLite UUIDs to ensure global uniqueness across distributed systems. This schema design principle guarantees durable primary keys without relying on sequential integer generation.