Skip to content

Editor: Fix NPE when generating schema from PostgreSQL views#517

Open
PZahnen wants to merge 3 commits into
masterfrom
editor-issue-29
Open

Editor: Fix NPE when generating schema from PostgreSQL views#517
PZahnen wants to merge 3 commits into
masterfrom
editor-issue-29

Conversation

@PZahnen
Copy link
Copy Markdown
Contributor

@PZahnen PZahnen commented Jun 2, 2026

Closes ldproxy/editor#29

  • SchemaCrawler returns view definitions wrapped as CREATE OR REPLACE VIEW … AS …, which JSQLParser parses as CreateView, not Select. The old code's blind cast to Select triggered a ClassCastException that setErrorRecovery(true) silently turned into a null result.
  • The following getSelectBody() call on null threw an NPE that wasn't caught locally and ultimately killed schema generation for the affected view, leaving types: {} in the generated YAML.
  • ViewInfo.parse() now handles both Select and CreateView (unwrapping the latter), and rejects anything else via a regular JSQLParserException that existing catch blocks handle gracefully.
  • SchemaGeneratorSql now logs a WARN for failed per-table generation and filters out null results, so a single problematic table can no longer break the whole run.

@PZahnen PZahnen requested a review from azahnen June 2, 2026 17:43
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.

From datasource fails for PostgreSQL view with NullPointerException and stuck progress

1 participant