Skip to content

Conversation

monoruz
Copy link

@monoruz monoruz commented Jul 28, 2023

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.

2 participants