JsStore icon indicating copy to clipboard operation
JsStore copied to clipboard

Where over undeclared columns

Open jmdiazlr opened this issue 4 years ago • 2 comments

This could be a good feature for tables with many columns, some of them seldom filtered and not wanting to declare them for space minimization. dexie.js has this feature with the .filter() and other methods. Maybe a good thing could be a that the where must involve an declared (indexed) column before filtering by undeclared column.

I am no very good javascript to offer any help.

Thanks for this excellent library.

jmdiazlr avatar Nov 15 '20 13:11 jmdiazlr

I can understand the suggestion but whole point of indexeddb is that if you want to search something, put indexes so that searching becomes faster and JsStore implemented the same concept.

On the other hand , implementing your suggestion will be like adding more complexity both in size & learning in JsStore. I will see if i can implement this with small changes, so keeping this thread open until i have something.

ujjwalguptaofficial avatar Nov 16 '20 06:11 ujjwalguptaofficial

UPDATE - JsStore is created in such a way to use indexing & implementing this will have big changes. I need time to think what will be good way to implement without affecting other parts.

Keeping this thread open.

ujjwalguptaofficial avatar Mar 03 '21 02:03 ujjwalguptaofficial

Sorry for such a long time, i got busy with some other projects.

I have added this feature in jsstore, now where query can be performed on non indexed column if one of the column in where is indexed.

e.g -

select({
   from:'Customers',
   where:{
       name:'ujjwal',
      emailId:'[email protected]'
   }
})

here emailId is not indexed but name is.

This feature has been added in v - 4.4.1.

ujjwalguptaofficial avatar Aug 14 '22 17:08 ujjwalguptaofficial

If anyone is looking to query on all non Indexed column, then in this case store can be used.

You need to select all data from table and then use store to perform filtering and other queries.

ujjwalguptaofficial avatar Aug 14 '22 17:08 ujjwalguptaofficial