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

Microsoft.Data.Sqlite: Store char as TEXT #15020

Closed
bricelam opened this issue Mar 13, 2019 · 2 comments · Fixed by #15044
Closed

Microsoft.Data.Sqlite: Store char as TEXT #15020

bricelam opened this issue Mar 13, 2019 · 2 comments · Fixed by #15044
Assignees
Labels
area-adonet-sqlite breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@bricelam
Copy link
Contributor

Again, like #15019, it's probably too late, but I wish we could store char values as TEXT. This would make databases way more compatible with external systems.

Today, we store the UTF-16 character code as an INTEGER.

@bricelam
Copy link
Contributor Author

bricelam commented Mar 15, 2019

Use SQL like this to update existing databases.

UPDATE MyTable
SET CharColumn = char(CharColumn)
WHERE typeof(CharColumn) = 'integer';

@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 15, 2019
@bricelam
Copy link
Contributor Author

EF queries like this will be broken on existing databases:

var yeas = from v in db.Votes
           where v.Value == 'Y'
           select v;

bricelam added a commit that referenced this issue Mar 18, 2019
This also fixes some bugs in the relational char type mapping:
- LINQ constants converted to int produced the wrong literal
- Apostrophe char values weren't escaped (fixes #8764)

Resolves #15020
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview4 Apr 15, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview4, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-adonet-sqlite breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants