MCPcopy Create free account
hub / github.com/apecloud/myduckserver / CreateDatabase

Method CreateDatabase

catalog/provider.go:487–498  ·  view source on GitHub ↗

CreateDatabase implements sql.MutableDatabaseProvider.

(ctx *sql.Context, name string)

Source from the content-addressed store, hash-verified

485 }
486 return nil
487}
488
489func (prov *DatabaseProvider) DropCatalog(name string, ifExists bool) error {
490 name = strings.TrimSpace(name)
491 // in memory database does not need to be created
492 if name == "" || name == "memory" {
493 return fmt.Errorf("cannot drop the in-memory catalog")
494 }
495 dsn := filepath.Join(prov.dataDir, name+".db")
496 // if file does not exist, return error
497 _, err := os.Stat(dsn)
498 if os.IsNotExist(err) {
499 if ifExists {
500 return nil
501 }

Callers

nothing calls this directly

Calls 3

ExecCatalogFunction · 0.92
GetCurrentCatalogFunction · 0.92
FullSchemaNameFunction · 0.85

Tested by

no test coverage detected