Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

feat: improve error message for unsupported database types #40

Merged
merged 3 commits into from
Jun 22, 2025

Conversation

tunamaguro
Copy link
Owner

Summary

  • Fix error message format from Debug to Display for better readability
  • Improve InvalidRustType error message to provide clear guidance on using overrides configuration
  • Make error messages more user-friendly and actionable

Changes

  • Changed {e:#?} to {e} in main.rs to use Display format instead of Debug
  • Updated InvalidRustType error message to explain the issue and suggest solution
  • Error now clearly indicates how to resolve the issue using the 'overrides' section in sqlc.json

Test plan

  • Tested with unsupported database type (pg_catalog.interval)
  • Verified new error message is displayed correctly
  • Confirmed Display format is used instead of Debug format

Before

error generating code: InvalidRustType(
    "pg_catalog.interval",
)

After

error generating code: Cannot find rust type that matches column type of `pg_catalog.interval`. Add an entry to the 'overrides' section in your sqlc.json configuration.

Closes #39

🤖 Generated with Claude Code

tunamaguro and others added 3 commits June 22, 2025 08:00
- Change Debug format to Display format in main.rs error output
- Update InvalidRustType error message to provide clear guidance on using overrides configuration
- Error now suggests adding entries to 'overrides' section in sqlc.json

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@tunamaguro tunamaguro merged commit 822c0ce into main Jun 22, 2025
3 checks passed
@tunamaguro tunamaguro deleted the rewrite-error-command branch June 22, 2025 08:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for unsupported database types
1 participant