Adding _client_version connection attribute
In our upgrade projects we have seen very useful to watch client library names and their versions to make sure that clients are compatible with new db (MariaDB) version.
Most MySQL/MariaDB client send client attributes _client_name, but also _client_version. This go-sql_driver/mysql sends currently only _client_name, but no version attribute.
It would be pretty nice feature add this _client_version connection attribute. It should contain a) release number if not available b) commit-id. If none of those available then probably should be ignored (or HEAD).
To implement this there should probably be RELEASE file, which would be filled with every release (or just commit-id / HEAD if not release).
and code could use //go:generate ... to fill related connAttrClientVersionValue
I guess there should done around this...
https://github.com/go-sql-driver/mysql/blob/789a82a35d04f8ab5a7b28707615ef8bf9d4f09b/const.go#L24-L25
Question is also, how generation of RELEASE-file would be implemented when releases are done?
Source: go-sql-driver/mysql