Closed p-alik closed 5 months ago
I'm not sure if it's the right way to allow linking against another library that is not libmysqlclient
here, as the mariadb
library will probably evolve into a different direction in the future. From that point of view it is probably a better solution to have a distinct crate for mariadb bindings (and also a distinct Connection
type in diesel).
That written: I do not have any control over this repository, so I can only write my opinion here.
@weiznich, according to official MariaDB versus MySQL: Compatibility
MariaDB's client protocol is binary compatible with MySQL's client protocol.
That's the reason more and more Linux/Unix distributions going to replace mysql
by mariadb
. I hope mysqlclient-sys
crate can support both back ends. At least for time being.
To be a bit overcautious here: Stating that the client protocol is binary compatible with the MySQL client protocol does not necessarily mean that API provided by the library implementing the client protocol is compatible. For example the changes mentioned in https://github.com/diesel-rs/diesel/issues/2373 are not available in the mariadb API yet as far as I'm aware. (That doesn't necessarily make the mariadb client lib incompatible with the mysqlclient lib, just to point out that there are differences.) (That all does not necessarily mean we should not do this change, only that we should think about potential breakage.)
That said: I think something diesel should focus on after releasing 2.0 is replacing libpq
(the postgres client lib) and libmysqlclient
with native rust implementation as this would remove much of the linking issues that are constantly brought up at the issue tracker. (For the postgres side there is already https://github.com/diesel-rs/diesel/pull/2257, I think a similar implementation is also possible for mysql based on the mysql crate.
Implemented in #40
I run in an issue due mariadb recently, which inclusive a workaround is described on stackoverflow.
This patch of build.rs would solve my issue, but maybe approach of PR #2 is worthwhile.
full output of
mysql_config
:For isntance to compile following C code I've to run
gcc -Wall mysql-connect.c -lmariadb
. Otherwise I get same exception I've faced with Rust.