Docs: CREATE GRAPH page says `USE my_graph`, but the working statement is `USE GRAPH my_graph`

Open Beginner friendly
#1,542 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown
Domain
documentation

Research direction

Open the CREATE GRAPH documentation page linked in the issue and find the two examples that use USE my_graph;. Change them to USE GRAPH my_graph; and explain that USE GRAPH main returns to the default graph. Also document that the current graph is shared across connections on a Database; consider the repository test test/test_files/graph/typed_subgraph.test as a reference. Done when the examples and sharing behavior are accurate.

Written by the indexing model from the issue text.

Description

Description

The CREATE GRAPH page gives USE my_graph; both for switching into a new subgraph and in its "Switch between subgraphs" section. On @ladybugdb/core 0.22.3 and 0.23.0-dev.20261105 (Node binding run under Bun 1.4.4, macOS arm64 and Linux arm64), that statement fails:

CREATE GRAPH my_graph   -> Created graph successfully.
USE my_graph            -> Runtime exception: No database named my_graph.
USE GRAPH my_graph      -> Used graph successfully.

USE name resolves an attached database (DatabaseManager::setDefaultDatabase), not a subgraph. The repository's own test, test/test_files/graph/typed_subgraph.test, uses USE GRAPH typed_ka and returns with USE GRAPH main.

Suggested change: use USE GRAPH my_graph; in both places, and document USE GRAPH main as the way back to the default graph. It would also help to say that the current graph is shared by every connection on a Database (see the related bug report), since a reader of this page would likely assume it is per connection.

Link

https://docs.ladybugdb.com/cypher/data-definition/create-graph/

Dominant language
C++
Stars
1.8k
Forks
148
Avg merge
1d 13h
Merged PRs (30d)
176

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LadybugDB/ladybug

All issues in LadybugDB/ladybug

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.