Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Connection Strings Reference (connectionstrings.com)
86 points by evo_9 on Aug 30, 2021 | hide | past | favorite | 23 comments


I wish there was a library for "every" that took a standardized connection string and mapped it to "every" DB/storage/queue/etc client. This is one of those things that should be a solved problem that we as an industry should just move past having to deal with.

This would obviously be too much effort to actually do but it would save a lot of headache. "We can't X because we cant pass it's config to the software"


> I wish there was a library for "every" that took a standardized connection string and mapped it to "every" DB/storage/queue/etc client.

This has been around for like 30 years, it's called ODBC. As long as you're using an ODBC driver the strings are the same (modulo the driver specification).


Intuitively you would think so, but unfortunately not. The ODBC specification last time I looked into it doesn't dictate the key-values that is given to the database driver so it's up to each driver to pick it's own. E.g. HOSTNAME vs SERVER, or PASSWORD vs PWD are the two main differences I recall.

I'm not super well-versed in it, so I'm sure someone else here can provide more detail as to why it's different or if there is history behind it being like this. But from a dev's perspective, ODBC connection strings are an absolute mess. Not to mention no one really knows what's what, hence this website. Fun fact, I tried to find the spec as part of responding here and I couldn't find it. Best I could find was this: https://docs.microsoft.com/en-us/sql/odbc/reference/develop-...

But you go around finding actual details and next thing you know it's under the heading of "SQL Server XXXX" so you have no idea if it's the "spec" or just the MS SQL Server driver reference.


That’s a shame. I never dug deep into this, but I’m pretty sure the Postgres and SQL Server strings are similar.


In my experience, while it sounds nice to be able to swap out databases with just a config change, it really takes code changes even with an ORM. I recently wrote an app that can use either SQLlite or MS SQL with EF Core. Many things are the same, but there are some queries that I have to handle differently between providers. If I were to add mongo or similar I’d definitely have more changes.

I do choose the provider based on the connection string though :)


This is not a swap out DBs thing. This is a "have the ability to tweak all of the config options from a connection string with no code changes"

You'd still get the correct client for your DB. You'd just not need to plan ahead to accept parameters.


Or “we had to restart 7 times because I thought I knew the syntax, but it didn’t seem taken into account, so I changed it 6 more times and actually the second time was correct but needed a second parameter.”


Hum... Oracle has its service names and SID, MS SQL server has instances, PostgreSQL is actually what you'd expect from a network server, SQLite is obviously completely different from anything else. I don't remember the MySQL connection parameters, but I remember the username is a crazy multi-part string.

And that's just the basic connection parameters, you will want to set some advanced ones once in a while. I don't see what you gain by creating an universal interface, since they are all completely different from each other.


Using a schema that allows you to specify a different parser for the remainder of the string would fix this. Like: sqlite:// and redis://. You could the have standards for common things like usernames, passwords, hosts, ports, and storage path.


Is this the same site as from the classic ASP days? Wow flashback to 2005.


It is! Flashbacks. And it still does a better job than most database vendor sites, gets straight to the point.


I thought this was going to be about the Hayes Command Set.

AT&F0

ATDT5551212


This site has saved my bacon more than once.


What about connection URIs?


IMHO the connection strings are exactly a thing that should have been standardized, in form of a URL preferably. I have invented my own URL forms and implemented code parsing them and providing connections quite a number of times in many languages.


Surprised to see Excel in there and I'm unfamiliar with the .NET libraries mentioned. Are they for querying Excel as SQL?


Prefer the integrated security ones unless you’re also going to read a secure storage reference to protect the secrets.


Unpleasantly ad-laden. Good value in the site, but it literally blocked content trying to sell me stuff I wouldn't buy from a company I don't trust.


I disabled ad block to see what you were on about. There is one little slide up banner at the bottom that you can close. If you don't have an adblock (mine disabled that), how is this ad-laden to you?


I guess Brave browser does the job. I see no ads


None here on Chrome+adblocker. I turned off the ad blocking just to see how bad it was - 1 on the home page, 2 on connection string pages. Pretty tame all things considered.


This looks like just a spammy SEO grab.


I don't think so. It has a lot of useful information, and back in the day I used this site (or one similarly named) a ton.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: