MCPcopy Create free account
hub / github.com/bytebase/bytebase / getMetadataForTest

Function getMetadataForTest

backend/plugin/parser/mongodb/completion_test.go:81–99  ·  view source on GitHub ↗
(_ context.Context, _, databaseName string)

Source from the content-addressed store, hash-verified

79}
80
81func getMetadataForTest(_ context.Context, _, databaseName string) (string, *model.DatabaseMetadata, error) {
82 if databaseName != "test" {
83 return "", nil, nil
84 }
85
86 return "test", model.NewDatabaseMetadata(&storepb.DatabaseSchemaMetadata{
87 Name: databaseName,
88 Schemas: []*storepb.SchemaMetadata{
89 {
90 Name: "",
91 Tables: []*storepb.TableMetadata{
92 {Name: "users"},
93 {Name: "orders"},
94 {Name: "my-collection"}, // special char - needs bracket notation
95 },
96 },
97 },
98 }, nil, nil, storepb.Engine_MONGODB, true /* isObjectCaseSensitive */), nil
99}
100
101// catchCaret finds the | marker in the input and returns:
102// - the text with the marker removed

Callers

nothing calls this directly

Calls 1

NewDatabaseMetadataFunction · 0.92

Tested by

no test coverage detected