Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support shentong database #6864

Open
wants to merge 15 commits into
base: 2.x
Choose a base branch
from

Conversation

dsomehan
Copy link

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@xjlgod
Copy link
Contributor

xjlgod commented Sep 18, 2024

Maybe you can provide more detailed changes you made?
也许你可以更详细的列出你的改动点?

@dsomehan
Copy link
Author

Maybe you can provide more detailed changes you made? 也许你可以更详细的列出你的改动点?

Prerequisites: Oscar database engine is basically compatible with Oracle syntax,

  1. Add Oscar DBType recognition to PageUtil's pageSql, countSql, getTimeStartSql, and getTimeEndSql methods.
  2. Add Oscar enumeration item to DBType.
  3. Add OscarLockStoreSql class for generating Oscar database lock information sql.
  4. Add OscarLogStoreSqls class for generating Oscar database global transaction table related sql.
  5. Use SPI to declare the two classes 3 and 4.
  6. Add logic to obtain Oscar database connection resourceId in DataSourceProxy.
  7. Implement Oscar's BaseInsertExecutor and Sequenceable interfaces, and declare them using SPI.
  8. Add Oscar's keyword checking class, and declare it using SPI.
  9. Add Oscar's table structure cache implementation, and declare it using SPI.
  10. Add Oscar's undo implementation to RM data source, and declare it using SPI.
  11. Add Oscar's SQL parsing implementation, and declare it using SPI.
  12. Add test case code for the above changes.

前提:神通oscar数据库基本兼容oracle语法,

  1. PageUtil中pageSql、countSql、getTimeStartSql、getTimeEndSql方法添加oscar dbtype的识别
  2. DBType添加OSCAR枚举项
  3. 添加OscarLockStoreSql OSCAR数据库锁信息sql生成类
  4. 添加和OscarLogStoreSqls OSCAR数据库全局事务表相关sql生成类
  5. 并将3和4两个类使用spi方式进行声明
  6. 在DataSourceProxy中添加获取OSCAR数据库连接的resourceId的逻辑
  7. 实现OSCAR的BaseInsertExecutor和Sequenceable接口,并通过spi方式声明
  8. 添加OSCAR的关键字检查类,并通过spi方式声明
  9. 添加OSCAR表结构缓存类的实现,并通过spi方式声明
  10. rm数据源中添加oscar的undo实现,并通过spi方式声明
  11. 添加oscar的sql解析实现,并通过spi方式声明
  12. 添加上述改动的测试用例代码

@dsomehan
Copy link
Author

基本上的改动就是这些,主要是添加了神通数据库支持

@dsomehan
Copy link
Author

dsomehan commented Sep 19, 2024

客户端的适配我在druid里提供了pr,在合并之前如果需要使用可以参考

import com.alibaba.druid.util.JdbcUtils;
import io.seata.common.loader.LoadLevel;
import io.seata.sqlparser.util.DbTypeParser;


@LoadLevel(name = "druid", order = 1)
public class OscarDbTypeParser implements DbTypeParser {
	public OscarDbTypeParser() {
	}
	@Override
	public String parseFromJdbcUrl(String jdbcUrl) {
		if (jdbcUrl.startsWith("jdbc:oscar:")) {
			return "oscar";
		}
		return JdbcUtils.getDbType(jdbcUrl, null);
	}
}

@dsomehan dsomehan force-pushed the feature_support_shentong_database branch from 0680ac9 to d31610b Compare September 23, 2024 06:06
@funky-eyes funky-eyes added this to the 2.x Backlog milestone Sep 26, 2024
@funky-eyes funky-eyes added first-time contributor first-time contributor module/rm-datasource rm-datasource module module/sqlparser sql-parser module module/common common module labels Sep 26, 2024
@funky-eyes funky-eyes added the mode: AT AT transaction mode label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor mode: AT AT transaction mode module/common common module module/rm-datasource rm-datasource module module/sqlparser sql-parser module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants