test(uuid): add integration tests for SqlUUID with database

* Implement tests for inserting, updating, and retrieving UUIDs in a SQLite database.
* Verify that Value() returns a string representation of the UUID.
* Ensure compatibility with custom types implementing fmt.Stringer.
* Update type mapper imports to reflect new package path.
This commit is contained in:
Hein
2026-07-02 17:06:41 +02:00
parent ee94ddc133
commit 99d63aa5f4
7 changed files with 2557 additions and 6 deletions
+2 -2
View File
@@ -461,9 +461,9 @@ func (tm *TypeMapper) NeedsFmtImport(generateGetIDStr bool) bool {
return generateGetIDStr
}
// GetSQLTypesImport returns the import path for the ResolveSpec spectypes package.
// GetSQLTypesImport returns the import path for the spectypes package.
func (tm *TypeMapper) GetSQLTypesImport() string {
return "github.com/bitechdev/ResolveSpec/pkg/spectypes"
return "git.warky.dev/wdevs/relspecgo/pkg/spectypes"
}
// GetNullableTypeImportLine returns the full Go import line for the nullable type
+2 -2
View File
@@ -505,9 +505,9 @@ func (tm *TypeMapper) NeedsFmtImport(generateGetIDStr bool) bool {
return generateGetIDStr
}
// GetSQLTypesImport returns the import path for the ResolveSpec spectypes package.
// GetSQLTypesImport returns the import path for the spectypes package.
func (tm *TypeMapper) GetSQLTypesImport() string {
return "github.com/bitechdev/ResolveSpec/pkg/spectypes"
return "git.warky.dev/wdevs/relspecgo/pkg/spectypes"
}
// GetNullableTypeImportLine returns the full Go import line for the nullable type
+2 -2
View File
@@ -23,7 +23,7 @@ type Writer interface {
// NullableType constants control which Go package is used for nullable column types
// in code-generation writers (Bun, GORM).
const (
// NullableTypeResolveSpec uses github.com/bitechdev/ResolveSpec/pkg/spectypes
// NullableTypeResolveSpec uses git.warky.dev/wdevs/relspecgo/pkg/spectypes
// (SqlString, SqlInt32, SqlVector, SqlStringArray, …).
NullableTypeResolveSpec = "resolvespec"
@@ -52,7 +52,7 @@ type WriterOptions struct {
// NullableTypes selects the Go type package used for nullable columns in
// code-generation writers (bun, gorm). Accepted values:
// "resolvespec" (default) — github.com/bitechdev/ResolveSpec/pkg/spectypes
// "resolvespec" (default) — git.warky.dev/wdevs/relspecgo/pkg/spectypes
// "stdlib" — database/sql (sql.NullString, sql.NullInt32, …)
// "baselib" — plain Go pointer types (*string, *int32, …)
NullableTypes string