AS AgentScopeAPI 手册 / API Reference

AbstractJdbcDialectBuilder

public class AbstractJdbcDialectBuilder
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:48–190

抽象 JDBC Dialect 构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.jdbc.dialect 包。核心成员包括 tablePrefix、storeTableName、sessionStateTableName、snapshotTableName、autoCreateTable、build。

Builder for 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.

方法摘要Method Summary

方法Method说明Description
public AbstractJdbcDialectBuilder tablePrefix(String tablePrefix)
设置该配置项。
Sets the unified table prefix (default `agentscope_`).
public AbstractJdbcDialectBuilder storeTableName(String name)
设置该配置项。
Overrides the full KV store table name (takes priority over prefix + base).
public AbstractJdbcDialectBuilder sessionStateTableName(String name)
设置该配置项。
Overrides the full session-state table name.
public AbstractJdbcDialectBuilder snapshotTableName(String name)
设置该配置项。
Overrides the full snapshots table name.
public AbstractJdbcDialectBuilder autoCreateTable(boolean autoCreateTable)
设置该配置项。
Whether to auto-create tables during `#build()` (default true).
public AbstractJdbcDialect build()
构建并返回最终实例。
Detects the dialect, assembles table names, optionally creates tables.

方法详情Method Detail

tablePrefix

public AbstractJdbcDialectBuilder tablePrefix(String tablePrefix)

设置该配置项。

Sets the unified table prefix (default agentscope_).

参数Parameters
名称Name类型Type说明Description
tablePrefixStringtable Prefix(类型 `String`)。The table prefix.
返回Returns AbstractJdbcDialectBuilder
返回AbstractJdbcDialectBuilder。Returns abstract jdbc dialect builder.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:70–73

storeTableName

public AbstractJdbcDialectBuilder storeTableName(String name)

设置该配置项。

Overrides the full KV store table name (takes priority over prefix + base).

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
返回Returns AbstractJdbcDialectBuilder
返回AbstractJdbcDialectBuilder。Returns abstract jdbc dialect builder.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:76–79

sessionStateTableName

public AbstractJdbcDialectBuilder sessionStateTableName(String name)

设置该配置项。

Overrides the full session-state table name.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
返回Returns AbstractJdbcDialectBuilder
返回AbstractJdbcDialectBuilder。Returns abstract jdbc dialect builder.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:82–85

snapshotTableName

public AbstractJdbcDialectBuilder snapshotTableName(String name)

设置该配置项。

Overrides the full snapshots table name.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
返回Returns AbstractJdbcDialectBuilder
返回AbstractJdbcDialectBuilder。Returns abstract jdbc dialect builder.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:88–91

autoCreateTable

public AbstractJdbcDialectBuilder autoCreateTable(boolean autoCreateTable)

设置该配置项。

Whether to auto-create tables during #build() (default true).

参数Parameters
名称Name类型Type说明Description
autoCreateTablebooleanauto 创建 Table(类型 `boolean`)。The auto create table.
返回Returns AbstractJdbcDialectBuilder
返回AbstractJdbcDialectBuilder。Returns abstract jdbc dialect builder.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:94–97

build

public AbstractJdbcDialect build()

构建并返回最终实例。

Detects the dialect, assembles table names, optionally creates tables.

返回Returns AbstractJdbcDialect
返回AbstractJdbcDialect。Returns abstract jdbc dialect.
源码Source io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:100–115
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.