-
Notifications
You must be signed in to change notification settings - Fork 63
Revert "fix: oracle db operation" #327
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,10 +24,7 @@ export async function main({ | |||||||||
| await sql.close(); | ||||||||||
| await pool.close(); | ||||||||||
| return { | ||||||||||
| result: { | ||||||||||
| rows: result?.rows ?? [], | ||||||||||
| metaData: result?.metaData ?? [] | ||||||||||
| } | ||||||||||
| result: JSON.parse(JSON.stringify(result)) | ||||||||||
|
||||||||||
| result: JSON.parse(JSON.stringify(result)) | |
| result |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
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.
| result: JSON.parse(JSON.stringify(result)) | |
| result |
There was a problem hiding this comment.
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:
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.