1 module hunt.sql.util.DBType; 2 3 4 struct DBType { 5 6 enum DBType JTDS = DBType("jtds"); 7 8 enum DBType MOCK = DBType("mock"); 9 10 enum DBType HSQL = DBType("hsql"); 11 12 enum DBType DB2 = DBType("db2"); 13 14 enum DBType DB2_DRIVER = DBType("com.ibm.db2.jcc.DB2Driver"); 15 16 enum DBType POSTGRESQL = DBType("postgresql"); 17 enum DBType POSTGRESQL_DRIVER = DBType("org.postgresql.Driver"); 18 19 enum DBType SYBASE = DBType("sybase"); 20 21 enum DBType SQL_SERVER = DBType("sqlserver"); 22 enum DBType SQL_SERVER_DRIVER = DBType("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 23 enum DBType SQL_SERVER_DRIVER_SQLJDBC4 = DBType("com.microsoft.sqlserver.jdbc.SQLServerDriver"); 24 enum DBType SQL_SERVER_DRIVER_JTDS = DBType("net.sourceforge.jtds.jdbc.Driver"); 25 26 enum DBType ORACLE = DBType("oracle"); 27 enum DBType ORACLE_DRIVER = DBType("oracle.jdbc.OracleDriver"); 28 enum DBType ORACLE_DRIVER2 = DBType("oracle.jdbc.driver.OracleDriver"); 29 30 31 32 enum DBType MYSQL = DBType("mysql"); 33 enum DBType MYSQL_DRIVER = DBType("com.mysql.jdbc.Driver"); 34 enum DBType MYSQL_DRIVER_6 = DBType("com.mysql.cj.jdbc.Driver"); 35 enum DBType MYSQL_DRIVER_REPLICATE = DBType("com.mysql.jdbc."); 36 37 enum DBType MARIADB = DBType("mariadb"); 38 enum DBType MARIADB_DRIVER = DBType("org.mariadb.jdbc.Driver"); 39 40 enum DBType DERBY = DBType("derby"); 41 42 enum DBType HBASE = DBType("hbase"); 43 44 enum DBType HIVE = DBType("hive"); 45 enum DBType HIVE_DRIVER = DBType("org.apache.hive.jdbc.HiveDriver"); 46 47 enum DBType H2 = DBType("h2"); 48 enum DBType H2_DRIVER = DBType("org.h2.Driver"); 49 50 enum DBType DM = DBType("dm"); 51 enum DBType DM_DRIVER = DBType("dm.jdbc.driver.DmDriver"); 52 53 enum DBType KINGBASE = DBType("kingbase"); 54 enum DBType KINGBASE_DRIVER = DBType("com.kingbase.Driver"); 55 56 enum DBType GBASE = DBType("gbase"); 57 enum DBType GBASE_DRIVER = DBType("com.gbase.jdbc.Driver"); 58 59 enum DBType XUGU = DBType("xugu"); 60 enum DBType XUGU_DRIVER = DBType("com.xugu.cloudjdbc.Driver"); 61 62 enum DBType OCEANBASE = DBType("oceanbase"); 63 enum DBType OCEANBASE_DRIVER = DBType("com.mysql.jdbc.Driver"); 64 enum DBType INFORMIX = DBType("informix"); 65 66 67 enum DBType ODPS = DBType("odps"); 68 69 70 enum DBType PHOENIX = DBType("phoenix"); 71 enum DBType PHOENIX_DRIVER = DBType("org.apache.phoenix.jdbc.PhoenixDriver"); 72 enum DBType ENTERPRISEDB = DBType("edb"); 73 enum DBType ENTERPRISEDB_DRIVER = DBType("com.edb.Driver"); 74 75 enum DBType KYLIN = DBType("kylin"); 76 enum DBType KYLIN_DRIVER = DBType("org.apache.kylin.jdbc.Driver"); 77 78 79 enum DBType SQLITE = DBType("sqlite"); 80 enum DBType SQLITE_DRIVER = DBType("org.sqlite.JDBC"); 81 82 enum DBType ALIYUN_ADS = DBType("aliyun_ads"); 83 enum DBType ALIYUN_DRDS = DBType("aliyun_drds"); 84 85 enum DBType PRESTO = DBType("presto"); 86 87 enum DBType ELASTIC_SEARCH = DBType("elastic_search"); 88 89 90 enum DBType CLICKHOUSE = DBType("clickhouse"); 91 enum DBType CLICKHOUSE_DRIVER = DBType("ru.yandex.clickhouse.ClickHouseDriver"); 92 93 private string _name; 94 95 this(string name) 96 { 97 this._name = name; 98 } 99 100 string name() 101 { 102 return _name; 103 } 104 105 bool opEquals(const DBType h) nothrow { 106 return _name == h._name ; 107 } 108 109 bool opEquals(string name) nothrow { 110 return _name == name ; 111 } 112 113 bool opEquals(ref const DBType h) nothrow { 114 return _name == h._name ; 115 } 116 }