Skip to content

Database Support

"Wherever the data lives, the admin lives too" — one set of @Erupt annotations manages relational databases, NoSQL, REST APIs, files, object storage and even SaaS tables.

Database support

Data access comes in three layers; pick what you need:

LayerWhen to use itHow
Relational (JPA)Most business systemsAdd erupt-data-jpa and configure the connection as below — the bulk of this page
Data connectorsMongoDB, ES, Redis, REST APIs, files, K8s, S3…Add the matching erupt-data-* module
Custom data sourceA private protocol or internal service none of the above coversImplement IEruptDataService or extend EruptBeanDataService

Note: Import the corresponding JDBC driver dependency before using a relational database.

The snippets below are minimal templates — adjust the values to your environment. The configuration for each database in application.yml is as follows.

About dialects

Erupt 2.x runs on Spring Boot 3.5.16, which brings Hibernate 6.6. Hibernate 6 auto-detects the database dialect from JDBC metadata at startup, so you normally do not need to set spring.jpa.database-platform at all — none of Erupt's own configurations (erupt-sample, erupt-test, erupt-docker) declare it.

Only set it explicitly when auto-detection picks the wrong dialect or you want to pin a specific implementation, and only use class names that actually exist in Hibernate 6 (see the dialect reference below). Hibernate 3/4/5-era classes such as MySQL5InnoDBDialect, Oracle10gDialect, SQLServer2008Dialect and PostgreSQL9Dialect were removed in Hibernate 6 — configuring them throws ClassNotFoundException on startup.

MySQL

yaml
spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/erupt
    username: root
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    database: mysql

Oracle

yaml
spring:
  datasource:
    url: jdbc:oracle:thin:@//127.0.0.1:1521/erupt
    username: sys
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    database: oracle

SQL Server

yaml
spring:
  datasource:
    url: jdbc:sqlserver://127.0.0.1:1443;database=erupt
    username: sa
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    database: sql_server

PostgreSQL

yaml
spring:
  datasource:
    url: jdbc:postgresql://127.0.0.1:5432/erupt
    username: postgres
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    database: postgresql

H2

yaml
spring:
  datasource:
    url: jdbc:h2:file:./erupt;AUTO_SERVER=TRUE
    platform: h2
    username: sa
    password:
    driverClassName: org.h2.Driver
  jpa:
    show-sql: true
    generate-ddl: true
    database: h2

DB2

yaml
spring:
  datasource:
    url: jdbc:db2://127.0.0.1:50000/erupt
    username: admin
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    database: db2

Dameng (DM)

yaml
spring:
  datasource:
    url: jdbc:dm://127.0.0.1:6236/erupt
    username: SYSDBA
    password: SYSDBA
  jpa:
    show-sql: true
    generate-ddl: true
    database-platform: org.hibernate.dialect.DmDialect
xml
<dependency>
  <groupId>com.dameng</groupId>
  <artifactId>DmJdbcDriver18</artifactId>
  <version>8.1.3.140</version>
</dependency>
<!-- The DM dialect is published by Dameng; the artifactId suffix must match the Hibernate version Erupt uses (6.6).
     If Erupt bumps its Hibernate version, look up the matching artifact at https://central.sonatype.com/search?q=DmDialect-for-hibernate&smo=true -->
<dependency>
  <groupId>com.dameng</groupId>
  <artifactId>DmDialect-for-hibernate6.2</artifactId>
  <version>8.1.2.192</version>
</dependency>

Data Connectors

Everything beyond relational databases is reached through the erupt-data connector layer: one data source interface, and the same annotated model gets CRUD, paging and search — with tables, forms, permissions and export behaving exactly as they do for a JPA model.

ModuleartifactIdWhat it connects
erupt-jpaerupt-data-jpaRelational databases — the default for most projects
erupt-mongodberupt-data-mongodbMongoDB documents
erupt-jdbcerupt-data-jdbcPlain JDBC single-table access with no JPA mapping — ClickHouse, Doris, TDengine, Dameng…
erupt-httperupt-data-httpA REST API as a data source: any HTTP service becomes a managed table
erupt-eserupt-data-esElasticsearch indices and full-text search
erupt-rediserupt-data-redisRedis key-value data
erupt-memoryerupt-data-memoryIn-memory data, no database required
erupt-fileerupt-data-fileFiles as tables — CSV, JSONL, TSV, INI…
erupt-k8serupt-data-k8sKubernetes cluster resources
erupt-ldaperupt-data-ldapLDAP / Active Directory entries
erupt-feishuerupt-data-feishuFeishu Bitable
erupt-notionerupt-data-notionNotion databases
erupt-s3erupt-data-s3S3-compatible object storage

Several connectors can coexist in one project; each @Erupt model belongs to its own data source without affecting the others.

Know the limits

Non-JPA sources inherit their protocol's limits: file and REST sources have no transactions, Redis and memory sources cannot do complex joins. Each module's page lists the query and write capabilities it actually supports.

Custom Data Source

When none of the modules fit, implement your own to reach a private protocol or an internal service:

  • IEruptDataService — the full interface: querying, paging, drill-down and writes are all yours to implement, and nothing is off limits
  • EruptBeanDataService — implement a single data() method returning the rows; condition evaluation, sorting, paging and drill-down come from the base class. For any source that can only hand you whole rows (files, REST, SaaS tables, directory services, object storage), this is the one to use.

Register the implementation with DataProcessorManager.register(...) and point a model at it with @EruptDataProcessor. Full walkthrough: Custom Data Source (EruptDataService).

Other Databases

Relational data management in Erupt is powered by Hibernate, which supports many more databases. The ones listed above are tested in production; others should work in principle.

Dialect Reference

WARNING

Once more: in almost every case you should not configure a dialect at all — Hibernate 6 detects it automatically. The table below is only for the rare cases where an explicit dialect is required.

Dialects Bundled with Hibernate 6.6

These ship in hibernate-core (package org.hibernate.dialect) and are available out of the box with Erupt:

RDBMSDialect classMinimum DB version
MySQLorg.hibernate.dialect.MySQLDialect8.0
MariaDBorg.hibernate.dialect.MariaDBDialect10.4
TiDBorg.hibernate.dialect.TiDBDialect5.4
PostgreSQLorg.hibernate.dialect.PostgreSQLDialect12.0
EDB Postgres Plusorg.hibernate.dialect.PostgresPlusDialect12.0
CockroachDBorg.hibernate.dialect.CockroachDialect22.2
Oracleorg.hibernate.dialect.OracleDialect19.0
Microsoft SQL Serverorg.hibernate.dialect.SQLServerDialect11.0
Azure SQLorg.hibernate.dialect.AzureSQLServerDialect11.0
DB2org.hibernate.dialect.DB2Dialect10.5
DB2 for IBM iorg.hibernate.dialect.DB2iDialect7.1
DB2 for z/OSorg.hibernate.dialect.DB2zDialect12.1
H2org.hibernate.dialect.H2Dialect2.1.214
HSQLDBorg.hibernate.dialect.HSQLDialect2.6.1
Apache Derbyorg.hibernate.dialect.DerbyDialect10.15.2
SAP HANAorg.hibernate.dialect.HANADialect
Sybaseorg.hibernate.dialect.SybaseDialect16.0
Sybase ASEorg.hibernate.dialect.SybaseASEDialect16.0
Google Spannerorg.hibernate.dialect.SpannerDialect

Community Dialects

Hibernate 6 moved the dialects that are no longer maintained by the Hibernate team out of hibernate-core into a separate org.hibernate.orm:hibernate-community-dialects artifact (package org.hibernate.community.dialect). Databases such as SQLite, Firebird, Informix, Ingres, CUBRID, Altibase, MimerSQL, Teradata, TimesTen, SingleStore and Sybase Anywhere need this extra dependency:

xml
<dependency>
  <groupId>org.hibernate.orm</groupId>
  <artifactId>hibernate-community-dialects</artifactId>
</dependency>

The version is managed by Spring Boot's dependency management — do not pin it manually.

DANGER

The following Hibernate 3/4/5-era class names no longer exist in Hibernate 6 and will throw ClassNotFoundException at startup: MySQL5InnoDBDialect, MySQLInnoDBDialect, MySQLMyISAMDialect, Oracle9Dialect, Oracle10gDialect, SQLServer2008Dialect, PostgreSQL9Dialect, DB2390Dialect, SAPDBDialect, MckoiDialect, InterbaseDialect, PointbaseDialect, FrontbaseDialect, ProgressDialect.

The authoritative, complete list lives in the Hibernate docs: https://docs.hibernate.org/orm/6.6/dialect/

Contributors

The avatar of contributor named as YuePeng YuePeng
The avatar of contributor named as Claude Opus 5 (1M context) Claude Opus 5 (1M context)

Changelog

Released under the Apache-2.0 License.