Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update interfaces.ts to address keypath issue #378

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

RohitM-IN
Copy link
Contributor

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 IWhereQuery should include any[] as well to support the above select query

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

@ujjwalguptaofficial ujjwalguptaofficial merged commit 55f7119 into ujjwalguptaofficial:master Nov 1, 2024
2 of 3 checks passed
@ujjwalguptaofficial
Copy link
Owner

Thanks @RohitM-IN for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants