Esempio n. 1
0
        /// <summary>
        /// Get QueryExecutor
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public static IQueryExecutor GetExecutor(ConnectionSetting setting)
        {
            switch (setting.Type)
            {
            case DatabaseType.POSTGRESQL:
                return(new CooQ.Database.PostgreSql.PsqlExecutor(setting));

            case DatabaseType.MSSQL:
                return(new CooQ.Database.Mssql.MssqlExecutor(setting));

            default:
                return(null);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Init config for system
 /// </summary>
 /// <param name="setting"></param>
 public static void Init(ConnectionSetting setting)
 {
     DatabaseProvider.Config(setting);
     QueryExecutor.Init(setting);
 }
Esempio n. 3
0
 public static IQueryExecutor Init(ConnectionSetting setting)
 {
     EXECUTOR = GetExecutor(setting);
     EXECUTOR.Init(setting);
     return(EXECUTOR);
 }
Esempio n. 4
0
 public static void Config(ConnectionSetting setting)
 {
     INSTANCE.Setting = setting;
 }