Skip to content
Merged
Show file tree
Hide file tree
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
add engine to servers
  • Loading branch information
kyleconroy committed Jun 5, 2024
commit bdb3ba2246b591a68009f53c18fdf8921c6b3364
5 changes: 3 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ type Config struct {
}

type Server struct {
Name string `json:"name" yaml:"name"`
URI string `json:"uri" yaml:"uri"`
Name string `json:"name,omitempty" yaml:"name"`
Engine Engine `json:"engine,omitempty" yaml:"engine"`
URI string `json:"uri" yaml:"uri"`
}

type Database struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/dbmanager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (m *ManagedClient) CreateDatabase(ctx context.Context, req *CreateDatabaseR

var base string
for _, server := range m.servers {
if strings.HasPrefix(server.URI, "postgres://") {
if server.Engine == config.EnginePostgreSQL {
base = server.URI
break
}
Expand Down
10 changes: 6 additions & 4 deletions internal/endtoend/endtoend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ func TestReplay(t *testing.T) {
return func(c *config.Config) {
c.Servers = []config.Server{
{
Name: "postgres",
URI: local.PostgreSQLServer(),
Name: "postgres",
Engine: config.EnginePostgreSQL,
URI: local.PostgreSQLServer(),
},

{
Name: "mysql",
URI: local.MySQLServer(),
Name: "mysql",
Engine: config.EngineMySQL,
URI: local.MySQLServer(),
},
}
for i := range c.SQL {
Expand Down