Skip to content

Conversation

ForestLH
Copy link
Contributor

@ForestLH ForestLH commented Mar 3, 2025

What this PR does:
refactor the architecture of build beforeImage and afterImage.

  • remove repeated build beforeImage and afterImage in undo/builder package
  • extract the public ExecContext logic of at's Executor into BaseContext and place it in the internal package.
  • add an abstract interface for build beforeImage and afterImage, in this way, databases can implement this interface, like MySQL, PostgreSQL.

But now its support MySQL only, other DBMS are left to support other tasks.

Which issue(s) this PR fixes:

Fixes #751

@github-actions github-actions bot added the coding label Mar 3, 2025
@ForestLH ForestLH marked this pull request as draft March 3, 2025 14:52
Copy link
Contributor

@Code-Fight Code-Fight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要处理一下冲突

@ForestLH
Copy link
Contributor Author

需要处理一下冲突

好的
😄

@ForestLH ForestLH marked this pull request as ready for review April 26, 2025 08:45
ForestLH added 3 commits May 19, 2025 23:17
…lder package

Signed-off-by: LeeHao <1838249551@qq.com>
…utor into BaseExecutor

Signed-off-by: LeeHao <1838249551@qq.com>
Signed-off-by: LeeHao <1838249551@qq.com>
@@ -81,3 +80,57 @@ func (e *ATExecutor) ExecWithValue(ctx context.Context, execCtx *types.ExecConte
execCtx.NamedValues = util.ValueToNamedValue(execCtx.Values)
return e.ExecWithNamedValue(ctx, execCtx, f)
}

func (e *ATExecutor) NewInsertExecutor(parserCtx *types.ParseContext, execContext *types.ExecContext, hooks []exec.SQLHook) internal.Executor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改成实现数据库接口,由各自的数据库接口去实现不同的sqltype,不在at_executor中那么多判断,保证后续的接入新数据库时的拓展性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the implementation of the beforeImage and afterImage in the undo log
3 participants