Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

storage: common API that selects appropriate provider given a DSN #44

Open
llorllale opened this issue Jul 28, 2020 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@llorllale
Copy link
Contributor

It would be nice to have an API that looks like this:

// mysql provider automatically selected 
provider, err := storage.Open("mysql://root:my-secret-pw@tcp(127.0.0.1:3306)/")
if err != nil {
    // handle error
}

This would reduce refactors users would have to do when selecting different storage providers.

Current obstacles:

  • import cycle b/w storage package and implementation-specific packages
  • need to pass in implementation-specific options. Perhaps encode these options as url parameters?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant