tforkmann / Fumble

Thin F# API for Sqlite for easy data access to sqlite database with functional seasoning on top
https://tforkmann.github.io/Fumble/
MIT License
97 stars 2 forks source link

SqliteRowReader float only parses float32 #24

Closed wavewizard closed 2 years ago

wavewizard commented 2 years ago

Example type Type T = {Width t : float}

... |> Sqlite.execute (fun read -> { {Width = read.float "Width"}

gives

Type constraint mismatch. The type 'float32'
is not compatible with type 'float'

tforkmann commented 2 years ago

Hi @wavewizard,

Thanks for your issue. I will tryi to fix that by the end of day.

Cheers, Tim

wavewizard commented 2 years ago

Thank you for the library, I like the design and its simplicity. Will be using it

tforkmann commented 2 years ago

Actually it is already implemented. You have to use read.double then you will read the correct type of float.

Microsoft.Data.Sqlite is using double as well therefore I named it the same way.

Let me know if that works for you

wavewizard commented 2 years ago

It works

what do you think implementing changing SqlightRowReader.float to float32 and adding float that parses double?
I can create a PR for that if you want. Cheers

tforkmann commented 2 years ago

Yes, that sounds good. Feel free to create a PR for that. If not I will do it tonight. Cheers

tforkmann commented 2 years ago

Implemented and released. Let me know if you need something else. Cheers