golistic / pxmysql

Go MySQL driver using X Protocol
MIT License
14 stars 0 forks source link

enh(xmysql)!: rework Session and remove Connection type #58

Closed geertjanvdk closed 1 year ago

geertjanvdk commented 1 year ago

We make Session the type responsible to setup and manage a connection with the MySQL server (X Plugin). This removes the need of first creating a connection object. It is also more inline with other implementations of the of MySQL X DevAPI.

All code and tests have been adapted, include the Go sql driver. Tests in xmysql sub-package have also been adapted to use package xmysql_test and some functionality is now exported.

BREAKING CHANGE: Since we merge the Connection type into the Session, we do not need any longer to first instantiate the former. Users must now use the xmysql.CreateSession to open a connection with the MySQL server, or xmysql.NewSession when opening automatically is not wanted.

Resolves #57.