It could first parse the interface modulepath and then use that to call modulepath.parse_dsn() which is a class method that will parse the dsn, this would allow the SQLite specific code to be moved out of DsnConnection.__init__ (the :memory: stuff) and the interface connection method that normalizes the path, host, and database variables, that could all be consolidated to the parse_dsn method.
It could first parse the interface modulepath and then use that to call
modulepath.parse_dsn()
which is a class method that will parse the dsn, this would allow the SQLite specific code to be moved out ofDsnConnection.__init__
(the:memory:
stuff) and the interfaceconnection
method that normalizes the path, host, and database variables, that could all be consolidated to theparse_dsn
method.