Skip to content

feat(types): add NOT IN to SQLOperator type#3785

Open
surohak wants to merge 1 commit intonuxt:mainfrom
surohak:feat/add-not-in-sql-operator
Open

feat(types): add NOT IN to SQLOperator type#3785
surohak wants to merge 1 commit intonuxt:mainfrom
surohak:feat/add-not-in-sql-operator

Conversation

@surohak
Copy link
Copy Markdown

@surohak surohak commented May 6, 2026

Description

The query builder already handles NOT IN at runtime:

case 'IN':
case 'NOT IN':
  if (Array.isArray(value)) {
    const values = value.map(val => singleQuote(val)).join(', ')
    condition = `"${String(field)}" ${operator.toUpperCase()} (${values})`

However, the SQLOperator type does not include 'NOT IN', so TypeScript users cannot use it without type assertions.

Fix

Add 'NOT IN' to the SQLOperator type union (placed next to 'IN' for logical grouping).

Changes

  • src/types/query.ts: Add 'NOT IN' to SQLOperator

Fixes #3766

The query builder already handles NOT IN at runtime (case 'NOT IN' in
the switch statement), but the TypeScript type does not expose it,
forcing users to cast or suppress type errors when using it.

Fixes nuxt#3766
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

Someone is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79641fcc-6b4d-4ac1-8947-27a6c42e0f1c

📥 Commits

Reviewing files that changed from the base of the PR and between 55b8793 and cceb908.

📒 Files selected for processing (1)
  • src/types/query.ts

📝 Walkthrough

Walkthrough

The pull request adds 'NOT IN' to the SQLOperator type alias in src/types/query.ts. This change extends the available SQL operators to include the negation of the existing 'IN' operator, allowing developers to filter records where a value is not in a specified collection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding 'NOT IN' to the SQLOperator type.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the problem, solution, and referencing the linked issue.
Linked Issues check ✅ Passed The pull request fully addresses issue #3766 by adding 'NOT IN' to the SQLOperator type union as requested.
Out of Scope Changes check ✅ Passed The changes are scoped to the objective: only the SQLOperator type in src/types/query.ts was modified to include 'NOT IN'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 6, 2026

npm i https://pkg.pr.new/@nuxt/content@3785

commit: cceb908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLOperator type doesn't include NOT IN

1 participant