ujjwalguptaofficial / JsStore

Simplifying IndexedDB with SQL like syntax and promises
http://jsstore.net/
MIT License
859 stars 110 forks source link

Update interfaces.ts to address keypath issue #378

Closed RohitM-IN closed 2 weeks ago

RohitM-IN commented 2 weeks ago

This PR solves #377

According to the docs if we follow and create the table similar to https://jsstore.net/docs/keypath

it will give us type error for select query because of this

connection.select({
    from: 'cities',
    where: {
        cityPincodes: ['london',12345] // order of values should be same as what has been defined in keyPath
    }
})

here the where is of type IWhereQuery or IWhereQuery[]

here is the problem

the type IWhereQueryshould include any[] as well to support the above select query

type IWhereQuery = Record<string, IWhereQueryOption | string | number | boolean | any[]> | {
    or?: IWhereQuery;
};
ujjwalguptaofficial commented 2 weeks ago

Thanks @RohitM-IN for the PR.