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

Add support for array values in where conditions #282

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

Tuarisa
Copy link
Contributor

@Tuarisa Tuarisa commented Dec 1, 2023

This commit adds support for array values in the where conditions of the database.js file. Previously, only single values were supported, but now, if the value is an array, the condition will use the = ANY operator instead of =. This change allows for more flexible querying options.

test/sql.js: Add unit test for array values in database.select

This commit adds a new unit test to the sql.js file. The test checks that the database.select method properly handles array values in the where conditions. It verifies that the method correctly returns the expected results when an array of values is provided as the condition for a specific property.

Note: The changes to imports and requires have been ignored in this commit message.

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

This commit adds support for array values in the `where` conditions of the `database.js` file. Previously, only single values were supported, but now, if the `value` is an array, the condition will use the `= ANY` operator instead of `=`. This change allows for more flexible querying options.

test/sql.js: Add unit test for array values in database.select

This commit adds a new unit test to the `sql.js` file. The test checks that the `database.select` method properly handles array values in the `where` conditions. It verifies that the method correctly returns the expected results when an array of values is provided as the condition for a specific property.

Note: The changes to imports and requires have been ignored in this commit message.
lib/database.js Outdated Show resolved Hide resolved
lib/database.js Outdated Show resolved Hide resolved
@tshemsedinov tshemsedinov merged commit b7e7f7a into metarhia:master Dec 1, 2023
4 checks passed
@tshemsedinov
Copy link
Member

@Tuarisa great start, see changes, and thanks!

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