CreateDatabase implements sql.MutableDatabaseProvider.
(ctx *sql.Context, name string)
| 485 | } |
| 486 | return nil |
| 487 | } |
| 488 | |
| 489 | func (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 | } |
nothing calls this directly
no test coverage detected