Dialect options being ignored for mssql named instance

Open
#1,517 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, sql
Domain
cli, database

Research direction

Start by reproducing the db:migration command with the shown MSSQL configuration and trace how dialectOptions.instanceName is passed through the CLI connection setup. Done means the migration connects to the named instance instead of attempting HOSTNAME:1433; verify the behavior with the reported Sequelize CLI and Sequelize versions.

Written by the indexing model from the issue text.

Description

What you are doing?

I am trying to run a db:migration on a mssql server with a named instance and it's failing to connect due to the dialectOptions.instanceName not being respected

export default {
  production: {
    username: USERNAME,
    password: PASSWORD,
    database: DATABASE,
    host: HOSTNAME,
    dialect: 'mssql',
    dialectOptions: {
      instanceName: INSTANCENAME,
    }
  },
}

What do you expect to happen?

Migration to connect successfully

What is actually happening?

Migration is trying to connect to the host only

Output, either JSON or SQL
ERROR: Failed to connect to HOSTNAME:1433 - Could not connect (sequence)

Dialect: mssql
Database version: 2019
Sequelize CLI version: 6.6.2
Sequelize version: 6.37.3

Dominant language
JavaScript
Stars
2.6k
Forks
524
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sequelize/cli

All issues in sequelize/cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.