Skip to content

fix: decode percent-encoded path in sqlite database URL - #1406

Open
AlisinaDevelo wants to merge 2 commits into
golang-migrate:masterfrom
AlisinaDevelo:fix-sqlite-encoded-path
Open

AlisinaDevelo wants to merge 2 commits into
golang-migrate:masterfrom
AlisinaDevelo:fix-sqlite-encoded-path

Conversation

@AlisinaDevelo

Copy link
Copy Markdown

Closes #1256.

The sqlite driver built its DSN from purl.String(), which re-encodes the URL path. A database URL like sqlite:///Magic%20Data/db.sqlite was passed to sql.Open with the %20 intact, so it looked for a literal Magic%20Data file and failed to connect.

Now the DSN is built from the decoded path (still keeping any non-custom query params, e.g. sqlite pragmas). Added a test that opens a DB under a directory with a space in the name.

@coveralls

coveralls commented Jun 26, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 54.973%. first build — AlisinaDevelo:fix-sqlite-encoded-path into golang-migrate:master

@AlisinaDevelo

Copy link
Copy Markdown
Author

Checking in on the SQLite URL fix. It decodes percent-encoded path components while preserving query parameters, and Go 1.24 and 1.25 tests, lint, and coverage checks are green. If this still fits the project’s direction, could someone take a look when there’s a chance? I’m happy to rebase or adjust the path handling.

@AlisinaDevelo

Copy link
Copy Markdown
Author

Hey, checking in on the SQLite URL fix—does the path handling need anything else from me before review?

Copilot AI lite review requested due to automatic review settings September 27, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite cannot handle encoded URI's

3 participants