Skip to content

feat: export Postgres parser version - #50

Merged
levkk merged 2 commits into
mainfrom
levkk-pg-version
Aug 13, 2026
Merged

feat: export Postgres parser version#50
levkk merged 2 commits into
mainfrom
levkk-pg-version

Conversation

@levkk

@levkk levkk commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Export the PG_VERSION and PG_VERSION_NUM using a Rust API.

@levkk
levkk requested a review from sgrif August 13, 2026 16:44

@sgrif sgrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/lib.rs
pub const POSTGRES_VERSION_NUM: u32 = raw::PG_VERSION_NUM;

/// Returns the PostgreSQL version whose parser sources are used by this crate.
pub fn postgres_version() -> &'static str {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can be made const

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently we are not allowed to call expect inside const functions. This is because expect isn't const.

Comment thread src/lib.rs Outdated
@levkk levkk changed the title feat: parser version feat: export Postgres parser version Aug 13, 2026
@levkk
levkk merged commit 6870860 into main Aug 13, 2026
1 check passed
@levkk
levkk deleted the levkk-pg-version branch August 13, 2026 19:15
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