Class H2Dialect

java.lang.Object
cloud.opencode.base.flow.persistence.jdbc.H2Dialect
All Implemented Interfaces:
JdbcDialect

public final class H2Dialect extends Object implements JdbcDialect
H2 database dialect (primary CI / contract-test backend). H2 数据库方言(CI / 契约测试主用后端)。

Column-type mapping (design v4 §6):

  • JSON columns → CLOB (H2 has no native JSON type as of 2.x)
  • Timestamp columns → TIMESTAMP(6)
  • Boolean columns → BOOLEAN

列类型映射(设计 v4 §6):

  • JSON 列 → CLOB(H2 2.x 暂无原生 JSON 类型)
  • TIMESTAMP 列 → TIMESTAMP(6)
  • boolean 列 → BOOLEAN
Since:
JDK 25, opencode-base-flow V1.0.5
Author:
Leon Soo
  • Constructor Details

    • H2Dialect

      public H2Dialect()
      Creates a stateless H2 dialect. 构造无状态 H2 方言实例。
      Since:
      JDK 25, opencode-base-flow V1.0.5
  • Method Details

    • jsonType

      public String jsonType()
      Description copied from interface: JdbcDialect
      Column type for variables_json / dsl_json / extra_json. variables_json / dsl_json / extra_json 列类型。
      Specified by:
      jsonType in interface JdbcDialect
      Returns:
      vendor-specific JSON column type — 方言相关 JSON 类型
    • timestampType

      public String timestampType()
      Description copied from interface: JdbcDialect
      Column type for TIMESTAMP columns (with microsecond precision, including time-zone where the dialect supports it). TIMESTAMP 列类型(微秒精度,方言支持时含时区)。
      Specified by:
      timestampType in interface JdbcDialect
      Returns:
      vendor-specific timestamp column type — 方言相关 TIMESTAMP 类型
    • booleanType

      public String booleanType()
      Description copied from interface: JdbcDialect
      Column type for boolean columns (e.g. flow_comment_template.enabled). boolean 列类型(如 flow_comment_template.enabled)。
      Specified by:
      booleanType in interface JdbcDialect
      Returns:
      vendor-specific boolean column type — 方言相关 boolean 类型
    • shortName

      public String shortName()
      Description copied from interface: JdbcDialect
      Short identifier used to pick the matching V1__init_*.sql script (one of "mysql" / "postgres" / "h2"). 用于挑选 V1__init_*.sql 脚本的短标识("mysql" / "postgres" / "h2")。
      Specified by:
      shortName in interface JdbcDialect
      Returns:
      short identifier — 短标识