Skip to content

How to get a connection to SQLServer from a connection string #47

Answered by juanluispaz
ModernRonin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Prisma is not your path, use prisma query runner only if you are in a prisma project; if not, use Mssql query runner instead.

Mssql's ConnectionPool object have two constructors: (Notice: Mssql's ConnectionPool is not a ts-sql-query object)

export declare class ConnectionPool extends events.EventEmitter {
    public constructor(config: config, callback?: (err?: any) => void);
    public constructor(connectionString: string, callback?: (err?: any) => void);
    // ...
}

The first one is the one used in the documentation, with a config object:

import { ConnectionPool } from 'mssql'
import { MssqlPoolPromiseQueryRunner } from "./queryRunners/MssqlPoolPromiseQueryRunner";

const poolPromise 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ModernRonin
Comment options

Answer selected by juanluispaz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants