blinkdb-js / blinkdb

🗃️ An in-memory JS database optimized for large scale storage on the frontend.
https://blinkdb.io
MIT License
119 stars 10 forks source link

Would it be possible to include substring filters? #36

Open ericvida opened 11 months ago

ericvida commented 11 months ago

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.

maradotwebp commented 11 months ago

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.

ericvida commented 11 months ago

Ok. Thank you.