Skip to content

Conversation

@knuxify
Copy link

@knuxify knuxify commented Dec 27, 2025

Allow for configuring the database connection settings using a config.yml file, following the same format as ynoserver. Much of the config code has been adapted from ynoserver.

(I don't have a ton of Go experience, reviews/pointers as to how this could be done better are appreciated :D)

Allow for configuring the database connection settings using a config.yml file,
following the same format as ynoserver. Much of the config code has been adapted
from ynoserver.
func Init() {
conn, err := sql.Open("mysql", "yno@unix(/run/mysqld/mysqld.sock)/ynodb?parseTime=true")
func InitDatabaseConn(user, password, addr, database string) {
conn, err := sql.Open("mysql", fmt.Sprintf("%s:%s@%s/%s?parseTime=true", user, password, addr, database))
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not handle the original case with passwordless auth, might wanna combine user and password into one config

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.

2 participants