mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-09 20:37:52 +00:00
Work-around for bug in query service.
This is a temporary fix which works around the bug introduced in the query service. That bug requires a databaseID at all times. This commit lets a user configure fbsql with a databaseID.
This commit is contained in:
parent
2c3be9d1e8
commit
162ac1c33b
3 changed files with 10 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ func NewCommand(logdest logger.Logger) *Command {
|
|||
|
||||
OrganizationID: "",
|
||||
Database: "",
|
||||
DatabaseID: "",
|
||||
|
||||
CloudAuth: CloudAuthConfig{
|
||||
ClientID: defaultClientID,
|
||||
|
|
@ -376,6 +377,7 @@ func (cmd *Command) setupConfig() error {
|
|||
|
||||
cmd.organizationID = cmd.Config.OrganizationID
|
||||
cmd.database = cmd.Config.Database
|
||||
cmd.databaseID = cmd.Config.DatabaseID
|
||||
|
||||
cmd.historyPath = cmd.Config.HistoryPath
|
||||
|
||||
|
|
@ -487,6 +489,12 @@ func (cmd *Command) connectToDatabase(dbName string) error {
|
|||
p = newNopPrinter()
|
||||
}
|
||||
|
||||
if cmd.databaseID != "" {
|
||||
cmd.databaseName = "(set by id)"
|
||||
p.Printf(cmd.connectionMessage())
|
||||
return nil
|
||||
}
|
||||
|
||||
if dbName == "" {
|
||||
cmd.databaseID = ""
|
||||
cmd.databaseName = ""
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ type Config struct {
|
|||
|
||||
OrganizationID string `json:"org-id"`
|
||||
Database string `json:"db"`
|
||||
DatabaseID string `json:"db-id"`
|
||||
|
||||
// CloudAuth
|
||||
CloudAuth CloudAuthConfig `json:"cloud-auth"`
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ func buildFlags(cmd *cobra.Command, cliCmd *cli.Command) {
|
|||
flags.StringVar(&cliCmd.Config.HistoryPath, "history-path", cliCmd.Config.HistoryPath, "path for history files.")
|
||||
flags.StringVar(&cliCmd.Config.OrganizationID, "org-id", cliCmd.Config.OrganizationID, "OrganizationID.")
|
||||
flags.StringVarP(&cliCmd.Config.Database, "dbname", "d", cliCmd.Config.Database, "Name of the database to connect to.")
|
||||
flags.StringVarP(&cliCmd.Config.DatabaseID, "db-id", "", cliCmd.Config.DatabaseID, "ID of the database to connect to (TEMPORARY).")
|
||||
|
||||
flags.StringVar(&cliCmd.Config.CloudAuth.ClientID, "client-id", cliCmd.Config.CloudAuth.ClientID, "Cognito Client ID for FeatureBase Cloud access.")
|
||||
flags.StringVar(&cliCmd.Config.CloudAuth.Region, "region", cliCmd.Config.CloudAuth.Region, "Cloud region for FeatureBase Cloud access (e.g. us-east-2).")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue