-
Notifications
You must be signed in to change notification settings - Fork 18
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
Duration with values >= 24h #38
Comments
@Isitar - The main reason for choosing this type was so that queries would translate to SQL and just work with |
#38 - Adds verbiage to the documentation regarding the limitations of using the `Duration` type.
thanks for the update in the doc 👍 One option would be to store it as datetime2, this seems to work as long as the duration is less than a month i'm not sure if it really works with everything like dailight-saving, leap year etc. |
I am also running into this, my workaround will probably be to store the duration as INT4 (count of minutes) and handle mapping myself. From the NodaTime docs for Duration: "A duration is a length of time defined by an integral number of nanoseconds". While for many applications this is probably overkill, but I think a Duration should probably map to BIGINT since that will be pretty easy and support a large range of Duration values. In NodaTime, Duration's storage is implemented with two fields: Int32 days and Int64 nanoOfDay. Using ToInt64Nanoseconds (shown below) to map from Duration => BIGINT should give around +/-292 years of range with nanosecond resolution (as documented below). To read it back into a Duration use
|
Hello
Since your DataType for a Duration is
time
Values >= 24h are not supported.Do you plan on changing it or at least hint at it in the documentation?
The text was updated successfully, but these errors were encountered: