MCPcopy Index your code
hub / github.com/bytebase/bytebase / getMetadataForTest

Function getMetadataForTest

backend/plugin/parser/mysql/completion_test.go:98–141  ·  view source on GitHub ↗
(_ context.Context, _, databaseName string)

Source from the content-addressed store, hash-verified

96}
97
98func getMetadataForTest(_ context.Context, _, databaseName string) (string, *model.DatabaseMetadata, error) {
99 if databaseName != "db" {
100 return "", nil, nil
101 }
102
103 return "db", model.NewDatabaseMetadata(&storepb.DatabaseSchemaMetadata{
104 Name: databaseName,
105 Schemas: []*storepb.SchemaMetadata{
106 {
107 Name: "",
108 Tables: []*storepb.TableMetadata{
109 {
110 Name: "t1",
111 Columns: []*storepb.ColumnMetadata{
112 {
113 Name: "c1",
114 },
115 },
116 },
117 {
118 Name: "t2",
119 Columns: []*storepb.ColumnMetadata{
120 {
121 Name: "c1",
122 },
123 {
124 Name: "c2",
125 },
126 },
127 },
128 },
129 Views: []*storepb.ViewMetadata{
130 {
131 Name: "v1",
132 Definition: `CREATE VIEW v1 AS
133 SELECT *
134 FROM t1
135 `,
136 },
137 },
138 },
139 },
140 }, nil, nil, storepb.Engine_MYSQL, true /* isObjectCaseSensitive */), nil
141}
142
143// catchCaretLineColumn returns the SQL without the caret marker and the
144// 1-based line + 0-based column of the caret position. Handles multiline input.

Callers

nothing calls this directly

Calls 1

NewDatabaseMetadataFunction · 0.92

Tested by

no test coverage detected