Zaid-Ajaj / Npgsql.FSharp.Analyzer

F# analyzer that provides embedded SQL syntax analysis, type-checking for parameters and result sets and nullable column detection when writing queries using Npgsql.FSharp.
MIT License
137 stars 9 forks source link

Question: Big (Small) Integer handling #33

Closed dbrattli closed 3 years ago

dbrattli commented 3 years ago

Describe the bug

Hi @Zaid-Ajaj. How do we want to deal with integers of different size? Currently the parser cannot parse BigInt i.e int64 since the integer parser uses pint32. I can fix this but there are some choices:

  1. let Expr.Integer be of int64 so it can hold all kinds of integers.
  2. or we can add new types BigInt (and SmallInt). But then an array of integers might be parsed to different integer types depending on their size e.g select array [0,54795035045033];. Not sure if this is really a problem.
  3. Get rid of Expr.Integer / Expr.Float and instead parse everything to Numeric/Decimal.

Any opinions or preferences for what we should do here?

Zaid-Ajaj commented 3 years ago

Hi @dbrattli

let Expr.Integer be of int64 so it can hold all kinds of integers.

This sounds like the easiest/best solution.

dbrattli commented 3 years ago

Thanks. I see it also matches the use of float which is the same as double in .NET. Have updated the PR.

Zaid-Ajaj commented 3 years ago

Awesome stuff @dbrattli 😍 thanks a lot 🙏 I will make some time to merge and publish soon 🚀

dbrattli commented 3 years ago

@Zaid-Ajaj to reduce your workload then it's fine with me if you merge without publishing (every time). Then you can publish at your own cadence. I just want to get the current changes out of the way before starting with other changes.