fix(type_mapper): handle PostgreSQL array types in tags
* Update BuildBunTag to append "array" for array types * Add tests for handling array types in TypeMapper * Adjust regex in SanitizeStructTagValue to preserve array suffix
This commit is contained in:
@@ -207,7 +207,8 @@ func quoteSQLLiteral(value string) string {
|
||||
// - Returns a clean identifier safe for use in struct tags and field names
|
||||
func SanitizeStructTagValue(value string) string {
|
||||
// Remove DBML/DCTX style comments in brackets (e.g., [note: 'description'])
|
||||
commentRegex := regexp.MustCompile(`\s*\[.*?\]\s*`)
|
||||
// Require at least one character inside brackets to avoid stripping PostgreSQL array suffix "[]"
|
||||
commentRegex := regexp.MustCompile(`\s*\[[^\]]+\]\s*`)
|
||||
value = commentRegex.ReplaceAllString(value, "")
|
||||
|
||||
// Trim whitespace
|
||||
|
||||
Reference in New Issue
Block a user