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

Feature: add array operators #754

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

emmanuel
Copy link

@emmanuel emmanuel commented Dec 7, 2021

Adds new contArr and intersectsArr query operators, with the intersectsArr operator generating SQL queries like:

select ... where tags::text[] && ARRAY[$1,$2];

This selects rows where the tags column, which is presumed to be of type text[], contains at least one value that equals $1 or $2.

Fixes #687

Emmanuel Gomez and others added 2 commits December 6, 2021 12:40
Adds `$contArr` & `$intersectsArr` operators to filters that can be used as
filters on `@Crud()`-decorated entities.
@emmanuel
Copy link
Author

emmanuel commented Dec 7, 2021

We currently use this patch on top of 4.6.2. I'd be happy to open a PR for 4.6.x, if someone will create a branch I can use as a PR target.

@andrewvasilchuk
Copy link

Thank you. Is this going to be merged?

@BenStirrup
Copy link

Good initiative and indeed welcomed feature !
@michaelyali when you have time, could you review it ?

Copy link
Contributor

@bestori bestori left a comment

Choose a reason for hiding this comment

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

A small question


export type SFieldOperator = {
$eq?: SFiledValues;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this block ($eq?:... to notinL) marked deleted? Looks like an indent issue with your code editor of choice...?

Copy link
Contributor

@bestori bestori left a comment

Choose a reason for hiding this comment

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

Please merge with main or close :O)

@afilp
Copy link

afilp commented Nov 1, 2023

@emmanuel Hi, since this repo seems to be obsolete, can you please check the same PR code in the new (maintained) fork here?
gid-oss#19
gid-oss#21

If you wish I can delete my PR and you can create a new one there. (I created it there using your code because I was asked to)

Thanks a lot!

@afilp afilp mentioned this pull request Nov 1, 2023
19 tasks
zaro pushed a commit to gid-oss/dataui-nestjs-crud that referenced this pull request Nov 10, 2023
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.

Additional Support for Filtering on Varchar Arrays via Requests
5 participants