Closed MironAtHome closed 2 months ago
@MironAtHome If I understand correctly, when the extension is dropped, graph schemas are not dropped. And, you are expecting the graphs to be dropped automatically?
See if function age_graph_exists here helps
@rafsun42
If I understand correctly, when the extension is dropped, graph schemas are not dropped. And, you are expecting the graphs to be dropped automatically?
Not really.
All I am asking for is to expose as public function callable from Postgres database SQL layer the function that already exists in the Age code "graph_exists" so that I could put in my procedures, working with data loading an check
if not (age_graph_exists('
@MironAtHome I created PR #1958. Please let me know if that works for you.
Great thank you! I have commented for code review. Please take a look.
I noted PR was merged into master. Closing issue. Please see if you still can make adjustments based on comments.
@rafsun42 Updated function. Please see if changes in the code acceptable ( those are matching suggestions in the PR ).
1 It would be very helpful to have an function that could report a boolean, whether graph with name "xyz" exists, true or false. In addition, I am not sure, if an optional parameter to the same, or a separate function, that would produce something like "residual", that could potentially cause "create_graph" to fail. One of the reasons, when "drop extension if exists age" is performed, existing graphs are forgotten. To clean up those one need to run "drop schema cascade;"
Since internals of how graph is defined and stored in the database is really an private interface, it would be very nice to provide such a function, since details can potentially change from version to version, and it would be very helpful to graph user to have something like 'report_graph_residual()' with all the database objects related to the graph name, whether the graph itself considered existing or not at the moment.
2 Thinking of an ideal solution / alternate approach, having an overload of function cypher, that does not require graph name as the first parameter, but could accept something like "create graph ..." command, would be absolutely awesome, but that should not be taken either / or. The #1 is essential, #2 is a very nice language wise, to have a very concise was to express same query. Being very fond of cypher I thought it would be nice to add this to the ask, at least as in reverence to all the cypher language community.