using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseClient
{
    public class DBClientFactory
    {
        DatabaseFactory factory;

        public DBClientFactory(string dbTypeStr)
        {
            switch (dbTypeStr.ToLower())
            {
                case "mysql":
                    {
                        factory = new MysqlDatabaseFactory();
                        break;
                    }
                case "sqlite":
                    {
                        factory = new SqliteDatabaseFactory();
                        break;
                    }
                case "mssql":
                    {
                        factory = new MssqlDatabaseFactory();
                        break;
                    }
                default:
                    {
                        factory = new MysqlDatabaseFactory();
                        break;
                    }
            }
        }

        public DBClient Create()
        {
            return factory.Create();
        }
    }
}
