MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / TestGetMongodbTableInfo

Function TestGetMongodbTableInfo

pkg/sql2code/parser/parser_test.go:375–390  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

373}
374
375func 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
392func TestConvertToSQLByPgFields(t *testing.T) {
393 fields := []*PGField{

Callers

nothing calls this directly

Calls 2

GetMongodbTableInfoFunction · 0.85
ConvertToSQLByMgoFieldsFunction · 0.85

Tested by

no test coverage detected