Skip to content

Conversation

@olirice
Copy link
Contributor

@olirice olirice commented Dec 1, 2025

What kind of change does this PR introduce?

Major refactor of the transpiler. More structure is a good improvement here, but its mainly in prep for nested inserts. Might get to that over the Christmas break.

In draft. I need to review it again as its been a few days since writing and is huge

- Adds native_param module with type-safe parameter binding
- Uses native PostgreSQL types where safe (bool, int, float, text)
- Falls back to text-based binding for custom types, arrays, and edge cases
- Includes comprehensive pg_regress test for edge cases
- Maintains full backwards compatibility with existing behavior
The null handling in cursor pagination was incorrectly building different
expressions based on nulls_first. The original transpiler uses nulls_first
as a boolean literal (AND true/AND false), not as a condition selector.

Also restores the original expected test output that was incorrectly modified.
…dering

Tests cover:
- NULLS FIRST vs NULLS LAST with ASC ordering
- NULLS FIRST vs NULLS LAST with DESC ordering
- Forward pagination (first/after) across null boundaries
- Reverse pagination (last/before) across null boundaries
- Edge cases at null-to-non-null transition points
- Fix float4 (real) type using text fallback instead of native binding
  to avoid f64->f32 size mismatch corruption
- Add run_tests.sh script for easy pg_regress testing
- Add expected output for cursor_pagination_nulls and native_param_binding tests
- Update CLAUDE.md to emphasize pg_regress as primary test suite
@olirice olirice closed this Dec 1, 2025
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.

2 participants