Skip to content

feat(sql-runtime): add neq comparison operator support - #36

Merged
jkomyno merged 3 commits into
mainfrom
feat/neq-comparison-operator
Dec 19, 2025
Merged

feat(sql-runtime): add neq comparison operator support#36
jkomyno merged 3 commits into
mainfrom
feat/neq-comparison-operator

Conversation

@jkomyno

@jkomyno jkomyno commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

This PR:

  • adds support for neq, the negation of the comparison comparison operator eq
  • closes TML-1693

Summary by CodeRabbit

  • New Features

    • Added support for a not-equal (neq) comparison operator across the SQL query builder and adapters, enabling != style filtering.
  • Tests

    • Added tests validating neq behavior and error handling alongside existing comparison operator coverage.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new "not equal" (neq) comparison operator across the SQL query builder: AST/types, public types, column builder API, operations registry, tests, and Postgres adapter mapping to !=.

Changes

Cohort / File(s) Summary
AST & Type definitions
packages/sql/lanes/relational-core/src/ast/types.ts, packages/sql/lanes/relational-core/src/types.ts
Added neq to BinaryOp and added neq(value: ParamPlaceholder) to column-builder public types/interfaces.
Column builder implementation
packages/sql/lanes/relational-core/src/schema.ts
Added neq(value) instance method on ColumnBuilderImpl returning a BinaryBuilder using the neq operator.
Operations registry
packages/sql/lanes/relational-core/src/operations-registry.ts
Exposed neq comparison method on the base result object returned by executeOperation (neq: createComparisonMethod('neq')).
Postgres adapter
packages/targets/postgres-adapter/src/core/adapter.ts
Mapped neq to SQL != in the binary expression renderer's operator map.
Tests
packages/sql/lanes/relational-core/test/schema.test.ts, packages/sql/lanes/sql-lane/test/sql-comparison-operators.test.ts
Added neq to operator arrays and parameterized tests; added tests verifying column.neq() error handling matches other operators.

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb9a6a and 4014e2d.

📒 Files selected for processing (1)
  • packages/sql/lanes/sql-lane/test/sql-comparison-operators.test.ts (2 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@jkomyno jkomyno mentioned this pull request Dec 18, 2025

@wmadden wmadden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good job @jkomyno 👍🏻

One small suggestion

const { id } = tables.user.columns;

expect(() => {
(id as { neq: (value: unknown) => unknown }).neq({ kind: 'invalid' } as unknown);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is that cast necessary? It might be simpler to write as

        // @ts-expect-error testing invalid input
        id.neq({ kind: 'invalid' });

our agents are consistently making this mistake

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed 4014e2d

@jkomyno jkomyno changed the title feat(sql-runtime): add neq comparisong operator support feat(sql-runtime): add neq comparison operator support Dec 19, 2025
@jkomyno
jkomyno merged commit fac7de8 into main Dec 19, 2025
9 checks passed
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.

2 participants