ujjwalguptaofficial / JsStore

A complete IndexedDB wrapper with SQL like syntax.
http://jsstore.net/
MIT License
849 stars 109 forks source link

How to convert data into another format and then query on the computed data #281

Closed ujjwalguptaofficial closed 2 years ago

ujjwalguptaofficial commented 2 years ago

Discussed in https://github.com/ujjwalguptaofficial/JsStore/discussions/279

Originally posted by **bilipan** August 8, 2022 Hi, everyone. I want to know how to perform like this: ```sql select DATE_FORMAT(create_date,'%Y%u') weeks, sum(total) countTotal from table_name where in_out=2 GROUP BY weeks order by weeks desc ``` Thanks in advanced.
ujjwalguptaofficial commented 2 years ago

i have added a new feature store in select api which will allow to pass data in store over which query can be executed. Basically store will be treated as tables data when passed.

select({
            store: customers,
            limit: 10,
            order: {
                by: 'country'
            }
        })

This feature is supported from v 4.4.0

ujjwalguptaofficial commented 2 years ago

Here is doc for store - https://jsstore.net/tutorial/select/store/