Company
Date Published
Author
Antonio Henrique
Word count
1105
Language
English
Hacker News points
None

Summary

The new Neo4j Driver for Javascript version 5.14 now supports querying Neo4j using Deno natively, thanks to a contribution from Braden MacDonald who created a tool to automatically generate Deno source code from the existing driver code. The generated code was adapted and submitted to the same acceptance test suite as the Node version of the driver, resulting in a new network layer that uses Deno native sockets for better performance and stability. To query Neo4j from Deno, users must first import the driver from the repository in their Typescript/Javascript file, and Deno will take care of downloading and installing the dependencies. The most straightforward way to run a query is using the Driver.executeQuery API, which provides a cluster-safe way to execute a single query transaction. Users can also use the Session.executeRead and Session.executeWrite APIs to manage transactions for different needs. A new scenario where data is sent from Neo4j to an external service to calculate credit scores has been demonstrated, showcasing how Deno's asynchronous iteration over records can be used to process data as it arrives. Additionally, support for explicit resource management was added to the driver in version 5.15.0, reducing boilerplate related to Driver and Session objects usage since the using keyword can replace close method calls. Users are encouraged to try out the new Deno driver and provide feedback on GitHub.