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: nvarchar field filtering bug for non-ascii characters #1441

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

mm74noroozi
Copy link

Description

in mssql when we want to filter non-ascii character we should use it in the format like:

select * from MyTable where name=N'سلام'

and if we use it like other ascii variables we get empty response

select * from MyTable where name='سلام'

Motivation and Context

in mssql it is impossible to query on non-ascii words

How Has This Been Tested?

I have added all test for charfield to this field also I have tested create and filter non-ascii chars

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

------
Added
^^^^^
- NVARCHAR non-ascii char support on mssql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add in 0.20.0 because which is not released yet

@@ -0,0 +1,5 @@
class NVARCHAR:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about NVarChar?

from tortoise.contrib.mssql.field_types import NVARCHAR


class NVARCHAR(CharField):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about NVarCharField?

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.

None yet

2 participants