Comments (11)
For reference, dependabot has been trying to update to the latest version in our repo here flipt-io/flipt#2483
It is failing because a bunch of our integration tests try and boot with a path like this and suddenly our apps are trying to connect to a postgres that does not exist.
from dburl.
@GeorgeMac I apologize. I was concerned something like this might happen. The issue is that I decided to make the disk paths more friendly for the databases that use those (SQLite3, MySQL, PostgreSQL, DuckDB).
from dburl.
Oops, accidentally hit the 'Comment' button before I was finished.
There actually is a way to turn this off already, by changing the dburl.Stat
func, but I will add a way to turn this off. I apologize.
You may want to fine tune your dependabot configs/settings; personally I hate the thing and turn it off in almost every project I work on.
from dburl.
I have a quick fix/change that will allow you to disable this behavior in your code. It's incoming, give me a bit. Again, apologies.
from dburl.
I just pushed v0.20.0
-- you can now disable the opening of paths on disk like the following:
import "github.com/xo/dburl"
func init() {
dburl.ResolveSchemeType = false
}
from dburl.
Nice one @kenshaw ! No worries, thank you for the speedy resolution!
from dburl.
Just to close the loop on this: flipt-io/flipt#2533
I ended up overriding dburl.Stat
as dburl.ResolveSchemeType = false
led to all the cases above producing an unknown extension error. In my case, I am sinking the file not found errors so that it switches back into then just observing the files extension instead.
I think perhaps this might not be in the spirit of the latest changes, but appears to be more compatible with the behaviour we were depending on before.
from dburl.
Can you share with me what file extensions, and what driver you're expecting to open? I apologize for the change in behavior, but I updated dburl
to handle more databases, one of which also handled opaque (ie, file://) URLs (specifically, DuckDB). I'd like to work with you to get the right behavior, I just need to know what the old behavior was.
from dburl.
Totally, the examples above are the only extensions and file type (sqlite3) that we depend upon.
Each of those cases in the issue description up top produces extension unknown errors when I set dburl.ResolveSchemaType = false
. They each are just .db
.
For context, we do also support postgres, mysql and cockroach drivers. However, I don't think we've necessarily ever communicated to folks that they can use file
scheme for anything other thank sqlite.
from dburl.
Question, do you actually use the postgres
driver? If the only thing your app supports is sqlite3, you could just disable every other driver through calls to Unregister
.
from dburl.
We do use postgres yes, and mysql and cockroach. We just have historically communicated the explicit postgres://
scheme for use with this driver. We haven't communicated that file
can be used for anything other than identifying the sqlite file location. As in, we haven't communicated that it could be used to identify a postgres or mysql socket target.
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
- Support for New Relic integrations 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
- 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.