Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return information about extracted constants from pg_query_normalize #1

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

elprans
Copy link
Member

@elprans elprans commented Nov 8, 2024

PgQueryNormalizeResult now includes information about the extracted
constants, their location and extent, as well as the lexer token type
and the value of constants as interpreted by the lexer. This makes
pg_query_normalize usable not just for query identification, but also
as a basis for automatic conversion of literal queries into
constant-agnostic prepared statements or other applications where
auto-parametrization of queries is useful.

This also makes pg_query_normalize to use base_yylex instead of
core_yylex which normalizes USCONST constants properly.

`PgQueryNormalizeResult` now includes information about the extracted
constants, their location and extent, as well as the lexer token type
and the value of constants as interpreted by the lexer.  This makes
`pg_query_normalize` usable not just for query identification, but also
as a basis for automatic conversion of literal queries into
constant-agnostic prepared statements or other applications where
auto-parametrization of queries is useful.

This also makes `pg_query_normalize` to use `base_yylex` instead of
`core_yylex` which normalizes `USCONST` constants properly.
@elprans elprans force-pushed the pg-normalize-report-constants branch from 3931efb to a8cb6f4 Compare November 8, 2024 19:50
@elprans elprans merged commit 2d2a480 into 16-edb-latest Nov 8, 2024
28 checks passed
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