Skip to content

Deparser: proto encoding issue on my end or deparse? (booleans always false) #290

@pyramation

Description

@pyramation

Hi @lfittl 👋

Been a while hope you're well! I'm doing some major work on the downstream tooling — it's going to be great!

I’m doing a round-trip test (parse → protobuf encode → deparse), and I’m seeing a couple of mismatches. I’m not sure yet whether the issue is in my encoding logic or if it’s something in the deparser itself. Would you mind doing a quick sanity check to confirm whether the deparsed results below match what you would get on your side?

{
    "original": "select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'))",
    "upstream": "SELECT concat_ws('#', 1, 2, 3, 'hello', false, false, to_date('20100309', 'YYYYMMDD'))"
}
{
    "original": "select format('%s, %s', variadic array[true, false])",
    "upstream": "SELECT format('%s, %s', VARIADIC ARRAY[false, false])"
}

FWIW, I also tested my TS-only deparse and mine matched the original, only the upstream (libpg-query-node) was incorrect.

Thanks again — and no rush if you’re busy.

P.S. I looked so I think the answer is no, but is there a JSON -> proto method already in the code I can bind from the C side to node? that would also eliminate one variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions