Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    ersaurabh101
    @ersaurabh101
    Please help in achieving the same in right manner.
    ersaurabh101
    @ersaurabh101
    • if any service [checking update from table] is simply running and at that time i press logout button [ on pressing i wanna delete db], it gets corrupted
    Ujjwal Gupta
    @ujjwalguptaofficial
    If you can provide me something reproducable, i can look. May be a demo or a link to ur project.
    ersaurabh101
    @ersaurabh101
    hii ujjwal, on further investigation, if i can kill ongoing request queue in db and then execute db deletion, it will work. Can you navigate me to a script which stops / kills all ongoing requestQueue
    So its like if there are ongoing requestQueue and we try to delete db, it gets corrupted. We must stop them and then delete. Hope this helps
    Ujjwal Gupta
    @ujjwalguptaofficial
    you have called those api, which means you want to execute it. So its like anti pattern approach.
    and most important thing - when you are logging out, you dont need to drop the db. You can just remove all data from table using clear api. http://jsstore.net/tutorial/clear/
    ersaurabh101
    @ersaurabh101
    alright, noted. Working on this, will let you know soon, thanks
    ersaurabh101
    @ersaurabh101
    tested,actually in background app (services) checks for new messages, so even after clearing data it is still inserting, need to stop ongoing Queue if any, is there any way
    Ujjwal Gupta
    @ujjwalguptaofficial
    i m sorry but this is not possible. You have the full control over the api call, you need to change your app in such a way that it wont insert data when logging out . I mean something which will tell background app to not insert data.
    ersaurabh101
    @ersaurabh101
    exactly, this is what i want to do, if there is ingoing queue while logging out, i want to stop that queue or wait to logout till that queue is completed and deleted by me.
    Ujjwal Gupta
    @ujjwalguptaofficial
    ok cool, i got you. I will create an api which will let you know whether requestQueue is empty or not.
    Better if you can add an issue on github. Thanks.
    ersaurabh101
    @ersaurabh101
    i will add it, hope you can provide the solution soon as my app is all set
    Ujjwal Gupta
    @ujjwalguptaofficial
    sure

    since you are in hurry, so here is a hack -

    var isNoRequest =  con.requestQueue_.length===0;

    here con is the connection

    you can wrap the above code in a setTimeOut with some time & check. Hope this will help you.

    ersaurabh101
    @ersaurabh101
    i'll try and get back
    Ujjwal Gupta
    @ujjwalguptaofficial
    @ersaurabh101 - i have added events functionality now. Using the event you can know when there is no request. Take a look at doc - http://jsstore.net/tutorial/event/
    ersaurabh101
    @ersaurabh101
    hii, i'll use it and get back, encountered 1 major problem
    after using jsstore i am unable to make production builds
    npm run build --prod
    it gives this error -
    2019-07-26_10h53_59.png
    Ujjwal Gupta
    @ujjwalguptaofficial
    cant help, its an issue with building.
    ersaurabh101
    @ersaurabh101
    i understand, but issue comes when we use jsstore
    after removing issue disappears
    ersaurabh101
    @ersaurabh101
    if i dont make --prod then it opens very slow, please help.
    ersaurabh101
    @ersaurabh101
    hii
    please ping me when you have 5 mins
    will show you the problem i am facing
    KirandeepKaur190
    @KirandeepKaur190
    How to use select and check count in select using jsstore.
    Please help.
    How to combine both in one statement?
    Any example will be helpful.
    Ujjwal Gupta
    @ujjwalguptaofficial
    Hi @ersaurabh101 , let's chat in private
    @KirandeepKaur190 , you can use two query for this. Why are you thinking about executing in one query ?
    Ujjwal Gupta
    @ujjwalguptaofficial
    Are you thinking - it will take less time if you will do it in one query ? Let me know.
    KirandeepKaur190
    @KirandeepKaur190
    This is required for my table structure. I want to use following query using jsstore :-
    SELECT USERNAME, COUNT(*) FROM MYTABLE WHERE USERNAME = LOGGEDINUSER.
    How can use this?
    Ujjwal Gupta
    @ujjwalguptaofficial
    Jsstore is an indxeddb wrapper & indexeddb is nosql database . So you cant do something like that
    use select query which will give list of results and then you can get the length for count
    Check this example of your scenario
    var results = select({
        from: MyTable,
        where: {
            userName: some_value
        }
    });
    
    var count = results.length;
    var usersName = results.map((result) => {
        result.userName;
    });
    hope this helps
    nitrid
    @nitrid
    hi
    how to table drop ?
    Ujjwal Gupta
    @ujjwalguptaofficial
    Hi
    do you want to clear a table or just remove it from db ?
    Ujjwal Gupta
    @ujjwalguptaofficial
    You can clear it & after that its just a container. And if you want to remove it completely , please add an issue & i will take it from there.
    nitrid
    @nitrid
    i just want to remove the table from within the db.