Skip to content
Open
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions src/components/modals/NewConnectionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ interface ConnectionParams {
ssl_ca?: string;
ssl_cert?: string;
ssl_key?: string;
// SQL Server
encrypt?: string;
trust_server_certificate?: boolean;
// SSH
ssh_enabled?: boolean;
ssh_connection_id?: string;
Expand Down Expand Up @@ -126,6 +129,7 @@ export const NewConnectionModal = ({
username: "",
database: "",
ssl_mode: "",
encrypt: undefined,
ssh_enabled: false,
ssh_port: 22,
});
Expand Down Expand Up @@ -365,6 +369,7 @@ export const NewConnectionModal = ({
password: "",
database: "",
ssl_mode: "",
encrypt: undefined,
ssh_enabled: false,
ssh_connection_id: undefined,
ssh_host: undefined,
Expand Down Expand Up @@ -480,6 +485,7 @@ export const NewConnectionModal = ({
if (initialConnection) {
if (!params.password?.trim()) delete params.password;
if (!params.ssh_password?.trim()) delete params.ssh_password;
if (!params.encrypt?.trim()) delete params.encrypt;
await invoke("update_connection", {
id: initialConnection.id,
name,
Expand Down Expand Up @@ -694,6 +700,26 @@ export const NewConnectionModal = ({
/>
</div>

{/* Encrypt (SQL Server only) */}
{driver === "sqlserver" && (
<div className="flex flex-col gap-1">
<label className="text-[10px] uppercase font-semibold tracking-wider text-muted">
{t("newConnection.encrypt", { defaultValue: "Encrypt" })}
</label>
<Select
value={formData.encrypt || "yes"}
options={["yes", "no", "strict"]}
labels={{
yes: t("newConnection.encryptModes.yes", { defaultValue: "Yes" }),
no: t("newConnection.encryptModes.no", { defaultValue: "No" }),
strict: t("newConnection.encryptModes.strict", { defaultValue: "Strict" }),
}}
onChange={(v) => updateField("encrypt", v)}
searchable={false}
/>
</div>
)}

{/* User + Password */}
<div className="grid grid-cols-2 gap-3">
<FieldInput
Expand Down
6 changes: 6 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,12 @@
"allow": "Allow",
"prefer": "Prefer",
"require": "Require"
},
"encrypt": "Encrypt",
"encryptModes": {
"yes": "Yes",
"no": "No",
"strict": "Strict"
}
},
"sshConnections": {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export interface ConnectionParams {
port?: number;
username?: string;
password?: string;
ssl_mode?: string;
// SQL Server
encrypt?: string;
trust_server_certificate?: boolean;
auth_mode?: string;
ssh_enabled?: boolean;
ssh_connection_id?: string;
// Legacy fields (for backward compatibility)
Expand Down
4 changes: 4 additions & 0 deletions src/utils/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ interface ConnectionParams {
password?: string;
database: string | string[];
ssl_mode?: string;
// SQL Server
encrypt?: string;
trust_server_certificate?: boolean;
auth_mode?: string;
ssh_enabled?: boolean;
ssh_connection_id?: string;
ssh_host?: string;
Expand Down