• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

数据方言:【PostgreSQL】后端部署使用PostgreSQL数据库


一、驱动配置

(一)Maven配置(14.3版本可用)

<postgresql.version>42.6.0</postgresql.version>
<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>${postgresql.version}</version>
</dependency>

(二)离线驱动下载

postgresql-42.2.18.jarpostgresql-42.6.0.jarpostgresql-42.7.3.jar

二、JDBC连接配置

pamirs:
  datasource:
    base:
      type: com.alibaba.druid.pool.DruidDataSource
      driverClassName: org.postgresql.Driver
      url: jdbc:postgresql://127.0.0.1:5432/pamirs?currentSchema=base
      username: xxxxxx
      password: xxxxxx
      initialSize: 5
      maxActive: 200
      minIdle: 5
      maxWait: 60000
      timeBetweenEvictionRunsMillis: 60000
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
      poolPreparedStatements: true
      asyncInit: true

注:更多 YAML 配置请前往 Module API 查阅。

(一)连接url配置

暂无官方资料

(二)url格式

jdbc:postgresql://${host}:${port}/${database}?currentSchema=${schema}

警告:

在jdbc连接配置时,${database} 和 ${schema} 必须完整配置,不可缺省。

其他连接参数如需配置,可自行查阅相关资料进行调优。

三、方言配置

(一)pamirs方言配置

pamirs:
  dialect:
    ds:
      base:
        type: PostgreSQL
        version: 14
        major-version: 14.3
      pamirs:
        type: PostgreSQL
        version: 14
        major-version: 14.3

注:更多 YAML 配置请前往 Module API 查阅。

数据库版本typeversionmajorVersion
14.xPostgreSQL1414.3

注意:

由于方言开发环境为14.3版本,其他类似版本(14.x)原则上不会出现太大差异,如出现其他版本无法正常支持的,可在文档下方留言。

(二)schedule方言配置

pamirs:
  event:
    enabled: true
    schedule:
      enabled: true
      dialect:
        type: PostgreSQL
        version: 14
        major-version: 14.3
typeversionmajorVersion
PostgreSQL1414.3

注意:

由于schedule的方言在多个版本中并无明显差异,目前仅提供一种方言配置。

四、其他配置

(一)逻辑删除的值配置

pamirs:
  mapper:
    global:
      table-info:
        logic-delete-value: (EXTRACT(epoch FROM CURRENT_TIMESTAMP) * 1000000 + EXTRACT(MICROSECONDS FROM CURRENT_TIMESTAMP))::bigint

(二)PostgreSQL 数据库用户初始化及授权

-- init root user (user name can be modified by oneself)

CREATE USER root WITH PASSWORD 'password';

-- if using automatic database and schema creation, this is very important.
ALTER USER root CREATEDB;

SELECT * FROM pg_roles;

-- if using postgres database, this authorization is required.
GRANT CREATE ON DATABASE postgres TO root;
编辑此页
最近更新:2026/1/15 04:02
上一页
数据方言:【OpenGauss】后端部署使用OpenGauss高斯数据库
下一页
文件存储:MINIO无公网访问地址下OSS的配置
默认页脚
Copyright © 2026 Mr.Hope