mariadb version parsing

This commit is contained in:
Jan Prochazka 2021-05-15 09:01:06 +02:00
parent c5605d63ca
commit 21ceaecec6

View File

@ -171,6 +171,16 @@ const drivers = driverBases.map(driverBase => ({
async getVersion(connection) {
const { rows } = await this.query(connection, "show variables like 'version'");
const version = rows[0].Value;
if (version) {
const m = version.match(/(.*)-MariaDB-/);
if (m) {
return {
version,
versionText: `MariaDB ${m[1]}`,
};
}
}
return {
version,
versionText: `MySQL ${version}`,