(t *testing.T)
| 345 | } |
| 346 | |
| 347 | func TestGetPostgresqlTableInfo(t *testing.T) { |
| 348 | var ( |
| 349 | dbname = "account" |
| 350 | tableName = "user_order" |
| 351 | dsn = fmt.Sprintf("host=192.168.3.37 port=5432 user=root password=123456 dbname=%s sslmode=disable", dbname) |
| 352 | ) |
| 353 | |
| 354 | fields, err := GetPostgresqlTableInfo(dsn, tableName) |
| 355 | if err != nil { |
| 356 | t.Log(err) |
| 357 | return |
| 358 | } |
| 359 | printPGFields(fields) |
| 360 | sql, fieldTypes := ConvertToSQLByPgFields(tableName, fields) |
| 361 | t.Log(sql) |
| 362 | t.Log(fieldTypes) |
| 363 | } |
| 364 | |
| 365 | func Test_getPostgresqlTableFields(t *testing.T) { |
| 366 | defer func() { _ = recover() }() |
nothing calls this directly
no test coverage detected