alexbrainman / odbc

odbc driver written in go
BSD 3-Clause "New" or "Revised" License
359 stars 141 forks source link

Implementing SQLDataSources and SQLDrivers #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To better help and inform the users of our tools it would be nice to be able to 
list the available data sources and see if they use the correct drivers.

This could be done by adding the following two functions to the api:
- SQLDataSources ( 
http://msdn.microsoft.com/en-us/library/ms711004(v=vs.85).aspx )
- SQLDrivers ( http://msdn.microsoft.com/en-us/library/ms712400(v=vs.85).aspx )

I was thinking of adding two package level functions, e.g. odbc.DataSources() 
and odbc.Drivers() (maybe I should use a different name for the latter so it 
won't be confused with sql.Driver?).

Would you be interested in accepting a patch for this feature?

Original issue reported on code.google.com by stemmert...@gmail.com on 6 Aug 2014 at 12:48

GoogleCodeExporter commented 9 years ago
stemmertech,

I am not sure I would like this change. I have no need for such code, but I 
don't know about others.

Why would you write this code? How would you use it?

I can see 2 problems with your proposal:
- I would have to maintain that code in the future;
- user code that rely on this functionality won't be able to compile with any 
other database/sql driver.

So this new code better be useful.

Alex

Original comment by alex.bra...@gmail.com on 7 Aug 2014 at 6:31

GoogleCodeExporter commented 9 years ago
Even for us there's is only a very specific case where this would be used. Some 
of our windows users have difficulty correctly setting up and using an ODBC DSN 
(when using MSSQL servers). We would use this to inform them of problems (DSN 
names that do not exist or aren't visible to the program, not using the SQL 
native driver leading to a significant drop in performance).

This new code would not be useful at all for users only interacting with 
database/sql, and migrating to another odbc driver would be difficult indeed. I 
understand this might not be useful to most of the users of this package, but I 
already wrote the code so I thought I would just ask if there was any interest.

Joël

Original comment by stemmert...@gmail.com on 7 Aug 2014 at 7:27

GoogleCodeExporter commented 9 years ago
Sounds like a useful option for your need. But I don't see how it can be used 
in general. So the answer to your offer is no.

I am glad Go works for you otherwise.

Thank you, for your comments.

Alex

Original comment by alex.bra...@gmail.com on 8 Aug 2014 at 6:57