Skip to content

Commit d1bbf82

Browse files
authored
feat(createdb): Add support for MySQL (#2980)
1 parent 7a16df5 commit d1bbf82

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

internal/cmd/createdb.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ func CreateDB(ctx context.Context, dir, filename, querySetName string, o *Option
6565
if count > 1 {
6666
return fmt.Errorf("multiple querysets configured to use managed databases")
6767
}
68-
if queryset.Engine != config.EnginePostgreSQL {
69-
return fmt.Errorf("managed databases currently only support PostgreSQL")
68+
69+
switch queryset.Engine {
70+
case config.EngineMySQL:
71+
// pass
72+
case config.EnginePostgreSQL:
73+
// pass
74+
default:
75+
return fmt.Errorf("createdb does not support the %s engine", queryset.Engine)
7076
}
7177

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

9096
resp, err := client.CreateEphemeralDatabase(ctx, &pb.CreateEphemeralDatabaseRequest{
91-
Engine: "postgresql",
97+
Engine: string(queryset.Engine),
9298
Region: quickdb.GetClosestRegion(),
9399
Migrations: ddl,
94100
})

0 commit comments

Comments
 (0)