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

CultureInfo for date parameters #356

Open
MatthiasWeiser opened this issue Nov 3, 2016 · 2 comments
Open

CultureInfo for date parameters #356

MatthiasWeiser opened this issue Nov 3, 2016 · 2 comments
Labels

Comments

@MatthiasWeiser
Copy link

Description

Currently I am developing on German locale VS against a US locale Postgres database.
When querying for date values locally I can see that the dates in queries are translated with German locale which fails against the US postgres server. It would be nice if the locale for formatting dates and potentially other culture sensitive parameters could be set at startup with potentially using CultureInfo.Invariant as default

Repro steps

Use DB server and app machine with different locale.
Perform a query with a date field as parameter.

Expected behavior

Query works.

Actual behavior

Query fails.

Known workarounds

Use same locale on FSharp and DB machine.

Related information

  • Postgresql
  • Windows 10
  • .NET Runtime
@Thorium
Copy link
Member

Thorium commented Nov 3, 2016

I think that these kind of low-level implementation details how-to-turn .NET date to SQL-database date should be handled by the database driver and not SQLProvider. The database driver should use standard (ISO-8601) date format which is ok for all, but that shouldn't be SQLProvider's business. As well as converting decimals, to decide is "1,000" a thousand or one-point-zero-zero-zero. That is kind of the whole point of SQLProvider to not have to worry about type-mappings details.

Database parameters are strongly typed, SQLProvider should never do ToString() to parameters

@Thorium
Copy link
Member

Thorium commented Jul 21, 2017

There has been some problems with MySQL DateTime serialization, see if this helps: https://fsprojects.github.io/SQLProvider/core/mysql.html#System-DateTime-Serialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants