/agentic-awesome-skills:rust-sqlx-nullable-scalar-lookupsfrom agentic-awesome-skills
Preserves missing rows, SQL NULL, and concrete values in Rust SQLx scalar lookups. Traces nested Option through SQLite queries and tests caller decisions.
Ships in agentic-awesome-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
query_scalar, fetch_optional, or .flatten() appears in a code path where row existence changes behavior.query_scalar decodes only the first column of each row.fetch_optional takes the first row and cannot detect an unexpected extra match.COALESCE can change its null into a concrete value..flatten(), .ok(), unwrap_or_default(), or mapping at the repository and response boundaries. Identify where a state first disappears.query_scalar::<_, Option<T>>(...).fetch_optional(...) when a lookup can return zero rows and the selected value can be null.Option<Option<T>> through the await. Propagate sqlx::Error with ? or the caller's existing error mapping.| Decoded result | SQL condition | Example meaning |
|---|---|---|
None | Zero matching rows | Schedule missing |
Some(None) | A row whose selected value is SQL NULL | Inherit a policy |
Some(Some(value)) | A row whose selected value is concrete | Apply the stored override |
Use a named enum when it makes those meanings clear to downstream code. If the public API already distinguishes them by status or response shape, preserve that contract too. Collapse states only when the caller explicitly treats them alike.
Preserve missing rows and null values runs a synthetic schedule lookup on a single SQLite connection. The same assertions catch a flattened result and confirm a three-way mapping.
MAX usually returns one row containing SQL NULL for an empty input. When the query contract guarantees one row, fetch_one with a nullable scalar expresses that contract. Check grouping and filters before choosing it.The worked example creates and seeds an in-memory database on one connection. Run it in a scratch crate. Confirm result semantics before editing a shared repository method because callers may depend on the existing error and missing-row behavior.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rust, sqlx, sqlite, null-handling, option-type, row-cardinality
Generated from the plugin's indexed repository (sickn33/agentic-awesome-skills) — no native marketplace selected
npx claudepluginhub p/sickn33-antigravity-awesome-skills3,195 skills in this plugin
/007Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project./00-andruia-consultantUsar al iniciar o mejorar un proyecto de IA: diagnostica código y restricciones, propone skills existentes y redacta tareas y un plan de implementación en español./10-andruia-skill-smithUsar para crear o mejorar una skill de Andru.ia: define entradas y resultados, redacta SKILL.md con ejemplos y límites, valida la estructura y prepara una PR.2 plugins in one repository ship this exact skill · first indexed Dec 4, 2026
Other plugins' skills for the same job