Skip to content

Move ParseDSN into sub package #453

Open
@byrnedo

Description

@byrnedo

Issue description

Would be good to have ParseDSN/Config struct in another package than mysql since the init function registers the mysql driver, so you can't access it without it registering.

My use case is I wanted to have a simple port check for mysql, obtaining the Addr from ParseDSN. Problem is that since it registers the driver, if I subsequently import my utility package it's not easy to see that it's already registered that driver and the app will panic.

Error log

sql: Register called twice for driver mysql

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions