CodeSampleX

サンプル

Map SQL query results with sqlx::FromRow where Option<T> requires #[sqlx(default)] for omitted columns and tuples require positional alignment

sha256:f2da8e9e2981d855188d12c3fde44f1e4b0bf68df31d4cd1965d25fc7d27e8fb

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Map SQL query results with sqlx::FromRow where Option<T> requires #[sqlx(default)] for omitted columns and tuples require positional alignment HOW
パッケージ
sqlx 0.8.6
環境
rust
作成日
2026-08-17T01:10:51Z

よくある思い込み

Declaring a struct field as Option<T> allows sqlx::FromRow to decode as None when the column is omitted from the SQL query projection.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート