You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: preserve closing quotes in regex patterns for CREATE DOMAIN CHECK constraints
- Fix deparser bug where JavaScript String.replace() was interpreting $ characters in regex patterns as special replacement syntax
- Changed BoolExpr AND_EXPR and OR_EXPR cases to use function callbacks in replace() calls
- Ensures complete string preservation through deparser pipeline for regex patterns ending with $
- All misc-launchql-ext-types tests now pass with valid SQL generation that can be reparsed successfully
Fixes issue where:
Input: CREATE DOMAIN attachment AS jsonb CHECK (value ?& ARRAY['url', 'mime'] AND (value ->> 'url') ~ '^(https?)://[^\s/$.?#].[^\s]*$')
Output: CREATE DOMAIN attachment AS jsonb CHECK (value ?& ARRAY['url', 'mime'] AND (value ->> 'url') ~ '^(https?)://[^\s/$.?#].[^\s]*$')
Technical fix: formatStr.replace('%s', joinedArgs) -> formatStr.replace('%s', () => joinedArgs)
Co-Authored-By: Dan Lynch <[email protected]>
0 commit comments