Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Fix the create instance engine field

天舟c878bc2024ef
diff --git a/backend/api/instance.go b/backend/api/instance.go
index 264eb05aaf..e58eb37df8 100644
--- a/backend/api/instance.go
+++ b/backend/api/instance.go
@@ -44,7 +44,7 @@ type InstanceCreate struct {
// Domain specific fields
Name string `jsonapi:"attr,name"`
- Type db.Type `jsonapi:"attr,type"`
+ Engine db.Type `jsonapi:"attr,engine"`
ExternalLink string `jsonapi:"attr,externalLink"`
Host string `jsonapi:"attr,host"`
Port string `jsonapi:"attr,port"`
diff --git a/backend/store/instance.go b/backend/store/instance.go
index abbd1c5ea1..f84f581c61 100644
--- a/backend/store/instance.go
+++ b/backend/store/instance.go
@@ -124,6 +124,7 @@ func createInstance(ctx context.Context, tx *Tx, create *api.InstanceCreate) (*a
create.CreatorId,
create.EnvironmentId,
create.Name,
+ create.Engine,
create.ExternalLink,
create.Host,
create.Port,
diff --git a/frontend/src/components/InstanceForm.vue b/frontend/src/components/InstanceForm.vue
index a312b47602..aeb7102480 100644
--- a/frontend/src/components/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm.vue
@@ -404,6 +404,7 @@ export default {
creatorId: currentUser.value.id,
environmentId: UNKNOWN_ID,
name: "New Instance",
+ engine: "MYSQL",
host: "127.0.0.1",
username: "root",
},
diff --git a/frontend/src/types/instance.ts b/frontend/src/types/instance.ts
index 9b8c9fd5ea..98595cbff7 100644
--- a/frontend/src/types/instance.ts
+++ b/frontend/src/types/instance.ts
@@ -38,6 +38,7 @@ export type InstanceCreate = {
// Domain specific fields
name: string;
+ engine: EngineType;
externalLink?: string;
host: string;
port?: string;