Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Matthew Khaw
    @mattkhaw

    @ujjwalguptaofficial actually, referring to my previous post, it's still not working. It only works when I initialize it without the worker, then i reinitialize it with a worker again but that's not the correct way.

    Anyways, thanks for your help. I guess I'll just wrap it in a web worker and call the web worker to execute the JsStore commands instead. That should do the trick right?

    Ujjwal Gupta
    @ujjwalguptaofficial
    should work @mattkhaw. Let me know your findings.
    Matthew Khaw
    @mattkhaw
    @ujjwalguptaofficial Sorry to bother you again, but I couldn't figure out what's wrong with the transaction API. I tried to use transaction but it just gives me an error stating, "start is not defined". I wonder what's missing.
    Matthew Khaw
    @mattkhaw
    @ujjwalguptaofficial never mind. I found out that I need to call it from the context itself.
    Robby
    @badgerblue
    Hello, I have a quick syntax question if anyone can help. I can't find the documentation.
    How do I "sortBy"? var results = await connection.select({ from: "Users", sortBy: "points", });
    Robby
    @badgerblue
    oops found it out. Thanks anyway
    Bernie Drahola
    @BernieDrahola_twitter
    Creating a new database with a bunch of tables goes like this: var database = {
    name: "database name",
    tables: [table1, table2, table3]
    } How can I add another table4 to it?
    Bernie Drahola
    @BernieDrahola_twitter
    I am getting this even though the table exists: {message: "Table 'LandkreisTable' does not exist", type: "table_not_exist"}
    message: "Table 'LandkreisTable' does not exist"
    type: "table_not_exist"
    This is with v2, not v3. Any ideas as to why the table shows as missing when trying to add records to it?
    Ujjwal Gupta
    @ujjwalguptaofficial
    @BernieDrahola_twitter v2 is deprecated, please update to v3. V2 problem can't be solved now.
    drstrangeglove
    @drstrangeglove
    Hi. I'm in the process of migrating a web app from webSQL to indexddb using jstore and sqlweb. I have found that if I have a number in a field/column name it doesn't work. So for example, one of the existing column names is 'image1', but this throws an error, whereas if I change it to 'imageone' then it is okay. Is it not possible to use a number in a field/column name?
    drstrangeglove
    @drstrangeglove
    Also it does not seem possible to have a number in a table name.
    Ujjwal Gupta
    @ujjwalguptaofficial
    @drstrangeglove there was issue with table name & column name in sqlweb. Its fixed now in latest version - 1.4.0.
    drstrangeglove
    @drstrangeglove
    Hi Ujjwal. Thanks for your quick reply. I have upgraded to 1.4.0 and it's all good now. Just to say thank you for your fantastic work. JsStore/SQLWeb has made the transition from WebSQL to IndexdDB much easier than it would otherwise have been.
    1 reply
    l388
    @l388
    I'm working with jsStore. Is there an example of backing up and restoring an indexed DB with jsStore,
    such as dumpToFile(dbName, ... ) and restoreFromFile (dbName, ... )
    7 replies
    ersaurabh101
    @ersaurabh101
    hello ujjwal how are you
    i am converting my project from ionic 3 to ionic 4
    Installing jsstore on ionic 4 is simple as explained in installation guide or is there anything special needed to be done ?
    1 reply
    Paolo-N
    @Paolo-N
    Hi everybody! Is there a way to set a boolean (as false) as default value in column?
    If I set a default true value everything is working fine, but is not working with default false value :(
    Paolo-N
    @Paolo-N
    Actually, whatever can be evalueted as false in javascript is not working as default value for a column
    1 reply
    Skymidt
    @Skymidt
    HI there. How to find by Boolean?
    Matthew Khaw
    @mattkhaw
    @Skymidt According to the documentation, you can't. If you need to find that specific column in your query, try to convert it to use number instead.
    Nitin Agrawal
    @ANitin_gitlab
    Hi There. I am Using Js Store in my project and I am building & deploying my project using Microsoft Azure. The Project builds with no error but after the deployment the project is showing some errors.. I am new here can you please help me in rectifying the issue.. I am also posted that issue on stackoverflow.https://stackoverflow.com/questions/64607506/uncaught-typeerror-i-connection-is-not-a-constructor
    Nitin Agrawal
    @ANitin_gitlab
    @ujjwalguptaofficial Hi can u please help me.
    2 replies
    Michael Budnick
    @mbudnick
    I will build an sql with "Where Column1 like '%someValue%' and Column1 like '%someAnotherValue%'.
    Is this possible?
    I tried "where = {Column1: [{like: '%someValue%'}, {like: '%someAnotherValue%'}]}" but this gives an error.
    3 replies
    Milad
    @miladmeidanshahi

    Hi, I have a column like this:

    defaultMachineId: {
          notNull: false,
          dataType: DATA_TYPE.String,
          default: null
     }

    When I update the column with a null value I get the error Supplied value for column 'defaultMachineId' have wrong data type and I can't use insert method with skipDataCheck I must use the update method.

    Why update method can't be null value?

    9 replies
    SpaghettiFactory
    @SpaghettiFactory
    Hello does anyone have a typescript example for a transaction? I'm following the example https://jsstore.net/tutorial/transaction/ but I get stuck on the start() function.
    2 replies
    John Baird
    @Xamlware
    Hi, I've followed the steps in your github repo for angular and have iimplemented the code. When initJsStore is called, my db is retrieved and I can seee the properties, but when initDb is called it never returns created always false. Then message saying "table Inventory" does not exist.
    John Baird
    @Xamlware
    Here is the link to my github repo: https://github.com/Xamlware/RsInvPro.git
    1 reply
    Ujjwal Gupta
    @ujjwalguptaofficial
    Screenshot from 2021-01-12 09-37-28.png
    Matthew Khaw
    @mattkhaw

    @ujjwalguptaofficial I might need some help. I was trying to retrieve records based on a group of dates. Not sure why it is not working with the latest version.

    Here's how I defined it in my schema:
    createdDate: { notNull: true, dataType: JsStore.DATA_TYPE.DateTime }

    However when I tried this where clause, { createdDate: new Date() }, it just retrieves everything.

    If I tried something like this, { createdDate: { in: [new Date(), new Date()] } }, it just returns me an empty result.

    Just substitute the new Date() variable to something like Date1, Date2 etc.

    Not sure what's going on here. Any advice on how to make this work?

    Matthew Khaw
    @mattkhaw
    @ujjwalguptaofficial Okay, I think I've found the issue, that way of retrieval won't work if you mix in other fields. It is only working on 1 field alone. I've tried them independently with something like this, { id: 1 } or { createdDate: new Date() }. If I combined them both like this, { id: 1, createdDate: new Date() } , then the query won't work. Not sure what's going on here.
    Ujjwal Gupta
    @ujjwalguptaofficial
    @mattkhaw i am also not sure, what's happening here. Could you provide me something reproducable.
    carper7
    @carper7
    I am testing one of the examples in jsstore and I am receiving the following error: formList.html:21 Uncaught TypeError: connection.addPlugin is not a function. I am testing it on a tablet. Everywhere I check for this error I can't find anything related. It would be nice to see real examples setting this up for using the jsstore. I want to have the sqlweb functionality in place to use sql on indexexDB stores. What am I missing? See code below taken from the wiki page at https://github.com/ujjwalguptaofficial/sqlweb/wiki.
    Matthew Khaw
    @mattkhaw
    @ujjwalguptaofficial sure, I'll try to do it within these few days. I'll update it on Github issues section.
    1 reply
    carper7
    @carper7
    I was using an old version of the jsstore.js file. Mr. Gupta pointed out this and as soon as I updated it with a recent copy, I got it to work. Thanks again.
    1 reply
    Ancient History Encyclopedia
    @ahencyclopedia_twitter
    Hi I'm new here. What an amazing tool!
    I just have one question. I'm trying to do a sort on an aggregated column, like this:
                        from: 'tags',
                        aggregate: {
                            count: 'tag'
                        },
                        groupBy: 'tag',
                        order: {
                            by: 'count(tag)',
                            sort: 'desc'
                        }
                    });
    However, order by 'count(tag)' doesn't work... how do you sort by an aggregated column?
    Thanks for your help!
    Ujjwal Gupta
    @ujjwalguptaofficial

    @ahencyclopedia_twitter right now its not supported, i have added an issue - ujjwalguptaofficial/JsStore#191

    please follow this one for fixes.

    kwlayman
    @kwlayman
    Is there someway to do a join query that will return rows not in a lookup table? Something like below is normal SQL way but JSStore seemingly won't take null in the where clause:
    1 reply
    SELECT ta.ID. FROM TableA ta.
    LEFT JOIN TableB tb ON ta.ID = tb.ID.
    WHERE tb.ID IS NULL
    Ancient History Encyclopedia
    @ahencyclopedia_twitter
    @ujjwalguptaofficial thanks a lot!
    Ancient History Encyclopedia
    @ahencyclopedia_twitter
    @ujjwalguptaofficial I saw that you already fixed it. Wow, that was fast. What's the syntax for sorting on an aggregated column, though? Because the code I posted above doesn't work in version 3.12.0.
    4 replies
    kwlayman
    @kwlayman
    Is there a way to set the next value of an autoincrement column?
    I see where it is stored in indexed db but can't find any method to access it.
    kwlayman
    @kwlayman
    My bad, connect.get/set is your friend!
    1 reply