How to connect to or open database without knowing the type of the relational database? #931
Unanswered
kattungakrish
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to implement a workflow using bun ORM in GO Lang, where given a data source name (dsn), I connect to and open the respective database without any knowledge of whether its SQLite, MySQL, PostgresSQL or MSSQL.
Currently, documented workflow in "Bun : for SQL Client in Go Lang", seems to require knowledge of the type of the database the client is trying connect to.
What I'm trying to achieve is a function:
func OpenBunDB( dataSourceName string) (*bun.DB , error)
Here dataSourceName can be a string containing a path to the SQLite db file or a dsn string for MySQL, PostgreSQL etc.
Beta Was this translation helpful? Give feedback.
All reactions