fix: Fail on unknown PostgreSQL types instead of defaulting to string (fixes #30) #72
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.
Summary
Fixes #30 - Type Provider now fails fast on unknown PostgreSQL types instead of silently defaulting to string.
Problem
Previously,
FindStructFieldType()defaulted unknown PostgreSQL types (UUID, INET, geometric types, custom enums) todecls.String, causing:Solution
1. Added Explicit Support for Common PostgreSQL Types
decls.Bytesdecls.String(network addresses)decls.String(MAC addresses)decls.Stringdecls.Doubledecls.String(full-text search)2. Changed Default Behavior
Unknown PostgreSQL types now return
found=falseinstead of defaulting to string. This provides:3. Comprehensive Testing
Test_typeProvider_PostgreSQLTypeswith 13 test casesfound=false4. Updated Documentation
Breaking Change⚠️
Code using unsupported PostgreSQL types (e.g.,
point,polygon,box, custom enums) will now fail at type provider creation instead of silently converting to string.Migration: Add explicit support for custom types or use composite type definitions in your schema.
Testing
go test ./...passesChecklist
🤖 Generated with Claude Code