Skip to content

Add the ability to deparse a statement#11

Merged
sgrif merged 1 commit into
mainfrom
sg-deparse
Jun 28, 2026
Merged

Add the ability to deparse a statement#11
sgrif merged 1 commit into
mainfrom
sg-deparse

Conversation

@sgrif

@sgrif sgrif commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

This wraps deparesRawStmt from libpg_query in a safe Rust wrapper. I was a bit surprised to find that PG itself doesn't contain any deparsing functions that are usable for us, so we will need to continue depending on libpg_query for the foreseeable future rather than PG itself, unless we want to write our own deparser (which actually may be worth doing).

In order to make writing the tests easier, I needed the helper methods on List to be available on cast lists. I went ahead and copied all of them over while I was there.

This wraps `deparesRawStmt` from libpg_query in a safe Rust wrapper.
I was a bit surprised to find that PG itself doesn't contain any
deparsing functions that are usable for us, so we will need to continue
depending on libpg_query for the foreseeable future rather than PG
itself, unless we want to write our own deparser (which actually may be
worth doing).

In order to make writing the tests easier, I needed the helper methods
on `List` to be available on cast lists. I went ahead and copied all of
them over while I was there.
@sgrif sgrif requested review from levkk and meskill June 27, 2026 20:40
@sgrif sgrif merged commit 3871739 into main Jun 28, 2026
@sgrif sgrif deleted the sg-deparse branch June 28, 2026 18:28
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