update-sqlx

Regenerates SQLx offline query cache while preserving enterprise edition cache files.

Updated May 28, 2026
One-click install
npx skills add https://github.com/kma-core/windmill --skill update-sqlx-kma-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-sqlx
Source: https://github.com/kma-core/windmill/tree/main/.agents/skills/update-sqlx
Command: npx skills add https://github.com/kma-core/windmill --skill update-sqlx-kma-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Windmill's CI runs with SQLX_OFFLINE=true, so every sqlx::query! macro needs matching cached data in backend/.sqlx/. Running cargo sqlx prepare without all feature flags silently deletes enterprise edition (EE) query caches, breaking CI for enterprise tests. ## Core Features & Use Cases - Safe cache regeneration: Restores the full cache from origin/main, regenerates OSS caches, then restores any EE caches deleted during prepare. - Verification workflow: Compares cache file lists against origin/main to confirm zero EE cache files were lost. - Use Case: After modifying a SQL query in a Rust source file, follow the documented procedure to update the offline cache so CI passes without wiping EE query data. ## Quick Start Update the SQLx offline query cache for my recent SQL query changes using the safe procedure that preserves EE caches from origin/main.

Frequently Asked Questions about update-sqlx

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

FAQPage Schema
How do I update the SQLx offline query cache after changing SQL queries?

Restore the full cache from origin/main, run cargo sqlx prepare --workspace with the all_sqlx_features flag, then restore any EE cache files deleted during prepare. Finally verify that no files from origin/main are missing.

Why does CI fail with 'no cached data for this query' in SQLx?

CI runs with SQLX_OFFLINE=true, which requires every sqlx::query! macro to have matching cached data in backend/.sqlx/. If you changed a SQL query without regenerating the cache, the macro has no cached data and compilation fails.

Why does cargo sqlx prepare delete EE query cache files?

cargo sqlx prepare deletes all existing cache files and regenerates only those found in the current compilation. Without the private feature flag for EE files, enterprise queries are not compiled, so their caches are silently removed.

Can I use update_sqlx.sh instead of the manual procedure?

Yes, if your EE repository is in sync with main, running ./update_sqlx.sh from the backend directory compiles with all features and is faster. If it fails with EE compilation errors, fall back to the safe manual procedure.

Should I set SQLX_OFFLINE=true when running cargo sqlx prepare locally?

No. Local cache generation requires a live database connection so sqlx can validate queries. SQLX_OFFLINE=true is only used in CI, which is why the committed cache must be complete.