Skip to content

Revert "fix: oracle db operation"#327

Merged
c121914yu merged 1 commit intomainfrom
revert-326-fix/dbops
Dec 24, 2025
Merged

Revert "fix: oracle db operation"#327
c121914yu merged 1 commit intomainfrom
revert-326-fix/dbops

Conversation

@c121914yu
Copy link
Contributor

Reverts #326

Copilot AI review requested due to automatic review settings December 24, 2025 02:08
@c121914yu c121914yu merged commit f0b39ae into main Dec 24, 2025
3 checks passed
@github-actions
Copy link

Build Successful - Preview Images for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin-pr:e67aa1bc404fc9aa89d448b6437963ac63593e05

Changed packages:
dbops

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with JSON.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))
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

Using JSON.parse(JSON.stringify()) is inefficient and can cause issues. This approach:

  1. Has poor performance due to double serialization overhead
  2. Will throw an error if result is undefined (when sql.execute() returns undefined for some queries)
  3. Loses non-serializable properties like Buffers, Dates (converted to strings), and circular references
  4. 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.

Copilot uses AI. Check for mistakes.
rows: result?.rows ?? [],
metaData: result?.metaData ?? []
}
result: JSON.parse(JSON.stringify(result))
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
result: JSON.parse(JSON.stringify(result))
result

Copilot uses AI. Check for mistakes.
rows: result?.rows ?? [],
metaData: result?.metaData ?? []
}
result: JSON.parse(JSON.stringify(result))
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
result: JSON.parse(JSON.stringify(result))
result

Copilot uses AI. Check for mistakes.
@c121914yu c121914yu deleted the revert-326-fix/dbops branch December 27, 2025 14:30
FinleyGe pushed a commit to LBP97541135/fastgpt-plugin that referenced this pull request Jan 4, 2026
FinleyGe added a commit that referenced this pull request Jan 5, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 6, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 6, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 8, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 8, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 8, 2026
* 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>
FinleyGe added a commit to FinleyGe/fastgpt-plugin that referenced this pull request Jan 12, 2026
* 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>
FinleyGe added a commit that referenced this pull request Jan 12, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant