Giter Club home page Giter Club logo

Comments (11)

GeorgeMac avatar GeorgeMac commented on June 15, 2024

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.

kenshaw avatar kenshaw commented on June 15, 2024

@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.

kenshaw avatar kenshaw commented on June 15, 2024

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.

kenshaw avatar kenshaw commented on June 15, 2024

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.

kenshaw avatar kenshaw commented on June 15, 2024

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.

GeorgeMac avatar GeorgeMac commented on June 15, 2024

Nice one @kenshaw ! No worries, thank you for the speedy resolution!

from dburl.

GeorgeMac avatar GeorgeMac commented on June 15, 2024

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.

kenshaw avatar kenshaw commented on June 15, 2024

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.

GeorgeMac avatar GeorgeMac commented on June 15, 2024

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.

kenshaw avatar kenshaw commented on June 15, 2024

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.

GeorgeMac avatar GeorgeMac commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.