tedious
tedious copied to clipboard
Does tedious support localdb?
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.
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?
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'
});
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.
Ah, awesome to know. Sounds like TDS solves a specific problem which is great. I agree that named pipes are another issue altogether.
Thanks for the information posted here. I too am looking to implement a solution where I would need to connect to localdb.
Did anyone solve this question with another approach?