zschumacher / pydapper

a pure python port of the NuGet library dapper
https://pydapper.readthedocs.io/en/latest/
MIT License
63 stars 12 forks source link

Update dsnparse dependency to latest #297

Open Siliconrob opened 1 month ago

Siliconrob commented 1 month ago

dsnparse is set to 0.1.15 (released 2019) in the code for that this causes issues when using an in memory sqlite database DSN

Right now if you specify a dsn like so sqlite+sqlite3://:memory:

The current code parses this out, but sets the host name to None in that case

Code in dsnparse as of 0.1.15

if url.netloc == ":memory:":
    # the special :memory: signifier is used in SQLite to define a fully in
    # memory database, I think it makes sense to support it since dsnparse is all
    # about making it easy to parse *any* dsn
    path = url.netloc
    hostname = None
    port = None

This causes the connect to throw an exception. However when I checked the dsnparse project I see that the latest version has completely rewritten this parsing and should work with the in :memory: better now

Here https://github.com/Jaymon/dsnparse/commit/236eac52a129c05543f18b064d16bdd801fd1099#diff-20477910550021f3876793fa6741485c20ee5e8a4d84c2ca5fd0df49bb3ce94c

If I update the dependency and the tests run + add the one dsn from above with in memory?

zschumacher commented 1 month ago

yes I am happy to review PRs! I have no issue with updating this dependency, all of the dsn parsing has coverage