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

Decode force quote all identifiers #228

Open
jdenquin opened this issue Sep 23, 2021 · 1 comment
Open

Decode force quote all identifiers #228

jdenquin opened this issue Sep 23, 2021 · 1 comment

Comments

@jdenquin
Copy link

Hello There,

I'm having a issue with the deparse feature, I want to keep all quotes from my original request on each identifiers.
Is there any way to do it by passing a params on the Ruby side?

I forked the repository and put the quote_all_identifiers variable to true on the C side to do it.

Cheers,
Jeremy

@lfittl
Copy link
Member

lfittl commented Oct 13, 2021

@jdenquin There is no way to do this today, but I can see that being a valid use case. Note that quote_all_identifiers does not keep the original quotes, but rather ensures all identifiers are quoted, regardless of how they presented in the initial query.

I would approach this by adding an optional parameter on the C side - i.e. by renaming the existing pg_query_deparse_protobuf method (https://github.com/pganalyze/libpg_query/blob/13-latest/src/pg_query_deparse.c#L9908) to pg_query_deparse_protobuf_with_opts (with an extra parameter for setting quote_all_identifiers), and then add a wrapper pg_query_deparse_protobuf method.

I personally don't have time to complete that thought and make the change, but a patch along these lines on the C library would be welcome!

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

No branches or pull requests

2 participants