Skip to content

Commit 4d0c6bc

Browse files
committed
feat: warn instead of refusing on checks that only raise under the built-in policy
Under the built-in policy, arithmetic that only fails at its 38-digit limit, date arithmetic and nanosecond comparisons that only fail outside DuckDB's timestamp range, and a naive timestamp joined with a local one that only fails on digits below the microsecond now convert with a warning instead of being refused. Their converted SQL raises an error rather than return a different value. --strict refuses them, and --loud-divergences-only keeps them while it still refuses the clock. Last-30-days filters on CURRENT_TIMESTAMP() convert too, and SQ0003 on a function operand now points at a cast. The warnings give DuckDB's exact timestamp range and explain the UTC session the clock relies on. The corpora record 132 statements that now translate and 3 whose refusal moves to a later operand.
1 parent cb8772b commit 4d0c6bc

19 files changed

Lines changed: 541 additions & 205 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ renumbered.
157157
### Policy
158158

159159
`convert`, `function`, `census` and `index` read `sqlquack.toml` (or `--policy`); without one they
160-
use the built-in policy, which refuses every known divergence, as `--builtin-policy` asks for.
160+
use the built-in policy, as `--builtin-policy` asks for: it refuses every known divergence except the
161+
clock and arithmetic that raises at its range limit, which convert with a warning.
161162
They share the policy flags: `--policy`, `--builtin-policy`, `--strict`, `--utc-session`,
162163
`--confirm-declared-offsets`, `--python-runtime` and `--loud-divergences-only`, which relies only
163164
on divergences whose converted SQL raises rather than returns another value. Every command with a

0 commit comments

Comments
 (0)