Skip to content

fix: show database name field for SQL Server connections#185

Merged
tianzhou merged 1 commit into
sqlchat:mainfrom
octo-patch:fix/issue-166-mssql-database-field
Apr 21, 2026
Merged

fix: show database name field for SQL Server connections#185
tianzhou merged 1 commit into
sqlchat:mainfrom
octo-patch:fix/issue-166-mssql-database-field

Conversation

@octo-patch
Copy link
Copy Markdown
Contributor

Fixes #166

Problem

The database name field in the connection modal was only shown for PostgreSQL connections. SQL Server (MSSQL) also requires specifying a database name to establish a proper connection. Without this field, users cannot target a specific database when connecting to SQL Server, resulting in connection failures.

Solution

Updated showDatabaseField condition in CreateConnectionModal.tsx to also show the database name input field when SQL Server engine is selected:

// Before
const showDatabaseField = connection.engineType === Engine.PostgreSQL;

// After
const showDatabaseField = connection.engineType === Engine.PostgreSQL || connection.engineType === Engine.MSSQL;

The MSSQL connector already supports the database property in the connection object — this change simply exposes it in the UI.

Testing

  • Select SQL Server as the database type in the connection modal
  • Verify the "Database Name" field now appears
  • Connect to a SQL Server instance with the database name specified

Copy link
Copy Markdown
Member

@tianzhou tianzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tianzhou tianzhou merged commit 665af87 into sqlchat:main Apr 21, 2026
1 check passed
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.

Can't connect to SQL Server

2 participants