drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
23.49k stars 577 forks source link

[feat] inArray and notInArray accept empty list #2502

Closed RemiPeruto closed 2 months ago

RemiPeruto commented 3 months ago

close https://github.com/drizzle-team/drizzle-orm/issues/1295

Make inArray and notInArray methods accept an empty list as their second parameter instead of throwing an error :

the comment referencing the choice of implementation in the thread

RemiPeruto commented 3 months ago

@philippdormann You reviewed the same changes back in march of this year in the MR https://github.com/drizzle-team/drizzle-orm/pull/1664 If it is still ok for you could you please approve my MR to merge those changes. Thanks a lot !

ThomasAribart commented 2 months ago

@RemiPeruto @AndriiSherman This PR would actually fix an issue in my project, could you review it please?

AndriiSherman commented 2 months ago

Thanks a lot! It looks great and is ready to merge. However, if you can resolve the conflicts, that would be helpful.

I can explain why there are conflicts and what should be done. Previously, all tests were separated by drivers, and now we have a *.common.ts file, for example, tests/pg/pg.common.ts, where all tests for pg are located and will be run in each driver automatically. There is no need to copy tests through all the files

RemiPeruto commented 2 months ago

@AndriiSherman thanks a lot ! I corrected the conflicts. Can you review please ?

RemiPeruto commented 2 months ago

@AndriiSherman Could you review it please ? It would be nice to have this feature. Like @ThomasAribart said, it will fix some issues in my project.

AndriiSherman commented 2 months ago

@RemiPeruto Could you please format all the files that you changed so they can pass dprint checks?

RemiPeruto commented 2 months ago

I am on it.

AndriiSherman commented 2 months ago

Going to make a few releases today. This one will be included