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

Method getDatabases

backend/plugin/db/sqlite/sqlite.go:94–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func (d *Driver) getDatabases() ([]string, error) {
95 files, err := os.ReadDir(d.dir)
96 if err != nil {
97 return nil, errors.Wrapf(err, "failed to read directory %q", d.dir)
98 }
99 var databases []string
100 for _, file := range files {
101 if file.IsDir() || !strings.HasSuffix(file.Name(), ".db") {
102 continue
103 }
104 databases = append(databases, strings.TrimSuffix(file.Name(), ".db"))
105 }
106 return databases, nil
107}
108
109// Execute executes a SQL statement.
110func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOptions) (int64, error) {

Callers 3

SyncInstanceMethod · 0.95
SyncDBSchemaMethod · 0.95
DumpMethod · 0.95

Implementers 15

MockDriverbackend/plugin/advisor/utils_for_tests
Driverbackend/plugin/db/bigquery/bigquery.go
Driverbackend/plugin/db/mongodb/mongodb.go
Driverbackend/plugin/db/trino/trino.go
Driverbackend/plugin/db/redshift/redshift.go
Driverbackend/plugin/db/oracle/oracle.go
Driverbackend/plugin/db/dynamodb/dynamodb.go
Driverbackend/plugin/db/cosmosdb/cosmosdb.go
Driverbackend/plugin/db/spanner/spanner.go
Driverbackend/plugin/db/mssql/mssql.go
Driverbackend/plugin/db/mysql/mysql.go
Driverbackend/plugin/db/pg/pg.go

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected