(t *testing.T)
| 373 | } |
| 374 | |
| 375 | func TestGetMongodbTableInfo(t *testing.T) { |
| 376 | var ( |
| 377 | dbname = "account" |
| 378 | tableName = "people" |
| 379 | dsn = fmt.Sprintf("mongodb://root:123456@192.168.3.37:27017/%s", dbname) |
| 380 | ) |
| 381 | |
| 382 | fields, err := GetMongodbTableInfo(dsn, tableName) |
| 383 | if err != nil { |
| 384 | t.Log(err) |
| 385 | return |
| 386 | } |
| 387 | sql, fieldTypes := ConvertToSQLByMgoFields(tableName, fields) |
| 388 | t.Log(sql) |
| 389 | t.Log(fieldTypes) |
| 390 | } |
| 391 | |
| 392 | func TestConvertToSQLByPgFields(t *testing.T) { |
| 393 | fields := []*PGField{ |
nothing calls this directly
no test coverage detected