Skip to content
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

Mysql connection string is not parsed properly #729

Closed
rutkai opened this issue Sep 11, 2023 · 0 comments · Fixed by #730
Closed

Mysql connection string is not parsed properly #729

rutkai opened this issue Sep 11, 2023 · 0 comments · Fixed by #730
Assignees
Labels
type:bug Something isn't working
Milestone

Comments

@rutkai
Copy link
Contributor

rutkai commented Sep 11, 2023

Data

  • Shiori version: v1.5.5
  • Database Engine: mysql
  • Operating system: linux
  • CLI/Web interface/Web Extension: NA

Describe the bug / actual behavior

You cannot provide a mysql connection string that is accepted by both the driver and the application.

The problem is that it parses the connection string looking for a schema, but it won't be stripped from the string that is passed to the driver:
https://github.com/go-shiori/shiori/blob/master/internal/database/database.go#L57

But the driver itself doesn't accept a scheme:
https://github.com/go-sql-driver/mysql#dsn-data-source-name

Furthermore, the new connection string is preferred, but the documentation is still using the old way.

Expected behavior

It connects to mysql instance.

To Reproduce

Steps to reproduce the behavior:

  • Use a connection string without a scheme: shiori:passwd@(mysql)/shiori?charset=utf8mb4
  • Use a connection string with a scheme: mysql://shiori:passwd@(mysql)/shiori?charset=utf8mb4

Notes

I'll create a PR for it later on. :D

@rutkai rutkai added the type:bug Something isn't working label Sep 11, 2023
@rutkai rutkai changed the title One line description of the bug Mysql connection string is invalid Sep 11, 2023
@rutkai rutkai changed the title Mysql connection string is invalid Mysql connection string is not parsed properly Sep 11, 2023
rutkai added a commit to rutkai/shiori that referenced this issue Sep 11, 2023
Mysql connection string update, docs update
@fmartingr fmartingr added this to the 1.6.0 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants