sql

Write SQLite queries and schemas enforcing lowercase CTEs and strict tables.

48|8|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/maragudk/skills --skill sql-maragudk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql
Source: https://github.com/maragudk/skills/tree/main/sql
Command: npx skills add https://github.com/maragudk/skills --skill sql-maragudk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance for working with SQLite databases, covering query writing, schema design, and SQLite-specific best practices.

Core Features & Use Cases

  • Query Writing: Prefer lowercase queries; use Common Table Expressions (CTEs) and avoid long nested subqueries.
  • Schema Design: Use strict tables and consistent timestamp formats; define primary keys with stable defaults.
  • Migrations & Go interop: Helpful guidance for migrations and code that interacts with SQLite.

Quick Start

Write a simple SELECT from a small SQLite schema using the conventions described to fetch data.

Frequently Asked Questions about sql

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

FAQPage Schema
How do I write SQLite queries that follow best practices?

SQLite queries should use lowercase syntax, Common Table Expressions (CTEs) instead of deeply nested subqueries, and strict tables. This approach improves readability, maintainability, and query performance while keeping code consistent across your schema.

What's the best way to design SQLite schemas?

Use strict tables with standardized timestamps formatted as strftime('%Y-%m-%dT%H:%M:%fZ'), primary keys like id text primary key default ('p_' || lower(hex(randomblob(16)))), and automatic updated timestamp triggers. This ensures data integrity and predictable schema behavior.

How do I set up SQLite migrations in Go?

Migrations apply schema changes systematically using SQL files that define tables, constraints, and triggers. Integrate migrations into your Go application startup to ensure schema consistency across environments before executing queries.

Can I use SQLite with Go applications?

Yes. SQLite works efficiently with Go for query writing, schema design, and database integration. Follow conventions like lowercase queries, CTEs, strict tables, and standardized timestamps to maintain clean, maintainable database code.

Why should I avoid long nested subqueries in SQLite?

Nested subqueries reduce readability and query optimization. Common Table Expressions (CTEs) break complex logic into named, reusable steps that are easier to understand, debug, and optimize for SQLite's query planner.

What timestamp format should I use in SQLite schemas?

Use ISO 8601 format via strftime('%Y-%m-%dT%H:%M:%fZ') for all timestamps. This standardized format ensures consistent data representation, simplifies cross-system interoperability, and allows reliable sorting and comparison.