Menu

#224 Add new syntax to specify relative date, time and timestamp in dataset.

2.7.0
closed-accepted
None
5
2020-02-23
2019-03-04
Iwao AVE!
No

When defining dataset, it is a common requirement to specify date, time or timestamp that is relative to the current date/time.
Although it is already possible by using ReplacementDataSet, it requires users to declare and reference unique token for each value.
This is not ideal in some cases.

This proposal is to add new syntax to the following data types so that users can specify relative date/time directly in dataset.

  • DateDataType
  • TimeDataType
  • TimestampDataType

Here are a few examples of the proposed syntax:

  • [now] : current date time.
  • [now-1d] : the same time yesterday.
  • [now+1y+1M-2h] : a year and a month from today, two hours earlier.
  • [now+1d 10:00] : 10 o'clock tomorrow.

This proposal is based on the discussion with @jeffjensen .
https://sourceforge.net/p/dbunit/code.git/merge-requests/43/

The corresponding merge request under review:
https://sourceforge.net/p/dbunit/code.git/merge-requests/44/

Related

dbunit: 5c51c8c4860ca8723ac53c27

Discussion

  • Jeff Jensen

    Jeff Jensen - 2019-03-04
    • status: open --> pending
    • Release: (future) --> 2.6.1
     
  • Jeff Jensen

    Jeff Jensen - 2019-03-16
    • status: pending --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB