Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement metadata storage #2656

Merged
merged 41 commits into from
May 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
Dmitry committed May 17, 2023
commit add168334271af8091d18e41c0f1d750a8221b3b
14 changes: 13 additions & 1 deletion internal/backends/sqlite/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package sqlite

import (
"context"
"os"
"path/filepath"

_ "modernc.org/sqlite"

Expand Down Expand Up @@ -74,7 +76,17 @@ func (b *backend) ListDatabases(ctx context.Context, params *backends.ListDataba

// DropDatabase implements backends.Backend interface.
func (b *backend) DropDatabase(ctx context.Context, params *backends.DropDatabaseParams) error {
panic("not implemented") // TODO: Implement
err := b.metadataStorage.RemoveDatabase(params.Name)
if err != nil {
return err
}

err = os.Remove(filepath.Join(b.dir, params.Name+dbExtension))
if err != nil && !os.IsNotExist(err) {
return err
}

return nil
}

// Close implements backends.Backend interface.
Expand Down