neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
485 stars 68 forks source link

Expose single record extraction utility to eager result #497

Closed fbiville closed 1 year ago

fbiville commented 1 year ago

I thought about @robsdedude arguments against introducing this and the one that resonated with me the most is: EagerResult has everything loaded in memory and Single is just a simple len(myEagerResult) == 1, so the added value is quite minimal.

On the other hand, Result does not have a known size and there is value in exposing Single which asserts there is exactly a single result left to consume.

I'll close this PR for now.