-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not require SQL URIs to be prefixed with SQLAlchemy driver #810
Conversation
799bd0a
to
2aed6f4
Compare
if not SCHEME_PATTERN.match(str(uri)): | ||
# Interpret URI as filepath. | ||
uri = f"sqlite+aiosqlite:///{Path(uri)}" | ||
scheme, rest = uri.split(":", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you not use urllib
to parse because in theory this could be URI that's not a URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember reaching for urllib
first. I believe the issue was that certain SQLite URIs do not round-trip quite right.
In many places, we require SQL database URIs to include the "driver" like:
This is a SQLAlchemy idiom that is not standard for SQL database URIs generally. In this PR, Tiled now accepts standard URIs like:
It still accepts URIs with a driver specified.
These commits are cherry-picked from #779 into a separate PR.
Checklist
Add the ticket number which this PR closes to the comment section