Skip to content

feat(createdb): Add support for MySQL #2980

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

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
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
12 changes: 9 additions & 3 deletions internal/cmd/createdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ func CreateDB(ctx context.Context, dir, filename, querySetName string, o *Option
if count > 1 {
return fmt.Errorf("multiple querysets configured to use managed databases")
}
if queryset.Engine != config.EnginePostgreSQL {
return fmt.Errorf("managed databases currently only support PostgreSQL")

switch queryset.Engine {
case config.EngineMySQL:
// pass
case config.EnginePostgreSQL:
// pass
default:
return fmt.Errorf("createdb does not support the %s engine", queryset.Engine)
}

var ddl []string
Expand All @@ -88,7 +94,7 @@ func CreateDB(ctx context.Context, dir, filename, querySetName string, o *Option
}

resp, err := client.CreateEphemeralDatabase(ctx, &pb.CreateEphemeralDatabaseRequest{
Engine: "postgresql",
Engine: string(queryset.Engine),
Region: quickdb.GetClosestRegion(),
Migrations: ddl,
})
Expand Down