JordanMarr / SqlHydra

SqlHydra is a suite of NuGet packages for working with databases in F# including code generation tools and query expressions.
MIT License
223 stars 22 forks source link

Missing oracle timestamp datatypes #64

Closed reaching-for-libra closed 11 months ago

reaching-for-libra commented 1 year ago

I'm noticing that when generating objects for an oracle table that includes timestamp columns, i'm not seeing the timestamp fields getting generated. Looking closer, i can see that fields' datatypes are e.g. TIMESTAMP(3) instead of TIMESTAMP, which is what the supportedTypeMappings in OracleDataTypes.fs would expect

Looking at the link included below, and grabbing samples out of the a default EBS oracle database (version 19c), it looks like:

TIMESTAMP TIMESTAMP WITH LOCAL TIME ZONE TIMESTAMP WITH TIME ZONE INTERVAL DAY TO SECOND

will be identified as having types

TIMESTAMP(x) .. where x can be a value between 0 and 9 TIMESTAMP(x) WITH LOCAL TIME ZONE .. where x can be a value between 0 and 9 TIMESTAMP(x) WITH TIME ZONE .. where x can be a value between 0 and 9 INTERVAL DAY(x) TO SECOND(y) .. where x and y can each be a value between 0 and 9 (not necessarily the same)

You can read more about it here: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330

CLOB and NCLOB are also some string fields that are omitted in the supported types map. i suppose there may be some others, but these are some i'm running across while working on a poc at the moment.

JordanMarr commented 1 year ago

So the issue is that you have a TIMESTAMP(3) column that Is not added to the generated properties?

reaching-for-libra commented 1 year ago

yea, that's one particular example I ran into. depending on the table definition, it could have been TIMESTAMP(0), or TIMESTAMP(1), and so on up through TIMESTAMP(9). also, I had edited the last comment to also call out CLOB and NCLOB types as well.

JordanMarr commented 1 year ago

Types have been added in SqlHydra.Cli v2.1.1.

reaching-for-libra commented 1 year ago

thanks for the quick turnaround! i'll give it a spin after release

JordanMarr commented 12 months ago

It is released here: https://www.nuget.org/packages/SqlHydra.Cli/2.1.1