'use strict';

const postgres = require('./postgres');
const mysql = require('./mysql');
const oracle = require('./oracle');
const sqlite = require('./sqlite');

const DIALECTS = { postgres, mysql, oracle, sqlite };

function getDialect(name) {
  const dialect = DIALECTS[name];
  if (!dialect) {
    throw new Error(`Unknown dialect: '${name}'. Supported: postgres, mysql, oracle, sqlite`);
  }
  return dialect;
}

module.exports = { getDialect, DIALECTS };
