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

Function Test_getMongodbTableFields

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

Source from the content-addressed store, hash-verified

450}
451
452func Test_getMongodbTableFields(t *testing.T) {
453 fields := []*MgoField{
454 {
455 Name: "_id",
456 Type: "primitive.ObjectID",
457 ObjectStr: "",
458 ProtoObjectStr: "",
459 },
460 {
461 Name: "age",
462 Type: "int",
463 ObjectStr: "",
464 ProtoObjectStr: "",
465 },
466 {
467 Name: "birthday",
468 Type: "time.Time",
469 ObjectStr: "",
470 ProtoObjectStr: "",
471 },
472 {
473 Name: "home_address",
474 Type: "HomeAddress",
475 ObjectStr: "type HomeAddress struct { Street string `bson:\"street\" json:\"street\"`; City string `bson:\"city\" json:\"city\"`; State string `bson:\"state\" json:\"state\"`; Zip int `bson:\"zip\" json:\"zip\"` } ",
476 ProtoObjectStr: `message HomeAddress {
477 string street = 1;
478 string city = 2;
479 string state = 3;
480 int32 zip = 4;
481 }
482 `,
483 },
484 {
485 Name: "interests",
486 Type: "[]string",
487 ObjectStr: "",
488 ProtoObjectStr: "",
489 },
490 {
491 Name: "is_child",
492 Type: "bool",
493 ObjectStr: "",
494 ProtoObjectStr: "",
495 },
496 {
497 Name: "name",
498 Type: "string",
499 ObjectStr: "",
500 ProtoObjectStr: "",
501 },
502 {
503 Name: "numbers",
504 Type: "[]int",
505 ObjectStr: "",
506 ProtoObjectStr: "",
507 },
508 {
509 Name: "shop_addresses",

Callers

nothing calls this directly

Calls 11

SetJSONTagCamelCaseFunction · 0.85
MgoFieldToGoStructFunction · 0.85
ConvertToSQLByMgoFieldsFunction · 0.85
WithDBDriverFunction · 0.85
WithFieldTypesFunction · 0.85
WithJSONTagFunction · 0.85
ParseSQLFunction · 0.85
SetJSONTagSnakeCaseFunction · 0.85
WithWebProtoFunction · 0.85
WithExtendedAPIFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected