1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-22 15:18:02 +00:00

Layout changes. Edit collection names.

This commit is contained in:
2023-01-22 21:12:56 +01:00
parent e83a02fae8
commit 4d50d43f4d
19 changed files with 265 additions and 373 deletions

View File

@ -13,6 +13,7 @@ func (a *App) OpenDatabase(hostKey, dbKey string) (collections []string) {
fmt.Println(err.Error())
return nil
}
collections, err = client.Database(dbKey).ListCollectionNames(ctx, bson.D{})
if err != nil {
fmt.Println(err.Error())
@ -23,6 +24,7 @@ func (a *App) OpenDatabase(hostKey, dbKey string) (collections []string) {
})
return nil
}
defer close()
return collections
}
@ -44,6 +46,7 @@ func (a *App) DropDatabase(hostKey, dbKey string) bool {
fmt.Println(err.Error())
return false
}
err = client.Database(dbKey).Drop(ctx)
if err != nil {
fmt.Println(err.Error())
@ -54,6 +57,7 @@ func (a *App) DropDatabase(hostKey, dbKey string) bool {
})
return false
}
defer close()
return true
}