Class AbstractJdbcDialectBuilder
AbstractJdbcDialect — chainable configuration then build().
build() performs three steps: detect DB type via SPI → assemble table
names → optionally auto-create tables via AbstractJdbcDialect.createTableDdls().
The returned dialect instance does not hold a connection reference.
Detection uses JDK ServiceLoader to discover all AbstractJdbcDialect
implementations on the classpath. Candidates are sorted by
AbstractJdbcDialect.getOrder() (ascending); ties are broken by inheritance depth
(subclass before parent). The first candidate whose
AbstractJdbcDialect.supports(DatabaseMetaData) returns true wins.
Third-party extensions: place a
META-INF/services/io.agentscope.extensions.jdbc.dialect.AbstractJdbcDialect file
in your jar listing the dialect class name. Downstream projects add the dependency and
the dialect is auto-discovered — zero code changes.
- Author:
- shanhongyu
-
Method Summary
Modifier and TypeMethodDescriptionautoCreateTable(boolean autoCreateTable) Whether to auto-create tables duringbuild()(default true).build()Detects the dialect, assembles table names, optionally creates tables.sessionStateTableName(String name) Overrides the full session-state table name.snapshotTableName(String name) Overrides the full snapshots table name.storeTableName(String name) Overrides the full KV store table name (takes priority over prefix + base).tablePrefix(String tablePrefix) Sets the unified table prefix (defaultagentscope_).
-
Method Details
-
tablePrefix
Sets the unified table prefix (defaultagentscope_). -
storeTableName
Overrides the full KV store table name (takes priority over prefix + base). -
sessionStateTableName
Overrides the full session-state table name. -
snapshotTableName
Overrides the full snapshots table name. -
autoCreateTable
Whether to auto-create tables duringbuild()(default true). -
build
Detects the dialect, assembles table names, optionally creates tables.
-