objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

SQL like LIKE in query / regex

Open Hackmodford opened this issue 7 years ago • 4 comments

Does ObjectBox have the equivalent of the SQL LIKE keyword?

If it does not, I would like to add that as a feature request.

This was my solution for the problem in the meantime. If there is a better way to do this, I would like to know. https://stackoverflow.com/questions/51846019/does-objectbox-have-a-sql-like-keyword-equivalent

Thanks,

Hackmodford avatar Aug 14 '18 16:08 Hackmodford

We could take this further and support some simple regexes. Maybe powered by a small FSA lib (https://swtch.com/~rsc/regexp/regexp1.html), needs some research...

greenrobot avatar Aug 14 '18 20:08 greenrobot

I have a loop I use with my current DAO to search N fields for M terms -- doing this with objectbox seems impossible at the moment and something like a string-based regex would help a lot.

bigntallmike avatar Nov 27 '18 20:11 bigntallmike

Has this been implemented?

I need a way to add N .contains based on a loop and not sure of the best way to do this. Any ideas

Dreamystify avatar May 12 '19 06:05 Dreamystify

Can we please have something like -

Query<User> query = userBox.query().like(User_.firstName, "J*e?").build();
List<User> users = query.find();
query.close();

where results would include Joe, Je, Joel and Jooey

mihirjoshi21 avatar Jan 14 '22 03:01 mihirjoshi21