mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
add: 添加了duckdb数据库支持 主要是枚举类型和默认方言配置
This commit is contained in:
parent
fa63bce67c
commit
57815d3ec4
@ -234,6 +234,11 @@ public enum DbType {
|
|||||||
*/
|
*/
|
||||||
TRINO("trino", "trino 数据库"),
|
TRINO("trino", "trino 数据库"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Duckdb
|
||||||
|
*/
|
||||||
|
DUCKDB("duckdb", "duckdb 数据库"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UNKNOWN DB
|
* UNKNOWN DB
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -161,6 +161,8 @@ public class DbTypeUtil {
|
|||||||
return DbType.LEALONE;
|
return DbType.LEALONE;
|
||||||
} else if (jdbcUrl.contains(":hive2:")) {
|
} else if (jdbcUrl.contains(":hive2:")) {
|
||||||
return DbType.HIVE;
|
return DbType.HIVE;
|
||||||
|
} else if (jdbcUrl.contains(":duckdb:")) {
|
||||||
|
return DbType.DUCKDB;
|
||||||
} else {
|
} else {
|
||||||
return DbType.OTHER;
|
return DbType.OTHER;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,6 +152,8 @@ public class DialectFactory {
|
|||||||
return new CommonsDialectImpl(KeywordWrap.DOUBLE_QUOTATION, LimitOffsetProcessor.SYBASE);
|
return new CommonsDialectImpl(KeywordWrap.DOUBLE_QUOTATION, LimitOffsetProcessor.SYBASE);
|
||||||
case TRINO:
|
case TRINO:
|
||||||
return new CommonsDialectImpl(KeywordWrap.NONE, LimitOffsetProcessor.SQLSERVER);
|
return new CommonsDialectImpl(KeywordWrap.NONE, LimitOffsetProcessor.SQLSERVER);
|
||||||
|
case DUCKDB:
|
||||||
|
return new CommonsDialectImpl(KeywordWrap.DOUBLE_QUOTATION, LimitOffsetProcessor.MYSQL);
|
||||||
default:
|
default:
|
||||||
return new CommonsDialectImpl();
|
return new CommonsDialectImpl();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class KeywordWrap {
|
|||||||
public static final KeywordWrap BACK_QUOTE = new KeywordWrap("`", "`");
|
public static final KeywordWrap BACK_QUOTE = new KeywordWrap("`", "`");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 双引号反义处理, 适用于 postgresql, sqlite, derby, oracle 等
|
* 双引号反义处理, 适用于 postgresql, sqlite, derby, oracle, duckdb 等
|
||||||
*/
|
*/
|
||||||
public static final KeywordWrap DOUBLE_QUOTATION = new KeywordWrap("\"", "\"");
|
public static final KeywordWrap DOUBLE_QUOTATION = new KeywordWrap("\"", "\"");
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public interface LimitOffsetProcessor {
|
|||||||
* Postgresql 的处理器
|
* Postgresql 的处理器
|
||||||
* 适合 {@link DbType#POSTGRE_SQL,DbType#SQLITE,DbType#H2,DbType#HSQL,DbType#KINGBASE_ES,DbType#PHOENIX}
|
* 适合 {@link DbType#POSTGRE_SQL,DbType#SQLITE,DbType#H2,DbType#HSQL,DbType#KINGBASE_ES,DbType#PHOENIX}
|
||||||
* 适合 {@link DbType#SAP_HANA,DbType#IMPALA,DbType#HIGH_GO,DbType#VERTICA,DbType#REDSHIFT}
|
* 适合 {@link DbType#SAP_HANA,DbType#IMPALA,DbType#HIGH_GO,DbType#VERTICA,DbType#REDSHIFT}
|
||||||
* 适合 {@link DbType#OPENGAUSS,DbType#TDENGINE,DbType#UXDB}
|
* 适合 {@link DbType#OPENGAUSS,DbType#TDENGINE,DbType#UXDB,DbType#DUCKDB}
|
||||||
*/
|
*/
|
||||||
LimitOffsetProcessor POSTGRESQL = (dialect, sql, queryWrapper, limitRows, limitOffset) -> {
|
LimitOffsetProcessor POSTGRESQL = (dialect, sql, queryWrapper, limitRows, limitOffset) -> {
|
||||||
if (limitRows != null && limitOffset != null) {
|
if (limitRows != null && limitOffset != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user