better unknown type log

This commit is contained in:
ycc 2023-09-26 12:04:50 +02:00
parent fb6955465a
commit 19e7157c7b
2 changed files with 2 additions and 2 deletions

2
db.go
View File

@ -158,7 +158,7 @@ func (db *Db) QueryAssociativeArray(query string) (Rows, error) {
if reflect.ValueOf(val).IsNil() { if reflect.ValueOf(val).IsNil() {
m[colName] = nil m[colName] = nil
} else { } else {
fmt.Printf("Unknow type : %s", columnType[colName]) fmt.Printf("Unknow type : %s (%s)\n", columnType[colName], query)
m[colName] = fmt.Sprintf("%v", *val) m[colName] = fmt.Sprintf("%v", *val)
} }
} }

View File

@ -11,7 +11,7 @@ func TestPgCreateTable(t *testing.T) {
db := Open("postgres", "host=127.0.0.1 port=5432 user=test password=test dbname=test sslmode=disable") db := Open("postgres", "host=127.0.0.1 port=5432 user=test password=test dbname=test sslmode=disable")
defer db.Close() defer db.Close()
byteValue, _ := os.ReadFile("test_table.json") byteValue, _ := os.ReadFile("testtype_table.json")
var jsonSource TableInfo var jsonSource TableInfo
json.Unmarshal([]byte(byteValue), &jsonSource) json.Unmarshal([]byte(byteValue), &jsonSource)