Skip to content
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

Smarter autocomplete #1828

Open
JefWight opened this issue Sep 22, 2022 · 1 comment
Open

Smarter autocomplete #1828

JefWight opened this issue Sep 22, 2022 · 1 comment

Comments

@JefWight
Copy link

Description

When writing a query in the browser, filter autocomplete suggestions down to valid values based on the database schema.

Reproduce Steps

Using the sample Movie DBMS, start typing "MATCH (:Movie)-(:". Upon typing ":" autocomplete pops up suggestions:
image

Unfortunately, not all of the suggestions are valid. We can see this with a db.schema.visualization() call:
image

FOLLOWS is only ever found in the db between (:Person) nodes.

Same issue applies to property names:
image

This issue obviously affects databases with a large number of Labels, RelationshipTypes, and distinct Properties far worse than something as simple as the Movies DB.

Sidenote, there may also be a simpler bug with single letter variables when plugins like apoc are installed:
image

Can you propose a solution?

First part would be to make the metaQuery (currently in dbMetaDuck.ts) return something more like the db.schema.* function responses where relationships and properties contain metadata about valid nodes/labels.

The second (more extensive) part requires a change in neo4j-contrib/cypher-editor.

Additional Information

Was mentioned at the end of #135.

@OskarDamkjaer
Copy link
Contributor

Thanks for taking the time to do such a detailed write-up!

There are currently limitations in the db.schema (not always 100% correct, no node/rel properties) and the cypher-editor support (outdated parser, poorly maintained code) that make make perfect completion impossible.

But we shouldn't let perfect be the enemy of good (or decent in this case), so we're currently working on renewing the cypher-editor repo and pushing for improvements in the schema methods. So we're working on it but the more extensive changes will take time

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

No branches or pull requests

2 participants