Skip to content

feat(sqlserver): add Encrypt dropdown to connection dialog#236

Open
saurabh500 wants to merge 2 commits into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/sqlserver-encrypt-option
Open

feat(sqlserver): add Encrypt dropdown to connection dialog#236
saurabh500 wants to merge 2 commits into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/sqlserver-encrypt-option

Conversation

@saurabh500
Copy link
Copy Markdown
Contributor

Summary

Adds an Encrypt dropdown to the New Connection modal when the driver is SQL Server. Three options: Yes (default), No, Strict.

The backend already accepts the encrypt field on ConnectionParams and maps it correctly in pool.rs::build_config (strictRequired, noNotSupported, default → On). This PR only adds the missing UI control.

Changes

  • src/components/modals/NewConnectionModal.tsx — local interface field, formData seed, driver-change reset, and conditional <Select> rendered for driver === "sqlserver" between the host/port grid and credentials block.
  • src/i18n/locales/en.jsonnewConnection.encrypt label + encryptModes.{yes,no,strict} option labels (mirroring the existing sslModes pattern).

Why draft

The new encrypt value is not yet threaded into the connection save/load path (i.e., the Config mapping where saved connections are reloaded into the dialog). Marking draft until that round-trip is wired so a saved connection re-opens with the previously chosen Encrypt setting.

Manual test

  1. Open New Connection → choose SQL Server → confirm the Encrypt dropdown appears between Host/Port and User/Password.
  2. Switch driver away from SQL Server → confirm the dropdown disappears and encrypt is reset.
  3. Pick Strict → connect to a server requiring TLS → confirms the value reaches the backend (existing build_config test coverage already validates the mapping).

Out of scope

  • trust_server_certificate UI control (field exists on the interface, no surface yet).
  • Persisting encrypt on saved connections (the "why draft" item above).
  • Other locale files; English-only for now, falls back via defaultValue.

saurabh500 and others added 2 commits May 20, 2026 18:02
Adds an Encrypt selector (Yes/No/Strict) to the New Connection
modal when driver is SQL Server. Frontend-only wiring; backend
already supports the encrypt field on ConnectionParams.

Note (draft): the new field still needs to be threaded through
connection save/load (Config mapping) before this can ship.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change encrypt default from empty string to undefined; backend already
  defaults to EncryptionLevel::On when None, matching 'yes' behavior
- Normalize empty encrypt string on save to avoid stale '' values from
  old connections
- Add encrypt, trust_server_certificate, auth_mode to canonical
  ConnectionParams in connections.ts and credentials.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@saurabh500 saurabh500 marked this pull request as ready for review May 21, 2026 06:03
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 21, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • src/components/modals/NewConnectionModal.tsx — Adds encrypt field to local interface, form state, driver-change reset, update-connection delete-guard, and conditional <Select> rendered for driver === "sqlserver". Follows the existing ssl_mode Select pattern.
  • src/i18n/locales/en.json — Adds newConnection.encrypt label and encryptModes.{yes,no,strict} translations, mirroring the existing sslModes structure.
  • src/utils/connections.ts — Backfills ssl_mode, encrypt, trust_server_certificate, and auth_mode into the shared ConnectionParams interface.
  • src/utils/credentials.ts — Adds encrypt, trust_server_certificate, and auth_mode to the credentials-layer ConnectionParams interface.

Reviewed by kimi-k2.6 · 259,128 tokens

@saurabh500
Copy link
Copy Markdown
Contributor Author

This still needs work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant