Closed johannessen closed 9 months ago
The methods for Point, DateTime, and Duration are complete as well. However, I see two problems that still remain to be solved:
DateTime and Duration are not released on CPAN yet. They will be part of Neo4j::Types v2. To get the code to compile and make the tests pass anyway, the modules here in perlbolt include these two as private packages, which is a bit of an ugly hack that should be removed once Neo4j::Types v2 is released.
There is no capability yet in CTypeHandlers.xs for accepting generic Neo4j::Types values and converting them into the neo4j_*
types. Since Point, DateTime, and Duration may be used as query parameters, this needs to be added to SV_to_neo4j_value().
Basically, if the given SV is blessed, we need to call the DOES()
method to see if the SV performs one of these roles (instead of sv_isa()
; note that sv_does() would not be correct here). If the SV does perform one of these roles, we need to call its methods to determine the value (instead of hv_fetchs()
etc.).
We could keep the current code around as a small optimisation for Neo4j::Bolt types, or alternatively we could remove the current code to simplify future maintenance.
Bytes, DateTime, Duration, and Point are complete and ready to be merged into feat-v5.0
.
This PR is supposed to make the feat-v5.0 branch compliant with the proposed Neo4j::Types v2 interface.
The methods for accessing the element ID are complete.
(See "element_id" in N:T:Node and "Node" in N:T:ImplementorNotes for the specification, and neo4j-types #13 + #3 for the rationale. Even though I have now made a decision for Neo4j::Types, of course I will always keep the door open to revisit it. If you disagree with me, I’d love to consider your thoughts.)
The availability check currently uses
eq
, as discussed earlier. A simpler way to avoideq
might be to move this check to XS and look at the PV/IV flags instead. But this is just about performance – the code works fine as it is.