[feat] database 模块新增 PostgreSQL 支持#660
Merged
Bkm016 merged 1 commit intoTabooLib:dev/6.2.3from Feb 10, 2026
Merged
Conversation
- 新增 PostgreSQL 完整类型体系(ColumnTypePostgreSQL、ColumnOptionPostgreSQL、ColumnPostgreSQL、HostPostgreSQL) - 新增 database-postgresql 模块,通过 @RuntimeDependency 懒加载 JDBC 驱动 - 新增 ContainerPostgreSQL ORM 容器,支持 PostgreSQL 原生类型映射 - 新增 ColumnBuilder.PostgreSQL 内部类,支持 PostgreSQL 建表语法 - 实现 ThreadLocal 标识符引用方言(MySQL 反引号 vs PostgreSQL 双引号) - ExecutableSource 适配 PostgreSQL SQL 生成(CREATE TABLE、CREATE INDEX、索引查询) - @ColumnType 注解新增 postgresql 参数,支持 _DEFAULT 哨兵值自动推断 - @TableName 注解支持自定义表名 - CustomType 接口新增 typePostgreSQL/lengthPostgreSQL 属性 - ContainerOperator 的 UUID 序列化适配 PostgreSQL 原生 UUID 类型 - 升级 MySQL 驱动至 Connector/J 8.4.0,解决 MySQL 8+ caching_sha2_password 认证问题
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 database 模块添加完整的 PostgreSQL 支持,同时升级 MySQL 驱动解决 MySQL 8+ 认证问题。
主要改动
新增模块
database-postgresql— PostgreSQL JDBC 驱动懒加载模块(@RuntimeDependency按需下载 postgresql:42.7.9)核心模块
database新增ColumnTypePostgreSQL— PostgreSQL 数据类型枚举(SMALLINT、INTEGER、BIGINT、TEXT、UUID、JSONB 等)ColumnOptionPostgreSQL— PostgreSQL 列选项枚举(NOTNULL、PRIMARY_KEY、UNIQUE、KEY)ColumnPostgreSQL— PostgreSQL 列定义(处理 DOUBLE PRECISION 等含空格类型名、过滤内联 KEY)HostPostgreSQL— PostgreSQL 连接配置(支持 ConfigurationSection 构造)ColumnBuilder.PostgreSQL— PostgreSQL 建表 DSL(id/timeCreate/timeModified)Util.kt— ThreadLocal 标识符引用方言(MySQL 反引号 vs PostgreSQL 双引号)ExecutableSource— PostgreSQL SQL 生成适配(CREATE TABLE、CREATE INDEX、pg_indexes 查询)Database.kt— 新增 MySQL Connector/J 8.4.0 RuntimeDependency,HikariCP 支持 HostPostgreSQLHostSQL.kt/datasource.yml— 默认驱动升级为com.mysql.cj.jdbc.DriverORM 模块
database-ptc-object新增/修改ContainerPostgreSQL— PostgreSQL ORM 容器(类型映射、索引创建、SQL→PostgreSQL 类型推断)@TableName注解 — 支持自定义表名@ColumnType注解 — 新增postgresql参数(_DEFAULT哨兵值自动推断)CustomType接口 — 新增typePostgreSQL/lengthPostgreSQL属性ContainerOperator— UUID 序列化适配 PostgreSQL 原生 UUID 类型ContainerOperatorImpl— 标识符引用方言感知(反引号→双引号替换)MySQL 驱动升级
@RuntimeDependency,解决 MySQL 8+caching_sha2_password认证失败问题向后兼容性
@ColumnType新增参数有默认值,现有注解使用不受影响com.mysql.jdbc.Driver兼容类Closes #659