Command Palette

Search for a command to run...

Back to skills
skill № 58021

sqlx

Regenerate `.sqlx/` cached metadata when adding or modifying `sqlx::query!`, `sqlx::query_as!`, or `sqlx::query_scalar!` macros.

FreeNo executable scripts
OGKevinby OGKevin★ 55 GitHub stars

Install sqlx in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

SQLx Offline Query Cache

Regenerate .sqlx/ cached metadata when adding or modifying sqlx::query!, sqlx::query_as!, or sqlx::query_scalar! macros.

When to use

  • New typed SQLx macro introduced
  • Existing query string changed
  • Schema migration added or altered

Prerequisites

  • sqlx-cli and sqlite3 on PATH (both are in the devenv shell)

Do not set DATABASE_URL. cargo xtask sqlx-prepare creates a temporary SQLite file, applies crates/core/migrations, then applies crates/core/dictionary/migrations, and points cargo sqlx prepare at that file. One crate build can describe queries against only one URL (sqlx#916). The dictionary migrator is not run on the temporary file: both migrators use version 1 in _sqlx_migrations. The app migrates dictionary.sqlite on its own.

Command

cargo xtask sqlx-prepare

The command passes -- --tests so #[cfg(test)] queries are cached, and sets SQLX_OFFLINE=false for that process only. devenv keeps SQLX_OFFLINE=true for normal builds.

Verification

After regenerating, run the normal emulator-feature checks:

cadmuscli clippy --features emulator
cadmuscli test --features emulator

A device feature is required because workspace defaults do not enable one. Complete the formatting and Kobo-build steps in the root verification sequence, and commit the updated .sqlx/ files alongside the query or migration changes.

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the sqlx skill do?

Regenerate `.sqlx/` cached metadata when adding or modifying `sqlx::query!`, `sqlx::query_as!`, or `sqlx::query_scalar!` macros.

How do I install the sqlx skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the sqlx skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare sqlx with