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

Fix like to be used as condition to generate valid sql #2039

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix like to be used as condition to generate valid sql #2039

wants to merge 1 commit into from

Conversation

registrs
Copy link

@registrs registrs commented Dec 10, 2020

Fixes #issue_number

Problem

Currently when using "like" there's an error: Incorrect syntax near the keyword 'like'
It generates: "...WHERE 1 = name like %?..." which causes the error on sql syntax (MSSQL)

Solution

Changed boolean to asConditon to make comparison with correct types, so sql would be valid

Checklist

  • Unit test all changes
  • Update README.md if applicable
  • Add [WIP] to the pull request title if it's work in progress
  • Squash commits that aren't meaningful changes
  • Run sbt scalariformFormat test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

@guersam
Copy link

guersam commented Nov 1, 2021

Having the same issue on SQL Server.

@guersam
Copy link

guersam commented Nov 1, 2021

Just opened #2297 including this change, but I'll happily rebase if this one gets merged first.

@CLAassistant
Copy link

CLAassistant commented Jan 24, 2022

CLA assistant check
All committers have signed the CLA.

@deusaquilus
Copy link
Collaborator

@registrs This looks right, thanks! Could you please add a test for this case in SqlDslSpec.scala, i.e. just verify the produced SQL string. Then I'll merge.

@registrs
Copy link
Author

registrs commented Feb 4, 2022

@registrs This looks right, thanks! Could you please add a test for this case in SqlDslSpec.scala, i.e. just verify the produced SQL string. Then I'll merge.

Hi, sorry but there's issue that I don't know how to add more commits for this pull request as this is very old commit and since then project stucture has changed - this commit has:

This commit does not belong to any branch on this repository.

So simplest way I guess would be to address adding test in separate pull request.

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.

4 participants