MysqlDialect
public class MysqlDialect extends AbstractJdbcDialect
io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:46–272MySQL Dialect,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.extensions.jdbc.dialect.vendor 包,继承自 AbstractJdbcDialect。核心成员包括 storeCreateTableDdls、storeUpsert、sessionStateCreateTableDdls、sessionStateUpsert、sessionStateCheckTableExists、snapshotCreateTableDdls。
MySQL / MariaDB dialect.
Overrides DDL (LONGTEXT, ENGINE=InnoDB, utf8mb4), UPSERT
syntax (ON DUPLICATE KEY UPDATE), table-existence check (DATABASE()),
and lock acquisition (GET_LOCK / RELEASE_LOCK). All other business SQL
inherits ANSI defaults.
方法摘要Method Summary
方法详情Method Detail
storeCreateTableDdls
public List<String> storeCreateTableDdls()
返回 storeCreateTableDdls 结果。
Returns the store create table ddls.
List<String>io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:65–81storeUpsert
public BoundSql storeUpsert(String namespacePath, String key, String json, long timestamp)
执行 storeUpsert 方法。
Performs the store upsert operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
namespacePath | String | 命名空间路径(类型 `String`)。The namespace path. |
key | String | 键(类型 `String`)。The key. |
json | String | JSON(类型 `String`)。The json. |
timestamp | long | 时间戳(类型 `long`)。The timestamp. |
BoundSqlio/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:83–98sessionStateCreateTableDdls
public List<String> sessionStateCreateTableDdls()
返回 sessionStateCreateTableDdls 结果。
Returns the session state create table ddls.
List<String>io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:104–121sessionStateUpsert
public BoundSql sessionStateUpsert(String sessionId, String stateKey, int itemIndex, String stateData)
执行 sessionStateUpsert 方法。
Performs the session state upsert operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
stateKey | String | 状态键(类型 `String`)。The state key. |
itemIndex | int | 条目索引(类型 `int`)。The item index. |
stateData | String | 状态数据(类型 `String`)。The state data. |
BoundSqlio/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:123–137sessionStateCheckTableExists
public BoundSql sessionStateCheckTableExists(String tableName)
设置该参数。
Performs the session state check table exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tableName | String | table 名称(类型 `String`)。The table name. |
BoundSqlio/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:139–145snapshotCreateTableDdls
public List<String> snapshotCreateTableDdls()
返回 snapshotCreateTableDdls 结果。
Returns the snapshot create table ddls.
List<String>io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:151–161snapshotUpsert
public BoundSql snapshotUpsert(String snapshotId, InputStream data)
执行 snapshotUpsert 方法。
Performs the snapshot upsert operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。The snapshot id. |
data | InputStream | 数据(类型 `InputStream`)。The data. |
BoundSqlio/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:163–174tryEnter
public SandboxLease tryEnter(String lockName, int timeoutSeconds) throws InterruptedException
执行 tryEnter 方法。
Performs the try enter operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
lockName | String | 锁名称(类型 `String`)。The lock name. |
timeoutSeconds | int | 超时秒(类型 `int`)。The timeout seconds. |
SandboxLeaseInterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:180–212supports
public boolean supports(DatabaseMetaData metaData) throws SQLException
设置支持。
Performs the supports operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metaData | DatabaseMetaData | 元数据(类型 `DatabaseMetaData`)。The meta data. |
booleanSQLException可能抛出 `SQLException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/jdbc/dialect/vendor/MysqlDialect.java:267–271继承成员Inherited Members
SessionStateDialectsessionStateInsert, sessionStateInsertIfAbsent, sessionStateUpdateIfVersion, sessionStateSelect, sessionStateSelectVersioned, sessionStateSelectList, sessionStateDeleteByKey, sessionStateDeleteSession, sessionStateSelectMaxIndex, sessionStateExists, sessionStateListSessionIds, sessionStateLikeEscapeChar