QuackDB keeps binary protocol fixtures under test/fixtures/.

DuckDB 2.0 server fixtures

test/fixtures/duckdb_2_0/ holds complete response bodies captured from a real DuckDB 2.0 server, the source of truth for Quack protocol version 3. Regenerate them with:

QUACKDB_TEST_DUCKDB=/path/to/duckdb-2.0 mix run test/fixtures/duckdb_2_0/capture.exs
FixtureCovers
connection_response.binProtocol version 3 and the negotiated heartbeat lease
error_response_catalog.binError message, exception type, and transferable extra info
prepare_response_scalar.binInline scalar chunks in the DuckDB 2.0 string layout
prepare_response_nested.binInline LIST, STRUCT, ARRAY, and MAP chunks
fetch_response_batch.binA fetch batch with its chunk blob after the body, including sequence and dictionary vectors
fetch_response_terminal.binThe chunk-less terminal response with the batch count
prepare_response_variant.binUnshredded VARIANT scalars, objects, arrays, and NULLs
prepare_response_shredded_variant.binA full shredded VARIANT vector from checkpointed storage, with unshredded leftovers

Tests assert decoded values rather than bytes: DuckDB compresses vectors and orders map entries in ways QuackDB does not reproduce when it re-encodes.

quack-ts decode fixtures

test/fixtures/quack_ts/ holds wrapped DataChunk fixtures generated by the independent quack-ts implementation. They use the pre-2.0 list layout for strings, which DuckDB 2.0 still reads, so they check that QuackDB decodes that layout to the same rows it encodes.

FixtureCovers
data_chunk_scalar.binScalar columns
data_chunk_nested.binNested columns
data_chunk_bignum_extra.binBIGNUM values
data_chunk_temporal_extra.binNanosecond and time-zone temporal values and intervals
data_chunk_spatial_extra.binGEOMETRY bytes
data_chunk_nested_nulls_extra.binNull-heavy nested values

Malformed fixtures

Malformed fixtures are intentionally invalid protocol messages used to verify that the decoder rejects corrupt input with a structured QuackDB.Error instead of crashing or silently returning the wrong value.

FixtureExpected errorInvariant
test/fixtures/quackdb_malformed/data_chunk_bignum_bad_size.bin:invalid_bignumBIGNUM payload claims a two-byte magnitude but only includes one byte.
test/fixtures/quackdb_malformed/data_chunk_extra_vector.bin:data_chunk_type_mismatchChunk declares zero logical types but encodes one INTEGER vector.
test/fixtures/quackdb_malformed/data_chunk_missing_vector.bin:data_chunk_type_mismatchChunk declares one INTEGER logical type but encodes zero vectors.

Every new fixture should document the exact invariant it covers. Avoid arbitrary random corrupt bytes.