import knex from "knex";
import callback from "mariadb/callback.js";
import Client_MySQL from "knex/lib/dialects/mysql/index.js";
import cfg from "./config.mjs";

class Client_MariaDB extends Client_MySQL {
  driverName = "mariadb";
  _driver() {
    return callback;
  }
  validateConnection(conn) {
    return conn.isValid();
  }
};

export default knex({
  client: Client_MariaDB,
  connection: cfg.sql
});
