On Thu, Feb 8, 2018, at 07:28, Mandolyte wrote:
> I'd like to use the same program against multiple databases and set the
> driver by configuration. But since the driver is in the source code, I
> don't see a way to do that.
>
> In other words, I don't want to include this in my code:
>
> > imp
Though database/sql supports several drivers, the databases and their SQL
dialects are quite different!
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nu
Yeah, makes sense... I was just trying to do something I could do in
Java... but it's interpreted and isn't creating an executable.
No biggie... just wanted to be sure I wasn't overlooking any tricks.
Thanks for the quick answer!
On Thursday, February 8, 2018 at 8:39:02 AM UTC-5, Jan Mercl wro
You'd just have to compile in all the drivers you want to support. Then use
environment variables to get settings per database.
That's why sql.Open() takes a string as its first argument; so you can tell
it which one (potentially of many) to use.
--
You received this message because you are subs
On Thu, Feb 8, 2018 at 2:29 PM Mandolyte wrote:
> I want to load it at run time. Is this possible?
Why? The driver code is already linked into your program, otherwise you
would not be able to load it later.
--
-j
--
You received this message because you are subscribed to the Google Groups
I'd like to use the same program against multiple databases and set the
driver by configuration. But since the driver is in the source code, I
don't see a way to do that.
In other words, I don't want to include this in my code:
> import (
> _ "github.com/lib/pq"
> )
I want to load it at r