Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing type for instanceName in MssqlConnectionNode #916

Closed
Imunal opened this issue Jan 28, 2023 · 3 comments
Closed

Missing type for instanceName in MssqlConnectionNode #916

Imunal opened this issue Jan 28, 2023 · 3 comments
Labels
Status: Abandoned Dropped and not into consideration

Comments

@Imunal
Copy link
Contributor

Imunal commented Jan 28, 2023

Information

Recently I found that the type is missing for instanceName in connection option for MSSQL.
https://tediousjs.github.io/node-mssql#tedious

Package version

"@adonisjs/lucid": "^18.3.0"

Node.js and npm version

NodeJS: v18.12.1
NPM: 8.19.2

Sample Code (to reproduce the issue)

mssql: {
      client: 'mssql',
      connection: {
        user: Env.get('MSSQL_USER'),
        port: Env.get('MSSQL_PORT'),
        server: Env.get('MSSQL_SERVER'),
        password: Env.get('MSSQL_PASSWORD', ''),
        database: Env.get('MSSQL_DB_NAME'),
        options: {
          instanceName: 'sql2014',
        },
      },
      migrations: {
        naturalSort: true,
      },
      healthCheck: true,
      debug: false,
    },

Solution:

type MssqlConnectionNode = {
        server: string;
        domain?: string;
        connectionTimeout?: number;
        requestTimeout?: number;
        parseJSON?: boolean;
        options?: {
            encrypt?: boolean;
            useUTC?: boolean;
            tdsVersion?: string;
            appName?: string;
            instanceName?: string;
            abortTransactionOnError?: boolean;
            trustedConnection?: boolean;
            enableArithAbort?: boolean;
            isolationLevel?: 'READ_UNCOMMITTED' | 'READ_COMMITTED' | 'REPEATABLE_READ' | 'SERIALIZABLE' | 'SNAPSHOT';
            maxRetriesOnTransientErrors?: number;
            multiSubnetFailover?: boolean;
            packetSize?: number;
            trustServerCertificate?: boolean;
        };
    };
@stale
Copy link

stale bot commented Apr 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Apr 2, 2023
@stale stale bot closed this as completed Apr 14, 2023
@Drun555
Copy link

Drun555 commented Nov 8, 2024

I'm interested why maintainers ignored this. We definitely can edit database.d.ts by ourselves, but changes will be overwrited over updates. Right know there's no ability to connect MSSQL DB if it uses Instances, and it seems like a easy one-line fix - and I don't have any idea why this option is not provided out-of-box.

@thetutlage, is there any reason for this?

@Imunal
Copy link
Contributor Author

Imunal commented Nov 8, 2024

Completely forgot about this issue as well.

I've created a PR #1063

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Abandoned Dropped and not into consideration
Projects
None yet
Development

No branches or pull requests

2 participants