Manage graph spaces¶
When Studio is connected to NebulaGraph, you can create or delete a graph space. You can use the Console page or the Schema page to do these operations. This article only introduces how to use the Schema page to operate graph spaces in NebulaGraph.
Prerequisites¶
To operate a graph space on the Schema page of Studio, you must do a check of these:
- Studio is connected to NebulaGraph.
- Your account has the authority of GOD. It means that:
- If the authentication is enabled in NebulaGraph, you can use
root
and any password to sign in to Studio. - If the authentication is disabled in NebulaGraph, you must use
root
and its password to sign in to Studio.
- If the authentication is enabled in NebulaGraph, you can use
Create a graph space¶
-
In the toolbar, click the Schema tab.
-
In the Graph Space List page, click Create Space, do these settings:
- Name: Specify a name to the new graph space. In this example,
basketballplayer
is used. The name must be unique in the database.
- Vid Type: The data types of VIDs are restricted to
FIXED_STRING(<N>)
orINT64
. A graph space can only select one VID type. In this example,FIXED_STRING(32)
is used. For more information, see VID.
- Comment: Enter the description for graph space. The maximum length is 256 bytes. By default, there will be no comments on a space. But in this example,
Statistics of basketball players
is used.
- Optional Parameters: Set the values of
partition_num
andreplica_factor
respectively. In this example, these parameters are set to100
and1
respectively. For more information, seeCREATE SPACE
syntax.
In the Equivalent to the following nGQL statement panel, you can see the statement equivalent to the preceding settings.
CREATE SPACE basketballplayer (partition_num = 100, replica_factor = 1, vid_type = FIXED_STRING(32)) COMMENT = "Statistics of basketball players"
- Name: Specify a name to the new graph space. In this example,
-
Confirm the settings and then click the + Create button. If the graph space is created successfully, you can see it on the graph space list.
Delete a graph space¶
Danger
Deleting the space will delete all the data in it, and the deleted data cannot be restored if it is not backed up.
-
In the toolbar, click the Schema tab.
-
In the Graph Space List, find the space you want to be deleted, and click Delete Graph Space in the Operation column.
-
On the dialog box, confirm the information and then click OK.
Next to do¶
After a graph space is created, you can create or edit a schema, including: