ax-grdb

ax-grdb is a skill for Claude Code from Kasempiternal/axiom-v2. It costs 55 tokens per session (4,781 once invoked), scanned A, original, MIT.

A guide to using GRDB, a Swift library for working directly with SQLite databases, including connections, raw SQL, models, queries, migrations, full-text search, and syncing.

In plain words
What is it for?
Use it when building Swift data layers with SQLite, defining database models, observing changes, writing SQL or CTEs, adding FTS5 search, migrating from Realm or SwiftData, or syncing with CloudKit.
Why use it?
It collects patterns for safely reading, writing, testing, and changing SQLite data without having to design each database operation from scratch.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the axiom plugin — 40 skills, 8 commands, 12 agents, 2 hooks shipped together

Good fit Use it when building Swift data layers with SQLite, defining database models, observing changes, writing SQL or CTEs, adding FTS5 search, migrating from Realm or SwiftData, or syncing with CloudKit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kasempiternal/axiom-v2/ax-grdb
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Kasempiternal/axiom-v2 --skill ax-grdb
Clone the repo
git clone --depth 1 https://github.com/Kasempiternal/axiom-v2

Made for: Claude Code.

Or install axiom, the plugin that ships this one along with the rest of its 40 skills, 8 commands, 12 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ax-grdb

README.md
[![agentmods](https://agentmods.dev/badge/skills/kasempiternal/axiom-v2/ax-grdb/github.svg)](https://agentmods.dev/skills/kasempiternal/axiom-v2/ax-grdb)
Your own site
<a href="https://agentmods.dev/skills/kasempiternal/axiom-v2/ax-grdb"><img src="https://agentmods.dev/badge/skills/kasempiternal/axiom-v2/ax-grdb/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ax-grdb

Your own site · 80×15
<a href="https://agentmods.dev/skills/kasempiternal/axiom-v2/ax-grdb"><img src="https://agentmods.dev/badge/skills/kasempiternal/axiom-v2/ax-grdb.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,781 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.04781
Opus 5.5 $0.00022 $0.01912
Sonnet 5.5 $0.00011 $0.00956
Haiku 4.5 $0.00006 $0.00478

Measured 3mo ago against content hash 7ca7d5ce157d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ax-grdb scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let oldTracks = try context.fetch(FetchDescriptor<OldTrack>())
axiom-plugin/skills/ax-grdb/SKILL.md · 664 lines

How it starts

The opening of the file, as written. The whole thing — 664 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GRDB & SQLite

Quick Patterns

GRDB Setup

import GRDB

// DatabaseQueue (single connection, safe for all use cases)
let dbQueue = try DatabaseQueue(path: dbPath)

// DatabasePool (concurrent reads, single writer - better performance)
let dbPool = try DatabasePool(path: dbPath)

// In-memory for testing
let dbQueue = try DatabaseQueue()

GRDB Model Definition

struct Track: Codable, FetchableRecord, PersistableRecord {
    var id: Int64?
    var title: String
    var artist: String
    var duration: TimeInterval
    var playCount: Int

    // Table name (default: "track")
    static let databaseTableName = "tracks"

    // Auto-increment
    mutating func didInsert(_ inserted: InsertionSuccess) {
        id = inserted.rowID
    }
}

GRDB Raw SQL Queries

// Read
let tracks = try dbQueue.read { db in
    try Track.fetchAll(db, sql: """
        SELECT * FROM tracks
        WHERE artist = ? AND duration > ?
        ORDER BY title
        LIMIT 50
        """, arguments: ["Artist", 180])
}

// Single row
let track = try dbQueue.read { db in
    try Track.fetchOne(db, sql: "SELECT * FROM tracks WHERE id = ?", arguments: [42])
}

// Aggregate
let count = try dbQueue.read { db in
    try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM tracks WHERE playCount > 0")!
}

// Write
try dbQueue.write { db in
    var track = Track(id: nil, title: "Song", artist: "Artist", duration: 210, playCount: 0)
    try track.insert(db)
}

// Update
try dbQueue.write { db in
    try db.execute(sql: "UPDATE tracks SET playCount = playCount + 1 WHERE id = ?", arguments: [42])
}

// Delete
try dbQueue.write { db in
    try db.execute(sql: "DELETE FROM tracks WHERE playCount = 0")
}

GRDB Type-Safe Query Interface

let tracks = try dbQueue.read { db in
    try Track
        .filter(Column("artist") == "Artist")
        .filter(Column("duration") > 180)
        .order(Column("title"))
        .limit(50)
        .fetchAll(db)
}

// Joins
struct TrackInfo: Decodable, FetchableRecord {
    var trackTitle: String
    var artistName: String
}

let infos = try dbQueue.read { db in
    try Track
        .joining(required: Track.artist)
        .select(
            Column("title").forKey("trackTitle"),
            Artist.Columns.name.forKey("artistName")
        )
        .asRequest(of: TrackInfo.self)
        .fetchAll(db)
}

Read the full file on GitHub · 664 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 664 lines · 55 tokens per session scan A 7ca7d5ce157d

Subscribe to this mod's changes

ax-grdb is a skill published in the GitHub repository Kasempiternal/axiom-v2 (4 stars, last pushed 9mo ago), licensed MIT. It adds 55 tokens to every session and 4,781 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

ax-grdb compared with skills from other repositories

ax-grdb next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ax-grdbKasempiternal/axiom-v2Skill49mo agoMITA55Claude Code
core-datathiennc-tesoglobal/ios-skillsSkill32mo agononeA52Claude Code
core-datacaglarbaranbora/Apple-Agent-KitSkill11mo agononeA410Claude Code
swiftdatacaglarbaranbora/Apple-Agent-KitSkill11mo agononeA167Claude Code
swiftdatathiennc-tesoglobal/ios-skillsSkill32mo agononeA44Claude Code
planTerryc21/workflow-auditSkill611mo agoApache-2.0A53Claude Code
workflow-auditTerryc21/workflow-auditSkill611mo agoApache-2.0A59Claude Code