Comments (2)
@rcmachado -- as a general purpose extension to dburl
probably not, since New Relic itself isn't a database. Please note, that there's already an API in dburl
that can allow you to register aliases for these additional schemes. The way it would be used would be in an init
func:
func init() {
dburl.RegisterAlias("postgres", "nrpostgres")
}
Any package then looking to import or use your code would then be able to use dburl.Parse
and dburl.Open
with URLs of the form nrpostgres://
. dburl
in turn would generate DSNs for use with Go's standard SQL packages for any URL beginning with the nrpostgres://
scheme. If you'd like to register a custom URL scheme with dburl
, that generates its DSNs differently, please see the dburl.Scheme
type, and the dburl.Register
func.
from dburl.
@kenshaw That's great - missed the RegisterAlias
function, sorry. I'll close this for now (as it's just a wrapper around a real driver, the alias will work).
Thanks!
from dburl.
Related Issues (19)
- panic: runtime error: slice bounds out of range HOT 2
- Issue with MySQL URLs in go >= 1.12.8 HOT 1
- Feature Request: redis dsn HOT 2
- Error parsing mysql DSN HOT 1
- Add support for arbitrary protocols HOT 2
- Support socket files in mysql mode HOT 4
- Modify the query parameters? HOT 6
- Special characters in password HOT 2
- Fails to parse passwords with '#' for mssql. HOT 9
- no documentation on v0.16.0 Gen return parameters
- duckdb support HOT 1
- Support for MSSQL named pipe (np:) and shared memory (lpc:) DSNs HOT 1
- Parse returns postgres scheme for file protocol when directory in path exists HOT 11
- couchbase error: n1ql: Connection failed Post HOT 9
- Plans for a CLI?
- Can't register scheme starting with "my" HOT 3
- TestParse failure if /var/run/postgresql is missing HOT 10
- Parse for {postgres,mysql}+unix schemes depend on filesystem state HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dburl.