Skip to content

feat: add the corrective fact to CLI failure diagnostics - #39

Merged
omer-cengel merged 3 commits into
masterfrom
feature/actionable-cli-diagnostics
Sep 26, 2026
Merged

omer-cengel merged 3 commits into
masterfrom
feature/actionable-cli-diagnostics

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

sqlcj generate already reported each failure as a single sqlcj: line naming the failing file, but many messages stopped there, and SQL syntax errors either said only Failed to parse schema or leaked a parser exception class name. Every configuration, source, SQL syntax, and output diagnostic now keeps its existing prefix and ends with the fact that explains the failure, so the message says what to fix.

Changes

  • Unreadable configuration files and schema or queries sources end with the filesystem reason, such as No such file or directory or Is a directory.
  • A malformed configuration file reports the YAML parser's problem with its one-based line and column.
  • Failures to create an output directory, write a generated file, read or write the output manifest, or delete a stale generated file end with the filesystem reason.
  • A schema syntax error reports the unexpected token with its line and column; a query syntax error reports the parser's reason after the query's existing header location.
  • Lexical SQL errors, such as an unterminated string literal, use the parser's own wording; no diagnostic names a parser exception class.
  • The README, configuration guide, and PostgreSQL guide state exit status 1 for every failure category and show the new messages.

Scope and non-goals

  • Message prefixes, the single-line format, and exit status 1 are unchanged; only the trailing fact is new.
  • No CLI options, runtime changes, or generated-code changes are included.
  • Runtime-version mismatch is not detected by the CLI; the documented rule that the CLI and runtime are used at the same version still covers it.

Unreadable configuration files and schema or queries sources, and failures
to create an output directory, write a generated file, read or write the
output manifest, or delete a stale generated file now end with the reason
the filesystem reports. A malformed configuration file reports the YAML
problem with its one-based line and column.
A schema syntax error states the unexpected token with its line and
column instead of "Failed to parse schema", and a query syntax error
states the parser's reason after the query's header location. A lexical
error such as an unterminated string literal uses the parser's own
wording, so no diagnostic names a parser exception class.
@omer-cengel
omer-cengel merged commit d0a7417 into master Sep 26, 2026
6 checks passed
@omer-cengel
omer-cengel deleted the feature/actionable-cli-diagnostics branch September 26, 2026 20:06
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.

1 participant