fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
572 stars 146 forks source link

PostgreSQL Npgsql Versioning #188

Open ghost opened 8 years ago

ghost commented 8 years ago

It appears that NpgsqlTimeStamp does not exist in the nuget version of Npgsql 3.0.4. This means tables containing columns that use timestamp will drop columns. This is due to a combination of the behaviour of line https://github.com/fsprojects/SQLProvider/blob/master/src/SQLProvider/Providers.Postgresql.fs#L148 which filters out the type 'timestamp' (as it does not exist) and https://github.com/fsprojects/SQLProvider/blob/master/src/SQLProvider/Providers.Postgresql.fs#L423 which surpresses unknown types.

I suggest we either lock down SQLProvider to a specific Npgsql, or make the parsing of this more lenient.

Thorium commented 8 years ago

Is this fixed?

Thorium commented 7 years ago

If this is still issue, we can do

"timestamp without time zone", (if isLegacyVersion.Value
                                then namemap "NpgsqlTimeStamp"      ["Timestamp"]
                                else typemap<DateTime>              ["Timestamp"])