Skip to content

refactor(sql): Collapse toDuckDBValue into literalToSQL - #1180

Draft
domoritz wants to merge 1 commit into
sql-fix/escapingfrom
sql-simplify/S-02
Draft

refactor(sql): Collapse toDuckDBValue into literalToSQL#1180
domoritz wants to merge 1 commit into
sql-fix/escapingfrom
sql-simplify/S-02

Conversation

@domoritz

@domoritz domoritz commented Sep 3, 2026

Copy link
Copy Markdown
Member

Fixes #1179. Part of the audit tracked in #1170. Stacked on #1176 — retarget to main once that merges; the diff here is only this change.

Note: This fix was created by Claude (an agent team ran a binder-error audit of the SQL layer; this refactor was proposed by its simplifier pass and approved by @domoritz in the full-collapse form).

What changed

toDuckDBValue in load.ts is deleted and parameters() calls literalToSQL directly, so read options go through the same serializer and escaping path as every other literal. Booleans in read options now emit TRUE/FALSE instead of true/false (identical to DuckDB) and non-finite numbers emit NULL instead of Infinity (which never bound). Test expectations and the generated-SQL examples in docs/sql/index.md and docs/api/sql/data-loading.md are updated for the casing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DEmcoxyFx2BRM5BbmJGFsa

Fixes #1179 (finding S-02).

After #1174 the two serializers agree case-for-case, so the load path now
goes through the one literal serializer and one escaping path. Booleans in
read options are emitted as TRUE/FALSE, which DuckDB treats identically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DEmcoxyFx2BRM5BbmJGFsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant