Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The earlier recommendation to use the DateTime modules that already exist on CPAN didn’t take into account that Neo4j defines multiple distinct temporal instant types. Using the DateTime module means that clean roundtrips aren’t possible.
The original proposal in perlbolt’s feat-v5.0 branch isn’t bad, but follows the Bolt protocol spec very closely, which is not a good match for Jolt v1/v2. It also requires 64 bit integers.
This proposal is close to the Bolt spec, but cleanly separates dates and times in order to accommodate Jolt. The resulting numbers are smaller, which should make it work fine even on 32 bit Perls, which are getting rare but they do still exist.
There are two points to note in this proposal:
The methods are defined such that the Neo4j type can be determined by simply looking at which value components are missing. For example, if the time component (
seconds
) is missing in a temporal instant value, it must be a value of typeDATE
. The resulting set of methods gives a good amount of flexibility in the data structure.The role is separated from the generic implementation. This should make the goal of using roles easier to understand. It may also make it easier for implementors to write new classes performing the role, because the required interface is smaller.