Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughApplied dependency updates and a Yarn patch resolution; refined test deprecation filtering; adjusted IBMi connection typing/validation; extended Snowflake connection options; and enabled TypeScript declaration maps and a Mocha global. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.17.0)package.json┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m packages/core/test/support.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m packages/ibmi/package.json┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c388317 to
0497a7b
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
packages/postgres/src/query.js (1)
24-71: Move the new queueing implementation into TypeScript.This is non-trivial new runtime behavior in
packages/**/src/**/*.js. Please land it in TS, or fold it into the file's TypeScript migration first.As per coding guidelines,
packages/**/src/**/*.js: "Write all new implementations in TypeScript; avoid creating new .js files in src".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/postgres/src/query.js` around lines 24 - 71, The new query queueing logic was added in PostgresQuery.run in the .js source and must be migrated into TypeScript instead of leaving it as a new .js runtime behavior; move the implementation of connectionQueryQueues (WeakMap) and the run(...) logic (including the alias minification loop, runQuery promise, queuedQuery chaining, set on the WeakMap, and awaiting queuedQuery) into the TypeScript version of the PostgresQuery class (keep the same method name run and same semantics), add proper typings for connection, parameters, options and result, and remove or replace the .js implementation so the runtime behavior lives in the package’s .ts source.packages/db2/src/query.js (1)
276-299: Prefer TypeScript for newly added implementation insrcJS files.This adds new behavior in a legacy
.jsfile; please migrate the touched implementation to.tswhen updating this area further.As per coding guidelines
packages/**/src/**/*.js: "Write all new implementations in TypeScript; avoid creating new .js files in src".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/db2/src/query.js` around lines 276 - 299, The new implementation added to the JS source (the formatError function in packages/db2/src/query.js) should be migrated to TypeScript: move the updated logic into a new/renamed TypeScript module (e.g., packages/db2/src/query.ts), convert the function signature and local variables to use proper TypeScript types (err: unknown|Error, conn typed for querySync, parameters typed or any), update any imports/exports to reference the .ts module, remove/adjust runtime-only JS patterns (Object.assign new Error casts) to use typed guards and safe casting, and ensure the package build config includes the .ts file so the compiled output replaces the JS implementation; update tests/importers to point at the new module and remove the modified .js implementation to satisfy the rule "write all new implementations in TypeScript."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/test/unit/dialects/db2/errors.test.js`:
- Line 14: Replace the hard-coded describe title with the dialect-aware helper
by wrapping the title string in Support.getTestDialectTeaser(...); specifically
update the describe call in the DB2-specific suite (the describe block that
currently reads "[DB2 Specific] UniqueConstraintError - error message parsing")
to use Support.getTestDialectTeaser('[DB2 Specific] UniqueConstraintError -
error message parsing') so the test title follows the project's dialect-specific
convention.
In `@packages/db2/src/query.js`:
- Around line 277-279: Guard against err being null/undefined before accessing
err.message: replace the current logic that does Object.assign(new
Error(err.message), err) with a safe approach that extracts a fallback message
(e.g., const message = err && err.message ? err.message : String(err)) and then
merges with a safe object (e.g., Object.assign(new Error(message), err || {}));
update the code that references err, Object.assign, and new Error to use this
guarded message and a fallback empty object to avoid throwing when err is
null/undefined.
In `@packages/ibmi/src/connection-manager.ts`:
- Around line 120-121: The validate method is calling a non-existent
connection.connected() on OdbcConnection; update validation to use a tracked
connection state or an operation check: add a boolean flag (e.g., isConnected)
to the IBMiConnection implementation, set it true in connect() and false in
close()/disconnect(), and change validate(connection: IBMiConnection) to return
connection.isConnected; alternatively, implement validate to perform a
lightweight try/catch operation (e.g., a no-op or simple query) on the
IBMiConnection and return true only if it succeeds, referencing the validate
method and the connect()/close()/query() methods on
IBMiConnection/OdbcConnection.
---
Nitpick comments:
In `@packages/db2/src/query.js`:
- Around line 276-299: The new implementation added to the JS source (the
formatError function in packages/db2/src/query.js) should be migrated to
TypeScript: move the updated logic into a new/renamed TypeScript module (e.g.,
packages/db2/src/query.ts), convert the function signature and local variables
to use proper TypeScript types (err: unknown|Error, conn typed for querySync,
parameters typed or any), update any imports/exports to reference the .ts
module, remove/adjust runtime-only JS patterns (Object.assign new Error casts)
to use typed guards and safe casting, and ensure the package build config
includes the .ts file so the compiled output replaces the JS implementation;
update tests/importers to point at the new module and remove the modified .js
implementation to satisfy the rule "write all new implementations in
TypeScript."
In `@packages/postgres/src/query.js`:
- Around line 24-71: The new query queueing logic was added in PostgresQuery.run
in the .js source and must be migrated into TypeScript instead of leaving it as
a new .js runtime behavior; move the implementation of connectionQueryQueues
(WeakMap) and the run(...) logic (including the alias minification loop,
runQuery promise, queuedQuery chaining, set on the WeakMap, and awaiting
queuedQuery) into the TypeScript version of the PostgresQuery class (keep the
same method name run and same semantics), add proper typings for connection,
parameters, options and result, and remove or replace the .js implementation so
the runtime behavior lives in the package’s .ts source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 77b863c3-3a8b-4e20-aa4c-9b90b53ba8d9
⛔ Files ignored due to path filters (2)
.yarn/patches/@mapbox-node-pre-gyp-npm-2.0.3-4606feb049.patchis excluded by!**/.yarn/**yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (13)
package.jsonpackages/core/test/support.tspackages/core/test/unit/dialects/db2/errors.test.jspackages/db2/package.jsonpackages/db2/src/query.jspackages/ibmi/package.jsonpackages/ibmi/src/connection-manager.tspackages/postgres/package.jsonpackages/postgres/src/query.jspackages/snowflake/package.jsonpackages/snowflake/src/connection-manager.tspackages/snowflake/src/dialect.tspackages/sqlite3/package.json
💤 Files with no reviewable changes (1)
- packages/core/test/support.ts
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/core/test/unit/dialects/db2/errors.test.js (1)
14-14:⚠️ Potential issue | 🟡 MinorUse
Support.getTestDialectTeaser()for the DB2-specific suite title.Please wrap the
describetitle withSupport.getTestDialectTeaser(...)to follow test conventions.Proposed fix
- describe('[DB2 Specific] UniqueConstraintError - error message parsing', () => { + describe(Support.getTestDialectTeaser('[DB2 Specific] UniqueConstraintError - error message parsing'), () => {As per coding guidelines
packages/**/test/**/*.test.{js,ts}: "Use Support.getTestDialectTeaser() for dialect-specific test descriptions".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/test/unit/dialects/db2/errors.test.js` at line 14, The DB2-specific test suite title uses a plain string in the describe call; update the suite title to use Support.getTestDialectTeaser(...) to follow test conventions. Locate the describe('[DB2 Specific] UniqueConstraintError - error message parsing', ...) and replace the string argument with Support.getTestDialectTeaser('UniqueConstraintError - error message parsing') (keeping the same inner description text) so the describe uses Support.getTestDialectTeaser for dialect-specific naming.
🧹 Nitpick comments (1)
packages/postgres/src/query.js (1)
24-24: Migrate the connection queue to TypeScript instead of extending the legacy.jsfile.The
connectionQueryQueuesWeakMap and queueing logic (lines 24 and 46-64) are new implementations inpackages/postgres/src/query.js. Per coding guidelines, new implementations should be written in TypeScript to align with the ongoing migration strategy. Create a TypeScript implementation for this postgres-specific queueing behavior rather than growing the legacy.jsfile.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/postgres/src/query.js` at line 24, The connection queue implementation (the connectionQueryQueues WeakMap and the queueing logic around enqueuing/dequeuing queries) must be moved out of the legacy .js file into a new TypeScript module: re-implement the WeakMap named connectionQueryQueues and the associated queue management functions (enqueue/dequeue/flush semantics used by the existing query execution code) in a .ts file, export those symbols, and update references in the codebase to import the TypeScript exports instead of relying on the JS implementation; ensure the exported API matches the current usage (function names and behavior) so callers of the queueing logic need no behavioral changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/postgres/src/query.js`:
- Line 24: Queued queries continue to run on a destroyed client because the code
always advances to runQuery after the stored tail settles; update the queue
handling that uses the connectionQueryQueues WeakMap so that before invoking
runQuery (and before chaining the next task after the tail resolves) you check
the client's flags (e.g., client._invalid and client._ending) and immediately
fail/reject queued requests if either flag is set, and when the client is torn
down clear or reject the WeakMap entry for that client so no further chained
tasks run; locate code referencing connectionQueryQueues and runQuery and add
these checks and cleanup to fail fast.
---
Duplicate comments:
In `@packages/core/test/unit/dialects/db2/errors.test.js`:
- Line 14: The DB2-specific test suite title uses a plain string in the describe
call; update the suite title to use Support.getTestDialectTeaser(...) to follow
test conventions. Locate the describe('[DB2 Specific] UniqueConstraintError -
error message parsing', ...) and replace the string argument with
Support.getTestDialectTeaser('UniqueConstraintError - error message parsing')
(keeping the same inner description text) so the describe uses
Support.getTestDialectTeaser for dialect-specific naming.
---
Nitpick comments:
In `@packages/postgres/src/query.js`:
- Line 24: The connection queue implementation (the connectionQueryQueues
WeakMap and the queueing logic around enqueuing/dequeuing queries) must be moved
out of the legacy .js file into a new TypeScript module: re-implement the
WeakMap named connectionQueryQueues and the associated queue management
functions (enqueue/dequeue/flush semantics used by the existing query execution
code) in a .ts file, export those symbols, and update references in the codebase
to import the TypeScript exports instead of relying on the JS implementation;
ensure the exported API matches the current usage (function names and behavior)
so callers of the queueing logic need no behavioral changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6e5f66f0-d98e-402e-8325-ca2a92dd2e14
⛔ Files ignored due to path filters (2)
.yarn/patches/@mapbox-node-pre-gyp-npm-2.0.3-4606feb049.patchis excluded by!**/.yarn/**yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (13)
package.jsonpackages/core/test/support.tspackages/core/test/unit/dialects/db2/errors.test.jspackages/db2/package.jsonpackages/db2/src/query.jspackages/ibmi/package.jsonpackages/ibmi/src/connection-manager.tspackages/postgres/package.jsonpackages/postgres/src/query.jspackages/snowflake/package.jsonpackages/snowflake/src/connection-manager.tspackages/snowflake/src/dialect.tspackages/sqlite3/package.json
💤 Files with no reviewable changes (1)
- packages/core/test/support.ts
✅ Files skipped from review due to trivial changes (6)
- packages/snowflake/package.json
- packages/postgres/package.json
- packages/ibmi/package.json
- packages/db2/package.json
- package.json
- packages/sqlite3/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/db2/src/query.js
- packages/ibmi/src/connection-manager.ts
- packages/snowflake/src/dialect.ts
ephys
left a comment
There was a problem hiding this comment.
The AI is stealing all of the comments I wanted to make >:(
|
Okay, I've reduced the scope of this PR as both of the changes to |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/snowflake/src/connection-manager.ts`:
- Around line 37-38: Update the inline comment for the removed option to state
that "oauthHttpAllowed" is deprecated rather than removed: replace the current
comment string about not being supported with a concise deprecation note such as
"// \"oauthHttpAllowed\" is deprecated in the Snowflake SDK (for testing only;
use oauthRedirectUri instead)", keeping the identifier oauthHttpAllowed in the
union definition unchanged so the public API omission remains correct.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 67c86f79-018f-4e9c-a8db-9497e6d46c4f
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
.mocharc.jsoncpackages/core/test/support.tspackages/snowflake/src/connection-manager.tstsconfig-preset.json
✅ Files skipped from review due to trivial changes (2)
- .mocharc.jsonc
- tsconfig-preset.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/core/test/support.ts
Queue postgres queries per client so concurrent operations sharing a transaction do not overlap on the same driver connection. This avoids the pg and pg-native deprecation failure when client.query() is called while another query is still executing.
3b68857 to
386a66e
Compare
* main: (200 commits) meta: update actions/upload-artifact action to v7.0.1 (sequelize#18212) meta: update sequelize AUTHORS (sequelize#18208) feat(cli): add migration generate, run, status & undo (sequelize#18193) feat(core): Drop the ability to specify the dialect as a string (sequelize#18204) feat: update some dialect adapters (sequelize#18189) feat(postgres): replace pg-hstore with inline hstore parser (sequelize#18151) feat(core): add `sql.random`, improve `Order` typing (sequelize#18203) meta: use Sequelize Bot for drafting PRs (sequelize#18201) meta: automatically mark unfinished PRs as draft (sequelize#18197) meta: update dependency @oclif/test to v4.1.18 (sequelize#18198) fix(core): replace @typeparam with @template in JSDoc (sequelize#18094) feat(core): Add support for UUID v7 (sequelize#17832) meta: update sequelize AUTHORS (sequelize#18190) meta: update dependency @oclif/plugin-help to ^6.2.43 (sequelize#18195) meta: update dependency esbuild to v0.28.0 (sequelize#18192) meta: update dependency @oclif/plugin-help to ^6.2.42 (sequelize#18191) meta: update dependency @oclif/core to ^4.10.5 (sequelize#18187) meta: update sequelize AUTHORS (sequelize#18158) feat: add Node 24 support, drop Node 18 (sequelize#18185) feat(core): add support for readonly attribute arrays (sequelize#18186) ...
Pull Request Checklist
Description of Changes
This PR updates dialect adapters apart from
mariadb(has broken types). That combined with a custom patch for@mapbox/node-pre-gyp(used inodbc) allows us to remove the two Node deprecations from the allowed ones in tests. Also moves thesqlite3package back to the upstream, the README still mentions it's deprecated but there have been updates after.I'm not so sure if the
snowflake-sdkupdate is handled well or that we want something else for theawslambdaglobal. In #18005 I added it to the mocha config but I'm also not sure if that's betterSummary by CodeRabbit
New Features
Bug Fixes
Chores
Tests