What’s new in jsstore v3
1 min readMay 26, 2019
We have successfully launched new version of jsstore that is version3. Changes in version3 are —
- column define style : now columns in jsstore is an object which let you define the schema in simple & less code.
e.g -a table will be defined as :
```
var table1 = {
name: “table_name”,
columns: {
column1: { dataType: ‘datatype’, primaryKey: true },
column2 : { dataType: ‘datatype’},
….. ,
columnN: { dataType: ‘datatype’ }
}
}
``` - join define style : join can be done by using new property join in select query. Take a look at join doc — http://jsstore.net/tutorial/join/
- Init Db : createDb api has been removed with replacement of initDb. InitDb works similar to createDb with some optimization.
- Db Idle check : jsstore now checks for db idle & when it founds no db operation is being executed, it close it silently. When any query is called, it opens the connection silently & execute the operation.
- AutoIncrement column change : in v3 , jsstore does not generate the value of autoincrement when value is specified in column, this solves the upsert issue.
- Aggregate Query : aggregate query now returns one row. In v2, it was returning all rows.
- Optimization : All Query has been optimized for better performance.
If you are wondering how you can upgrade from v2 to v3, then dont worry v3 is completely compatible with v2. Just change your db schema in form of v3 & enjoy the new version.