Skip to content
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

add object support for 'and' and 'or' functions. Closes #344 #583

Merged
merged 5 commits into from
Jul 14, 2023

Conversation

koskimas
Copy link
Member

Support

db.selectFrom('person')
  .selectAll()
  .where((eb) => eb.and({
    first_name: 'Jennifer',
    last_name: eb.ref('first_name')
  }))

Same works with eb.or.

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2023 5:23am

Copy link
Member

@igalklebanov igalklebanov left a comment

Choose a reason for hiding this comment

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

Great improvement to DX! 🎉

LFGTM! 🚀

left some suggestions..

src/expression/expression-builder.ts Outdated Show resolved Hide resolved
src/expression/expression-builder.ts Outdated Show resolved Hide resolved
src/parser/binary-operation-parser.ts Show resolved Hide resolved
@igalklebanov igalklebanov added enhancement New feature or request api Related to library's API labels Jul 13, 2023
@koskimas koskimas merged commit ef34d30 into master Jul 14, 2023
5 checks passed
@koskimas koskimas deleted the object-filters branch July 14, 2023 05:32
Gaspero pushed a commit to Gaspero/kysely that referenced this pull request Oct 2, 2023
kysely-org#583)

* add object support for 'and' and 'or' functions. Closes kysely-org#344

* Update src/expression/expression-builder.ts

Co-authored-by: Igal Klebanov <[email protected]>

* Update src/expression/expression-builder.ts

Co-authored-by: Igal Klebanov <[email protected]>

* remove object filter site example for now

* fix github suggestion mistakes

---------

Co-authored-by: Igal Klebanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants