Closed burningalchemist closed 1 year ago
Hi, thanks for reporting this.
The problem is indeed odd as the entry function should be Parse which defers to ParseSimple
when no ://
is in the passed string.
I'll see what I can find.
Actually the error is pretty simple, go-ase OpenConnector is calling ParseSimple
directly instead of Parse
.
I'm not entirely sure why ParseSimple
why that was done but that is an easy fix.
Perfect! Thanks a lot for the rapid fix! 🚀
Description
Hi team, I cannot connect to the database using URI DSN via
database/sql
module, only Simple DSN is possible and passing parameters from the environment variables (ref).Expected behaviour
The expected behaviour is that we can pass the supported URI DSN without any string manipulation directly to
sql.Open()
and connect to the database. Code-wise, it'd be great to have a similar control flow as in here in theOpenConnector()
function.Current behaviour
Provided URI DSN string can't be parsed when passed to
sql.Open()
function, unless we explicitly calldsn.Parse
function that has the control flow to detect://
and picksParseURI
function instead. This results in error:The error comes from
parseSimple
function, which is not desired in my current use case.Steps to Reproduce
Example from the README.md doesn't work:
Additional context
I'm the maintainer of https://github.com/burningalchemist/sql_exporter project, and one of my users is experiencing issues connecting to the SAP ASE database. Since the project is database agnostic, we try to avoid adding custom handling for specific databases in order to keep the code small and simple.