Custom Generators
SqlProof maps PostgreSQL types to Hypothesis
strategies automatically. For tighter control, override columns via
proof.customize().
Basic Override
Section titled “Basic Override”Well-Known Strategies
Section titled “Well-Known Strategies”SqlProof also ships helpers for common string domains:
Type Mapping Examples
Section titled “Type Mapping Examples”| PostgreSQL type | Default strategy |
|---|---|
integer | st.integers(-2147483648, 2147483647) |
bigint | st.integers(-(2**63), 2**63 - 1) |
boolean | st.booleans() |
text | st.text(max_size=255) |
varchar(n) | st.text(max_size=n) |
uuid | st.uuids() |
jsonb | Recursive JSON value strategies |
| enum types | st.sampled_from(enum_values) |