-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md --> ##### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [ ] `npm test` passes - [ ] tests and/or benchmarks are included - [ ] documentation is changed or added - [ ] commit message follows commit guidelines ##### Affected core subsystem(s) <!-- Provide affected core subsystem(s). --> ##### Description of change <!-- Provide a description of the change below this comment. --> <!-- - any feature? - close https://github.com/eggjs/egg/ISSUE_URL --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The `generateSql` method is now publicly accessible, enhancing SQL hinting capabilities. - The `DataSourceDelegate` class has been restructured to extend the `DataSource` class, simplifying its implementation. - **Bug Fixes** - Removed redundant methods for executing SQL commands, improving code clarity. - **Documentation** - Updated comments and annotations to reflect changes in method visibility and class structure. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,12 @@ export class DataSource<T> implements IDataSource<T> { | |
this.sqlMap = sqlMap; | ||
} | ||
|
||
private generateSql(sqlName: string, data: object): ExecuteSql { | ||
/** | ||
* public for aop execute to implement sql hint append | ||
* @param sqlName | ||
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (16)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (16)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (18)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (18)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (20)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (20)
Check warning on line 28 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (22)
|
||
* @param data | ||
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (16)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (16)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (18)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (18)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-macos (20)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (20)
Check warning on line 29 in core/dal-runtime/src/DataSource.ts GitHub Actions / Runner-ubuntu (22)
|
||
*/ | ||
generateSql(sqlName: string, data: object): ExecuteSql { | ||
const sql = this.sqlMap.generate(sqlName, data, this.mysqlDataSource.timezone!); | ||
const sqlType = this.sqlMap.getType(sqlName); | ||
const template = this.sqlMap.getTemplateString(sqlName); | ||
|