Skip to content

[WIP] Query API first steps #897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

OskarDamkjaer
Copy link
Contributor

@OskarDamkjaer OskarDamkjaer commented May 17, 2024

What we did, commit by commit

inline use-neo4j

Copy pasted the use-neo4j library and removed everything we weren't using neodash.

bump the driver

Bumped the driver to 5.12.0 and re-did some of the reverted compat changes

use new driver

We removed the driver dependency completely and copy pasted in the experimental driver with Query API support that @bigmontz from the drivers team has made. We checked out the 5.x-experimental-http-scheme branch, installed dependencies, ran the build command and then copied the standalone file packages/neo4j-driver-lite/lib/browser/neo4j-lite-web.esm.js and then updated the import paths. In the future we'd not need to do this, we'd depend on the code via npm

proof of concept

We hardcoded the protocol to be HTTP. We tried using the new driver and got it to work o.k. for some data types. We ran into a couple of limitations:

  • We had to replace the transaction commands with session.run
  • The timeout option for session.run was not available
  • We didn't get nodes/rels/paths to work, because identity was not available, only elementId

inject HTTP driver experimental package

Replace inlined driver-lite with npm package

Migrate to elementId

  • Migrate to identity to elementId (except in rel edit)
  • Add http as an option in the scheme dropdown - Note : the others are now working for now as it only includes the experimental HTTP driver, and not the "other drivers"

For testing the query api with a real database, we downloaded neo4j 5.19.0 and set server.http_enabled_modules=BROWSER,QUERY_API_ENDPOINTS,TRANSACTIONAL_ENDPOINTS in the neo4j.conf file.

Still to todo on the neodash side

  • UI affordance to select HTTP in some sustainable way (including making sure we get the right ports, and make sure people understand the limitations)
  • Verifying that the driver update isn't breaking anything
  • Doublecheck driver usage to make sure we're not using any other unimplemented functions
  • Make sure we always pass a database name. Either by making it mandatory in the form when http is used, or though SHOW DATABASES things. You can always run SHOW DATABASES against the system database.
  • Try out the other codepaths that lead to creating drivers/querying cypher. We only really tried the dashboard panels
  • Verify that the data types for the new driver are still correct when using HTTP
  • verify canceling queries
  • Migrate to elementId for EditUtils
  • Fix Map chart

@mariusconjeaud mariusconjeaud changed the title Query API first steps [WIP] Query API first steps May 17, 2024
Copy link

sonarqubecloud bot commented Jun 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants