tedious icon indicating copy to clipboard operation
tedious copied to clipboard

Does tedious support localdb?

Open beautifulcoder opened this issue 9 years ago • 6 comments

Hello! I was in the middle of writing a migration script in node when I got this error:

error connecting: Error: getaddrinfo ENOTFOUND (localdb)\MSSQLLocalDB (localdb)\MSSQLLocalDB:1433

So, my question is, does this work with a localdb instance? My gut feeling tells me no but wanted to ask anyway.

beautifulcoder avatar Dec 07 '15 01:12 beautifulcoder

I guess you're talking about SQL Server Express LocalDB? If yes, this should be supported, as it's basically a slimmed down version of SQL Server. But no guarantees, as I never used that version before.

Did connecting to your LocalDB instance work before?

arthurschreiber avatar Dec 07 '15 07:12 arthurschreiber

I use it for testing, here is the info on it:

C:\Dev\migratedb>sqllocaldb s
LocalDB instance "MSSQLLocalDB" started.

C:\Dev\migratedb>sqllocaldb i MSSQLLocalDB
Name:               MSSQLLocalDB
Version:            12.0.2000.8
Shared name:
Owner:              XXX
Auto-create:        Yes
State:              Running
Last start time:    12/7/2015 17:20:36
Instance pipe name: np:\\.\pipe\LOCALDB#5E134EF5\tsql\query

I am using this to connect to it:

var conn = new tds.Connection({
  host: '(localdb)\\MSSQLLocalDB'
});

beautifulcoder avatar Dec 07 '15 23:12 beautifulcoder

Ah, ok, I now understand your issue.

tedious currently does not know how to connect to a SQLServer instance through a named pipe. Nodejs supports named pipes on windows (only local named pipes), but correct handling for this was never implemented.

Another issue is that from my understanding, native TDS drivers from microsoft will start your localdb instance if it's not already running. tedious will never support this.

So overall, I stand corrected. As-is, tedious won't be able to connect to your LocalDB instance.

arthurschreiber avatar Dec 08 '15 12:12 arthurschreiber

Ah, awesome to know. Sounds like TDS solves a specific problem which is great. I agree that named pipes are another issue altogether.

beautifulcoder avatar Dec 08 '15 16:12 beautifulcoder

Thanks for the information posted here. I too am looking to implement a solution where I would need to connect to localdb.

duwoodaes avatar May 17 '16 19:05 duwoodaes

Did anyone solve this question with another approach?

rcarubbi avatar Mar 10 '18 01:03 rcarubbi