Conversation
This reverts commit 21ec59a.
|
✅ Build Successful - Preview Images for this PR: Changed packages: |
There was a problem hiding this comment.
Pull request overview
This PR reverts a previous fix (#326) for Oracle database operations, replacing explicit object construction with null coalescing back to a JSON serialization pattern. The revert introduces potential bugs and performance issues.
Key changes:
- Replaces explicit
{ rows: result?.rows ?? [], metaData: result?.metaData ?? [] }structure withJSON.parse(JSON.stringify(result)) - Removes safe default handling for undefined rows and metaData properties
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rows: result?.rows ?? [], | ||
| metaData: result?.metaData ?? [] | ||
| } | ||
| result: JSON.parse(JSON.stringify(result)) |
There was a problem hiding this comment.
Using JSON.parse(JSON.stringify()) is inefficient and can cause issues. This approach:
- Has poor performance due to double serialization overhead
- Will throw an error if result is undefined (when sql.execute() returns undefined for some queries)
- Loses non-serializable properties like Buffers, Dates (converted to strings), and circular references
- Is inconsistent with other database implementations (MySQL, PostgreSQL, SQL Server, ClickHouse) which all return the result directly
The reverted code with explicit structure and null coalescing (rows ?? [], metaData ?? []) was safer as it handled edge cases where the Oracle driver might return undefined or partial results.
| rows: result?.rows ?? [], | ||
| metaData: result?.metaData ?? [] | ||
| } | ||
| result: JSON.parse(JSON.stringify(result)) |
There was a problem hiding this comment.
This implementation is inconsistent with other database operations in the codebase. MySQL, PostgreSQL, SQL Server, and ClickHouse implementations all return the result directly without JSON serialization. Consider aligning the Oracle implementation with these patterns for consistency and maintainability.
| result: JSON.parse(JSON.stringify(result)) | |
| result |
| rows: result?.rows ?? [], | ||
| metaData: result?.metaData ?? [] | ||
| } | ||
| result: JSON.parse(JSON.stringify(result)) |
There was a problem hiding this comment.
The JSON.parse(JSON.stringify()) pattern introduces significant performance overhead, especially for large query results. This double serialization process is unnecessary and inefficient compared to either returning the result object directly or constructing a simple object with the needed properties.
| result: JSON.parse(JSON.stringify(result)) | |
| result |
This reverts commit 21ec59a.
* feat: add WeCom Smart Sheet toolset * perf: init tool (#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (#326) * Revert "fix: oracle db operation (#326)" (#327) This reverts commit 21ec59a. * update model provider (#328) * feat: wecom corp token tool (#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: add WeCom Smart Sheet toolset * perf: init tool (labring#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (labring#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (labring#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (labring#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (labring#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (labring#326) * Revert "fix: oracle db operation (labring#326)" (labring#327) This reverts commit 21ec59a. * update model provider (labring#328) * feat: wecom corp token tool (labring#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
* feat: wecom corp token tool (#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * add WeCom Smart Sheet toolset (#329) * feat: add WeCom Smart Sheet toolset * perf: init tool (#319) * add gpt5.2 * perf: init tool * perf: init tool * perf: init tool * rename gpt 5.2 * rename gpt 5.2 * rename gpt 5.2 * add init batch (#320) * add gpt5.2 * add init * remove invalid code * Add gemini3 model (#323) * add gpt5.2 * remove invalid code * gemini3 * perf: mongo and redis reconnect (#325) * perf: mongo and redis reconnect * perf: mongo and redis reconnect * perf: redis * feat:markdownTransform tool indent&ordered&indent (#322) * feat:markdownTransform tool indent&ordered&indent * chore: add version description --------- Co-authored-by: Finley Ge <finleyge@fastgpt.io> * fix: oracle db operation (#326) * Revert "fix: oracle db operation (#326)" (#327) This reverts commit 21ec59a. * update model provider (#328) * feat: wecom corp token tool (#330) * feat: get wecom corp id tool * feat: update wecomCorpId readme * chore: restore the index.ts file to template raw * chore: update wecom logo * fix: remove wecom corpId tool secret input * fix: remove useless params for get wecom auth token --------- Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Finley Ge <finleyge@fastgpt.io> Co-authored-by: Roy <whoeverimf5@gmail.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com> * chore: edit env template * fix: invoke * fix: invoke in main thread --------- Co-authored-by: LBP97541135 <15535198819@163.com> Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Peter-FrontEnd <74163300+Peter-FrontEnd@users.noreply.github.com> Co-authored-by: Roy <whoeverimf5@gmail.com>
Reverts #326