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

[Question] Specify the type of generated field for SQLite TEXT columns #761

Open
Peluko opened this issue Mar 4, 2022 · 1 comment
Open

Comments

@Peluko
Copy link

Peluko commented Mar 4, 2022

I'm working with a SQLite database that contains some data that needs decimal precision (basically money amounts). In order to keep precision, this data is saved on a TEXT column on SQLite and actually mapped to a decimal when working with EF Core on C# (EF Core does this mapping automatically when using Code First approach).

I'm playing with F# now, and I've found that SQLProvider maps those columns to string (as expected). Is there any way to tell SQLProvider to map selected columns to decimal instead of string?

@Thorium
Copy link
Member

Thorium commented Nov 14, 2022

Hi,

I don't think so, but I think you can use cast in your SQL-query like for i in myTable do where ((decimal i.x) > 3m) select i and if SQLite can handle the conversion, then it could work. However, I expect your problem in SQL side is then that you do text comparisons like "11" < "2" ?

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

No branches or pull requests

2 participants