Repository navigation
Refactor of PostgresqlSchemaCodegen; generated output is unchanged - #25431
Open
ChihweiLHBird wants to merge 2 commits into
Open
ChihweiLHBird wants to merge 2 commits into
ChihweiLHBird wants to merge 2 commits into
Conversation
processIntegerTypeProperty read dataType, isUuid and exclusiveMaximum, processDecimalTypeProperty read dataType, dataFormat, exclusiveMinimum and exclusiveMaximum and computed Float min/max bounds, processStringTypeProperty read dataFormat and processBooleanTypeProperty allocated an argument list; none of them was used afterwards. No generated output changes.
All seven process*TypeProperty methods started with the same ~25 lines: compute the column and table names, return early when the property already carries x-postgresql-schema, record the original name in the column comment when snake_case renamed it, and wire the vendor extension maps with colName/colNameQuoted/tblName/tblNameQuoted. Move that into a private startColumn helper that returns a ColumnContext holding the two maps, the column name and the comment, or null when the property was skipped. The order of toColumnName and toTableName (both can log, and both run before the early return) and the snake_case check are kept as they were; colNameQuoted/tblNameQuoted now store the boolean result of isReservedWord directly instead of true/false literals in an if/else. The public method signatures are unchanged. No generated output changes.
ChihweiLHBird
force-pushed
the
refactor/postgresql-schema-2-start-column
branch
from
October 26, 2026 15:59
cc23074 to
4c2cde3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
process*TypePropertymethods compute but never read.process*TypePropertymethods (column and table names, thex-postgresql-schemaskip, the snake_case comment, the vendor-extension maps) into one privatestartColumnhelper. Call order, log messages and public signatures are unchanged.(One more step from #25382)
@mention the technical committee
PostgreSQL: @iri
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.