You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I enable history my app errors with "nSQL: Database not connected, can't do a query!"
When disabling history, the app works as expected.
I extracted a small example to demonstrate the issue...
I am using version 1.5.1
import{nSQL}from"nano-sql";nSQL('users').model([{key:'id',type:'int',props:['pk','ai']},{key:'name',type:'string'}]).actions([{name: 'createUser',args: ['name:string'],call: async(opts,db)=>awaitdb.query('upsert',{name: opts.name}).exec()}]).views([{name: 'allUsers',args: [],call: async(opts,db)=>awaitdb.query('select').exec()}]);asyncfunctiontest(history){awaitnSQL().config({
history
}).connect();constusers=nSQL('users');awaitusers.doAction('createUser',{name: 'bill'});awaitusers.doAction('createUser',{name: 'bob'});awaitusers.doAction('createUser',{name: 'jeb'});console.log(awaitusers.getView('allUsers'));}// when ENABLE_HISTORY === true -> nSQL: Database not connected, can't do a query!// when ENABLE_HISTORY === false -> everything works as expectedconstENABLE_HISTORY=true;test(ENABLE_HISTORY).catch(err=>console.error(err));
The text was updated successfully, but these errors were encountered:
When I enable history my app errors with "nSQL: Database not connected, can't do a query!"
When disabling history, the app works as expected.
I extracted a small example to demonstrate the issue...
I am using version 1.5.1
The text was updated successfully, but these errors were encountered: