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

Does tedious support localdb? #348

Open
beautifulcoder opened this issue Dec 7, 2015 · 6 comments
Open

Does tedious support localdb? #348

beautifulcoder opened this issue Dec 7, 2015 · 6 comments

Comments

@beautifulcoder
Copy link

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.

@arthurschreiber
Copy link
Collaborator

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?

@beautifulcoder
Copy link
Author

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'
});

@arthurschreiber
Copy link
Collaborator

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.

@beautifulcoder
Copy link
Author

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

@duwoodaes
Copy link

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

@rcarubbi
Copy link

rcarubbi commented Mar 10, 2018

Did anyone solve this question with another approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants