stellasia / neomap

A Neo4j Desktop application to visualize nodes with geographic attributes on a map.
GNU General Public License v3.0
106 stars 13 forks source link

Allow selection of database #86

Closed taseroth closed 2 years ago

taseroth commented 3 years ago

Not sure if this is part of the Neo4j Desktop API, but selecting/choosing the database to use would be really helpful. In the moment, I can only use the default database 'neo4j'.

Beside that: great work. I really like NeoMap.

nikita03565 commented 2 years ago

Sharing results of my research:

  1. we can retrieve a list of available databases using query: const databases = (await session.run("SHOW DATABASES")).records image in this example i have 3 dbs: neo4j, system and test

  2. we can "switch" between databases at the moment when we create a session: const session = driver.session({database: "test"});

This should be fairly easy to implement

nikita03565 commented 2 years ago

@stellasia what do you think of adding Settings button into navbar that launches a modal? image

stellasia commented 2 years ago

Looks really good!

When first seeing this issue, I was thinking about configuring the database per layer, but it would maybe make overload the layer configuration.

@taseroth , do you have a use case where you would need to overwrite a globally set database? (like comparing data in several dbs?)

nikita03565 commented 2 years ago

hmm when i first realized that i miss this functionality i def was thinking about global db selection. like i have db with data for Moscow and other db with data for New York, and i want to switch between two cities and work with one of them exclusively at the moment

not arguing, just trying to understand how to implement this: globally/per layer/both?

stellasia commented 2 years ago

I am ok with the global setting, I think it is cleaner and probably less misleading.

If we realize there is a real use-case, we can still add the ability to overwrite the global setting in the layer later on.

nikita03565 commented 2 years ago

was addressed in https://github.com/stellasia/neomap/pull/100