blinkdb icon indicating copy to clipboard operation
blinkdb copied to clipboard

Would it be possible to include substring filters?

Open ericvida opened this issue 2 years ago • 2 comments

The reason i'm trying blinikDB is to have fast queryable data in memory. I was sad to see no substring search filters.

I'd love to see something like the following

where: {
	prefix: "hell"
}
# returns hello

or

where: {
	substring: "no"
}

# returns: note, gnome, monosodium, etc.

Dexie.js has a function for prefix filtering, but no substring filter.

  • https://dexie.org/docs/WhereClause/WhereClause.startsWith()
  • https://dexie.org/docs/WhereClause/WhereClause.startsWithIgnoreCase()

ericvida avatar Dec 07 '23 10:12 ericvida

Like I briefly mentioned in #34, implementing this in BlinkDB would provide no performance benefit over

const users = (await many(userTable))
  .filter(u => u.startsWith("hell"));

I'm considering adding support for custom function filters in BlinkDB, which would also cover this case.

maradotwebp avatar Dec 11 '23 21:12 maradotwebp

Ok. Thank you.

ericvida avatar Dec 12 '23 04:12 ericvida