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

feat: support regex syntax #700

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mo-solutions
Copy link

  1. Regular Expression Handling (Lines 734-742):
  • Before the change: The code checks if the operator is regexp and if the expression is already an instance of RegExp. If it is, the code leaves it unchanged.
  • After the change: The code adds a check to handle cases where the expression is not an instance of RegExp but is a string that looks like a regular expression (starts with /). It extracts the pattern and flags from the string and converts it into a RegExp object.

Why it might be necessary: This ensures that expressions that are intended to be regular expressions but are passed as strings are correctly converted into RegExp objects before being used. This is important for proper query execution when using regex-based conditions in a PostgreSQL database.

  1. Object to String Conversion (Lines 801-803):
  • New Code: This addition checks if the value is an object and an instance of String. If so, it converts it to a primitive string by appending an empty string (+ "").

Why it might be necessary: This conversion ensures that any String object (which is an object wrapping a string) is converted to a primitive string, which is the expected format when working with SQL. This prevents possible issues or errors when the SQL query is executed with the value.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

Gentlemen Luke Truncatinson Montague-Rose:
ten jie implementino kazkoki papildoma funkcionaluma
custom query (LT)

Signed-off-by: mo-solutions <[email protected]>
Signed-off-by: mo-solutions <[email protected]>
Signed-off-by: mo-solutions <[email protected]>
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.

1 participant