Skip to content

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

chore: adding extra params (#15419)

Vincent Huang1b8fc514a6f6
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index 552b41cceb..e902bec1ca 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -656,6 +656,8 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
dataSource.MasterUsername = request.DataSource.MasterUsername
case "master_password":
dataSource.MasterPassword = request.DataSource.MasterPassword
+ case "extra_connection_parameters":
+ dataSource.ExtraConnectionParameters = request.DataSource.ExtraConnectionParameters
case "iam_extension", "client_secret_credential":
// TODO(zp): Remove the hack while frontend use new oneof artifact.
if v := request.DataSource.IamExtension; v != nil {
@@ -979,25 +981,26 @@ func convertDataSources(dataSources []*storepb.DataSource) ([]*v1pb.DataSource,
Type: dataSourceType,
Username: ds.GetUsername(),
// We don't return the password and SSLs on reads.
- Host: ds.GetHost(),
- Port: ds.GetPort(),
- Database: ds.GetDatabase(),
- Srv: ds.GetSrv(),
- AuthenticationDatabase: ds.GetAuthenticationDatabase(),
- Sid: ds.GetSid(),
- ServiceName: ds.GetServiceName(),
- ExternalSecret: externalSecret,
- AuthenticationType: authenticationType,
- SaslConfig: convertDataSourceSaslConfig(ds.GetSaslConfig()),
- AdditionalAddresses: convertDataSourceAddresses(ds.GetAdditionalAddresses()),
- ReplicaSet: ds.GetReplicaSet(),
- DirectConnection: ds.GetDirectConnection(),
- Region: ds.GetRegion(),
- WarehouseId: ds.GetWarehouseId(),
- UseSsl: ds.GetUseSsl(),
- RedisType: convertRedisType(ds.GetRedisType()),
- MasterName: ds.GetMasterName(),
- MasterUsername: ds.GetMasterUsername(),
+ Host: ds.GetHost(),
+ Port: ds.GetPort(),
+ Database: ds.GetDatabase(),
+ Srv: ds.GetSrv(),
+ AuthenticationDatabase: ds.GetAuthenticationDatabase(),
+ Sid: ds.GetSid(),
+ ServiceName: ds.GetServiceName(),
+ ExternalSecret: externalSecret,
+ AuthenticationType: authenticationType,
+ SaslConfig: convertDataSourceSaslConfig(ds.GetSaslConfig()),
+ AdditionalAddresses: convertDataSourceAddresses(ds.GetAdditionalAddresses()),
+ ReplicaSet: ds.GetReplicaSet(),
+ DirectConnection: ds.GetDirectConnection(),
+ Region: ds.GetRegion(),
+ WarehouseId: ds.GetWarehouseId(),
+ UseSsl: ds.GetUseSsl(),
+ RedisType: convertRedisType(ds.GetRedisType()),
+ MasterName: ds.GetMasterName(),
+ MasterUsername: ds.GetMasterUsername(),
+ ExtraConnectionParameters: ds.GetExtraConnectionParameters(),
}
if clientSecretCredential := convertClientSecretCredential(ds.GetClientSecretCredential()); clientSecretCredential != nil {
clientSecretCredential.ClientSecret = ""
@@ -1188,39 +1191,40 @@ func convertV1DataSource(dataSource *v1pb.DataSource) (*storepb.DataSource, erro
saslConfig := convertV1DataSourceSaslConfig(dataSource.SaslConfig)
storeDataSource := &storepb.DataSource{
- Id: dataSource.Id,
- Type: dsType,
- Username: dataSource.Username,
- Password: dataSource.Password,
- SslCa: dataSource.SslCa,
- SslCert: dataSource.SslCert,
- SslKey: dataSource.SslKey,
- Host: dataSource.Host,
- Port: dataSource.Port,
- Database: dataSource.Database,
- Srv: dataSource.Srv,
- AuthenticationDatabase: dataSource.AuthenticationDatabase,
- Sid: dataSource.Sid,
- ServiceName: dataSource.ServiceName,
- SshHost: dataSource.SshHost,
- SshPort: dataSource.SshPort,
- SshUser: dataSource.SshUser,
- SshPassword: dataSource.SshPassword,
- SshPrivateKey: dataSource.SshPrivateKey,
- AuthenticationPrivateKey: dataSource.AuthenticationPrivateKey,
- ExternalSecret: externalSecret,
- SaslConfig: saslConfig,
- AuthenticationType: convertV1AuthenticationType(dataSource.AuthenticationType),
- AdditionalAddresses: convertAdditionalAddresses(dataSource.AdditionalAddresses),
- ReplicaSet: dataSource.ReplicaSet,
- DirectConnection: dataSource.DirectConnection,
- Region: dataSource.Region,
- WarehouseId: dataSource.WarehouseId,
- UseSsl: dataSource.UseSsl,
- RedisType: convertV1RedisType(dataSource.RedisType),
- MasterName: dataSource.MasterName,
- MasterUsername: dataSource.MasterUsername,
- MasterPassword: dataSource.MasterPassword,
+ Id: dataSource.Id,
+ Type: dsType,
+ Username: dataSource.Username,
+ Password: dataSource.Password,
+ SslCa: dataSource.SslCa,
+ SslCert: dataSource.SslCert,
+ SslKey: dataSource.SslKey,
+ Host: dataSource.Host,
+ Port: dataSource.Port,
+ Database: dataSource.Database,
+ Srv: dataSource.Srv,
+ AuthenticationDatabase: dataSource.AuthenticationDatabase,
+ Sid: dataSource.Sid,
+ ServiceName: dataSource.ServiceName,
+ SshHost: dataSource.SshHost,
+ SshPort: dataSource.SshPort,
+ SshUser: dataSource.SshUser,
+ SshPassword: dataSource.SshPassword,
+ SshPrivateKey: dataSource.SshPrivateKey,
+ AuthenticationPrivateKey: dataSource.AuthenticationPrivateKey,
+ ExternalSecret: externalSecret,
+ SaslConfig: saslConfig,
+ AuthenticationType: convertV1AuthenticationType(dataSource.AuthenticationType),
+ AdditionalAddresses: convertAdditionalAddresses(dataSource.AdditionalAddresses),
+ ReplicaSet: dataSource.ReplicaSet,
+ DirectConnection: dataSource.DirectConnection,
+ Region: dataSource.Region,
+ WarehouseId: dataSource.WarehouseId,
+ UseSsl: dataSource.UseSsl,
+ RedisType: convertV1RedisType(dataSource.RedisType),
+ MasterName: dataSource.MasterName,
+ MasterUsername: dataSource.MasterUsername,
+ MasterPassword: dataSource.MasterPassword,
+ ExtraConnectionParameters: dataSource.ExtraConnectionParameters,
}
if v := dataSource.IamExtension; v != nil {
if _, ok := v.(*v1pb.DataSource_ClientSecretCredential_); ok {
diff --git a/frontend/src/components/InstanceForm/Buttons.vue b/frontend/src/components/InstanceForm/Buttons.vue
index 508c522cd1..06a633e8fc 100644
--- a/frontend/src/components/InstanceForm/Buttons.vue
+++ b/frontend/src/components/InstanceForm/Buttons.vue
@@ -49,17 +49,12 @@
</template>
<script setup lang="ts">
-import { cloneDeep, isEqual } from "lodash-es";
-import { NButton } from "naive-ui";
-import { computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import {
+ pushNotification,
useDatabaseV1Store,
+ useGracefulRequest,
useInstanceV1Store,
useSubscriptionV1Store,
- useGracefulRequest,
- pushNotification,
} from "@/store";
import { Engine } from "@/types/proto/v1/common";
import {
@@ -67,7 +62,12 @@ import {
DataSourceType,
Instance,
} from "@/types/proto/v1/instance_service";
-import { isValidSpannerHost, defer } from "@/utils";
+import { defer, isValidSpannerHost } from "@/utils";
+import { cloneDeep, isEqual } from "lodash-es";
+import { NButton } from "naive-ui";
+import { computed, ref } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
import ScanIntervalInput from "./ScanIntervalInput.vue";
import {
calcDataSourceUpdateMask,
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
index 29b01f8f3a..e690a2884d 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
@@ -826,6 +826,83 @@ MIIEvQ...
/>
</div>
+ <div
+ v-if="basicInfo.engine === Engine.POSTGRES"
+ class="mt-4 sm:col-span-3 sm:col-start-1"
+ >
+ <div class="flex flex-row items-center justify-between">
+ <label class="textlabel block">
+ {{ $t("data-source.extra-params.self") }}
+ </label>
+ </div>
+ <div class="text-gray-400 text-sm mt-1 mb-2">
+ {{ $t("data-source.extra-params.description") }}
+ </div>
+
+ <!-- Add parameter form -->
+ <div v-if="allowEdit" class="flex mt-2 mb-4 space-x-2 bg-gray-50 p-3 rounded-md">
+ <NInput
+ v-model:value="newParam.key"
+ class="w-full"
+ :placeholder="$t('instance.parameter-name-placeholder')"
+ />
+ <NInput
+ v-model:value="newParam.value"
+ class="w-full"
+ :placeholder="$t('instance.parameter-value-placeholder')"
+ />
+ <NButton
+ type="primary"
+ ghost
+ size="small"
+ :disabled="!newParam.key.trim()"
+ @click="addNewParameter"
+ >
+ Add
+ </NButton>
+ </div>
+
+ <!-- Existing parameters -->
+ <div
+ v-for="(param, index) in extraConnectionParamsList"
+ :key="param.key"
+ class="flex mt-2 space-x-2"
+ >
+ <NInput
+ class="w-full"
+ :value="param.key"
+ :disabled="!allowEdit"
+ placeholder="Parameter name"
+ @update:value="(v) => updateExtraConnectionParamKey(index, v)"
+ />
+ <NInput
+ class="w-full"
+ :value="param.value"
+ :disabled="!allowEdit"
+ placeholder="Parameter value"
+ @update:value="(v) => updateExtraConnectionParamValue(index, v)"
+ />
+ <NButton
+ v-if="allowEdit"
+ type="error"
+ secondary
+ size="small"
+ @click="removeExtraConnectionParam(index)"
+ title="Remove parameter"
+ >
+ Remove
+ </NButton>
+ </div>
+
+ <!-- Show a message when there are no parameters -->
+ <div
+ v-if="extraConnectionParamsList.length === 0"
+ class="text-gray-500 text-sm mt-2 italic"
+ >
+ {{ allowEdit ? $t('instance.no-params-yet-add-above') : $t('instance.no-extra-params-configured') }}
+ </div>
+ </div>
+
<div
v-if="
showSSL &&
@@ -974,6 +1051,11 @@ interface IAMExtensionOptions {
value: string;
}
+interface ExtraConnectionParam {
+ key: string;
+ value: string;
+}
+
const props = defineProps<{
dataSource: EditDataSource;
}>();
@@ -1004,6 +1086,19 @@ const state = reactive<LocalState>({
passwordType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
credentialSource: "default-credential",
});
+
+// Use a simpler approach to track new parameters
+const newParam = reactive({ key: "", value: "" });
+
+// Helper computed to convert object to array for UI
+const extraConnectionParamsList = computed<ExtraConnectionParam[]>(() => {
+ // Ensure we're using a non-null object for the params
+ const params = props.dataSource.extraConnectionParameters || {};
+
+ // Convert to plain entries for display
+ return Object.entries(params)
+ .map(([key, value]) => ({ key, value }));
+});
const { t } = useI18n();
watch(
@@ -1263,6 +1358,7 @@ const handleKeytabUpload = (options: { file: UploadFileInfo }) => {
reader.readAsArrayBuffer(options.file.file as Blob);
};
+// IAM Extension Options
const getIAMExtensionOptions = (
authenticationType: DataSource_AuthenticationType
): IAMExtensionOptions[] => {
@@ -1294,4 +1390,104 @@ const resetIAMExtension = () => {
const ds = props.dataSource;
ds.clientSecretCredential = undefined;
};
+
+// Extra connection parameters management
+const addNewParameter = () => {
+ // Skip if key is empty
+ if (!newParam.key.trim()) return;
+
+ const ds = props.dataSource;
+
+ // Get plain params object using our helper
+ const plainParams = createPlainParamsObject(ds.extraConnectionParameters);
+
+ // Add the new parameter
+ const trimmedKey = newParam.key.trim();
+ plainParams[trimmedKey] = newParam.value;
+
+ // Create a fresh object to ensure we're using a plain JS object
+ const freshParams: Record<string, string> = {};
+ Object.keys(plainParams).forEach(key => {
+ freshParams[key] = plainParams[key];
+ });
+
+ // Set the object directly using a brand new object
+ ds.extraConnectionParameters = freshParams;
+
+ // Clear the form
+ newParam.key = "";
+ newParam.value = "";
+};
+
+// Helper function to create plain parameters object from existing parameters
+const createPlainParamsObject = (existingParams: Record<string, string> | undefined): Record<string, string> => {
+ const plainParams: Record<string, string> = {};
+
+ if (existingParams) {
+ // Copy all properties from the potentially proxied object
+ Object.entries(existingParams).forEach(([key, value]) => {
+ plainParams[key] = value;
+ });
+ }
+
+ return plainParams;
+};
+
+const updateExtraConnectionParamKey = (index: number, newKey: string) => {
+ const ds = props.dataSource;
+ const params = extraConnectionParamsList.value;
+ if (index >= params.length) return;
+
+ // Get plain params object
+ const plainParams = createPlainParamsObject(ds.extraConnectionParameters);
+
+ const oldKey = params[index].key;
+ const value = params[index].value;
+
+ // Skip if the key hasn't changed
+ if (oldKey === newKey) return;
+
+ // Delete the old key
+ delete plainParams[oldKey];
+
+ // Only add if the key is not empty
+ if (newKey.trim()) {
+ plainParams[newKey] = value;
+ }
+
+ // Set the object directly
+ ds.extraConnectionParameters = plainParams;
+};
+
+const updateExtraConnectionParamValue = (index: number, newValue: string) => {
+ const ds = props.dataSource;
+ const params = extraConnectionParamsList.value;
+ if (index >= params.length) return;
+
+ const key = params[index].key;
+
+ // Get plain params object
+ const plainParams = createPlainParamsObject(ds.extraConnectionParameters);
+
+ // Update the value
+ plainParams[key] = newValue;
+
+ // Set the object directly
+ ds.extraConnectionParameters = plainParams;
+};
+
+const removeExtraConnectionParam = (index: number) => {
+ const ds = props.dataSource;
+ const params = extraConnectionParamsList.value;
+ if (index >= params.length) return;
+
+ // Get plain params object
+ const plainParams = createPlainParamsObject(ds.extraConnectionParameters);
+
+ // Remove the parameter
+ delete plainParams[params[index].key];
+
+ // Set the object directly
+ ds.extraConnectionParameters = plainParams;
+};
</script>
diff --git a/frontend/src/components/InstanceForm/common.ts b/frontend/src/components/InstanceForm/common.ts
index ff22d6c42f..0936d09c0d 100644
--- a/frontend/src/components/InstanceForm/common.ts
+++ b/frontend/src/components/InstanceForm/common.ts
@@ -1,4 +1,3 @@
-import { cloneDeep, first } from "lodash-es";
import { t } from "@/plugins/i18n";
import { useInstanceV1Store, useSubscriptionV1Store } from "@/store";
import {
@@ -11,6 +10,7 @@ import type { DataSource, Instance } from "@/types/proto/v1/instance_service";
import { DataSourceType } from "@/types/proto/v1/instance_service";
import { PlanType } from "@/types/proto/v1/subscription_service";
import { calcUpdateMask } from "@/utils";
+import { cloneDeep, first } from "lodash-es";
export type BasicInfo = Omit<Instance, "dataSources" | "engineVersion">;
@@ -23,6 +23,7 @@ export type EditDataSource = DataSource & {
updateSsl?: boolean;
updateSsh?: boolean;
updateAuthenticationPrivateKey?: boolean;
+ extraConnectionParameters?: Record<string, string>;
};
export type DataSourceEditState = {
@@ -90,6 +91,30 @@ export const wrapEditDataSource = (ds: DataSource | undefined) => {
};
};
+/**
+ * Applies the extra connection parameters from an EditDataSource to a DataSource object
+ * This ensures that the extraConnectionParameters are properly handled as plain objects
+ */
+export const applyExtraConnectionParameters = (
+ dataSource: DataSource,
+ editState: EditDataSource
+): DataSource => {
+ // Make sure dataSource has the correct extraConnectionParameters
+ if (editState.extraConnectionParameters) {
+ // Clone the map manually to ensure it's a plain object, not a Proxy
+ const params: Record<string, string> = {};
+ Object.entries(editState.extraConnectionParameters).forEach(([key, value]) => {
+ params[key] = value;
+ });
+
+ dataSource.extraConnectionParameters = params;
+ } else {
+ dataSource.extraConnectionParameters = {};
+ }
+
+ return dataSource;
+};
+
export const calcDataSourceUpdateMask = (
editing: DataSource,
original: DataSource,
diff --git a/frontend/src/components/InstanceForm/context.ts b/frontend/src/components/InstanceForm/context.ts
index 19351e0938..d5191842ec 100644
--- a/frontend/src/components/InstanceForm/context.ts
+++ b/frontend/src/components/InstanceForm/context.ts
@@ -1,9 +1,3 @@
-import Emittery from "emittery";
-import { cloneDeep, omit, isEqual } from "lodash-es";
-import { useDialog } from "naive-ui";
-import type { InjectionKey, Ref } from "vue";
-import { provide, inject, computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
import { instanceServiceClient } from "@/grpcweb";
import {
pushNotification,
@@ -30,6 +24,12 @@ import {
isValidSpannerHost,
} from "@/utils";
import { extractGrpcErrorMessage } from "@/utils/grpcweb";
+import Emittery from "emittery";
+import { cloneDeep, isEqual, omit } from "lodash-es";
+import { useDialog } from "naive-ui";
+import type { InjectionKey, Ref } from "vue";
+import { computed, inject, provide, ref } from "vue";
+import { useI18n } from "vue-i18n";
import type { ResourceIdField } from "../v2";
import type { EditDataSource } from "./common";
import {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 796318cda6..a4f76d109c 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1235,7 +1235,11 @@
"description": "Filter by address"
}
}
- }
+ },
+ "no-params-yet-add-above": "No parameters configured yet. Add parameters using the form above.",
+ "no-extra-params-configured": "No extra connection parameters configured",
+ "parameter-name-placeholder": "Parameter name",
+ "parameter-value-placeholder": "Parameter value"
},
"environment": {
"select": "Select environment",
@@ -1653,9 +1657,12 @@
"revoke-exemption-title": "Remove both export and query masking exemptions for {member}?"
}
},
-
"data-source": {
"snowflake-keypair-tip": "Key-pair authentication",
+ "extra-params": {
+ "self": "Extra Parameters",
+ "description": "Additional parameters for database connection string. For PostgreSQL, you can use parameters like target_session_attrs=read-write to ensure connections to read-write instances."
+ },
"ssl": {
"ca-cert": "CA Certificate",
"client-key": "Client Key",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 178f85ae34..069c338daa 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1235,7 +1235,11 @@
"description": "Filtrar por dirección"
}
}
- }
+ },
+ "no-params-yet-add-above": "No hay parámetros configurados todavía. \nAgregue parámetros usando el formulario anterior.",
+ "no-extra-params-configured": "No hay parámetros de conexión adicionales configurados",
+ "parameter-value-placeholder": "Valor de parámetro",
+ "parameter-name-placeholder": "Nombre de parámetro"
},
"environment": {
"select": "Seleccionar entorno",
@@ -1655,6 +1659,10 @@
},
"data-source": {
"snowflake-keypair-tip": "Autenticación de par de claves",
+ "extra-params": {
+ "self": "Parámetros adicionales",
+ "description": "Parámetros adicionales para la cadena de conexión de la base de datos. \nPara PostgreSQL, puede usar parámetros como Target_Session_Attrs = Read-Write para garantizar las conexiones a instancias de lectura-escritura."
+ },
"ssl": {
"ca-cert": "Certificado de CA",
"client-key": "Clave del cliente",
@@ -2586,4 +2594,4 @@
"last-visit": "Última visita",
"changelog-for-version": "Registro de cambios para {version}"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index ec1581c3ae..d3faf48bf0 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1235,7 +1235,11 @@
"description": "住所でフィルタリング"
}
}
- }
+ },
+ "no-params-yet-add-above": "まだ構成されていません。\n上記のフォームを使用してパラメーターを追加します。",
+ "no-extra-params-configured": "追加の接続パラメーターは構成されていません",
+ "parameter-value-placeholder": "パラメーター値",
+ "parameter-name-placeholder": "パラメーター名"
},
"environment": {
"select": "環境を選ぶ",
@@ -1655,6 +1659,10 @@
},
"data-source": {
"snowflake-keypair-tip": "キーペア認証",
+ "extra-params": {
+ "self": "追加のパラメーター",
+ "description": "データベース接続文字列の追加パラメーター。 \nPostgreSQLの場合、ターゲット_session_attrs= read-writeなどのパラメーターを使用して、読み取りワイトインスタンスへの接続を確保できます。"
+ },
"ssl": {
"ca-cert": "CA証明書",
"client-key": "クライアントキー",
@@ -2586,4 +2594,4 @@
"last-visit": "最終訪問",
"changelog-for-version": "{version} の変更履歴"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 765e42cfc6..de88e632d3 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1235,7 +1235,11 @@
"description": "Lọc theo địa chỉ"
}
}
- }
+ },
+ "no-params-yet-add-above": "Chưa có thông số nào được cấu hình. \nThêm tham số bằng cách sử dụng biểu mẫu trên.",
+ "no-extra-params-configured": "Không có thông số kết nối bổ sung được cấu hình",
+ "parameter-value-placeholder": "Giá trị tham số",
+ "parameter-name-placeholder": "Tên tham số"
},
"environment": {
"select": "Chọn môi trường",
@@ -1655,6 +1659,10 @@
},
"data-source": {
"snowflake-keypair-tip": "Xác thực cặp khóa",
+ "extra-params": {
+ "self": "Thông số bổ sung",
+ "description": "Các tham số bổ sung cho chuỗi kết nối cơ sở dữ liệu. \nĐối với PostgreSQL, bạn có thể sử dụng các tham số như target_session_attrs = read-write để đảm bảo kết nối với các phiên bản đọc-write."
+ },
"ssl": {
"ca-cert": "Chứng chỉ CA",
"client-key": "Khóa máy khách",
@@ -2586,4 +2594,4 @@
"last-visit": "Lần truy cập cuối",
"changelog-for-version": "Nhật ký thay đổi cho phiên bản {version}"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 1d446a8ba6..63e5b6617f 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1235,7 +1235,11 @@
"description": "按地址过滤"
}
}
- }
+ },
+ "no-params-yet-add-above": "尚未配置参数。\n使用上面的形式添加参数。",
+ "no-extra-params-configured": "没有配置的额外连接参数",
+ "parameter-value-placeholder": "参数值",
+ "parameter-name-placeholder": "参数名称"
},
"environment": {
"select": "选择环境",
@@ -1655,6 +1659,10 @@
},
"data-source": {
"snowflake-keypair-tip": "密钥对认证",
+ "extra-params": {
+ "self": "额外的参数",
+ "description": "数据库连接字符串的其他参数。\n对于PostgreSQL,您可以使用诸如target_session_attrs = read-write之类的参数来确保与读取文字实例的连接。"
+ },
"ssl": {
"ca-cert": "CA 证书",
"client-key": "客户端密钥",
diff --git a/frontend/src/store/modules/v1/instance.ts b/frontend/src/store/modules/v1/instance.ts
index 3c372bfa1e..fcbfcf0530 100644
--- a/frontend/src/store/modules/v1/instance.ts
+++ b/frontend/src/store/modules/v1/instance.ts
@@ -1,11 +1,11 @@
-import { defineStore } from "pinia";
-import { computed, reactive, watchEffect } from "vue";
import { instanceServiceClient } from "@/grpcweb";
import type { ComposedInstance } from "@/types";
import { unknownEnvironment, unknownInstance } from "@/types";
import { State } from "@/types/proto/v1/common";
import type { DataSource, Instance } from "@/types/proto/v1/instance_service";
import { extractInstanceResourceName, hasWorkspacePermissionV2 } from "@/utils";
+import { defineStore } from "pinia";
+import { computed, reactive, watchEffect } from "vue";
import { useListCache } from "./cache";
import { useEnvironmentV1Store } from "./environment";