Skip to content
Developer Edition runs on one host and does not require a product license file. Need multi-host deployment or performance testing at scale? Explore Enterprise Edition

Deprecated

This command has been deprecated. Please use ALTER USER SET HOME_GRAPH to set the home graph for the current user.

SET USER GRAPH command

The SET USER GRAPH command sets the home graph for the current user.

To set the graph for the current session, use SESSION SET.

Syntax

set_user_graph_command
SET USER GRAPH schema_reference / graph_name

set_user_graph_command ::=
    'SET' 'USER' 'GRAPH' (schema_reference '/')? graph_name

Parameters

schema_reference

The reference to the path of the schema. It specifies the schema path of the graph to be set as the home graph for the user.

Both absolute and relative schema paths can be used in the command. To set a graph that resides outside the schema in the current session as the home graph, the schema path must be specified. For information about setting and viewing the schema for the current session, see SESSION SET and SHOW CURRENT_SCHEMA.

graph_name

The name of the graph to be set as the home graph. The name is case-sensitive and must match the name of an existing graph. You can use CREATE GRAPH to create a graph.

Examples

Set the graph in the current schema as the home graph

'''
// Create a graph type
CREATE GRAPH TYPE IF NOT EXISTS home_graph_type AS {}
'''

'''
// Create a graph
CREATE GRAPH IF NOT EXISTS homegraph TYPED home_graph_type
'''

'''
// Set the home graph for the current user
SET USER GRAPH homegraph
'''

Set the graph in the specified schema as the home graph

'''
// Create a graph type
CREATE GRAPH TYPE IF NOT EXISTS home_graph_type AS {}
'''

'''
// Create a graph
CREATE GRAPH IF NOT EXISTS homegraph TYPED home_graph_type
'''

'''
// Create a schema
CREATE SCHEMA IF NOT EXISTS /my_schema
''' 

'''
// Set the schema for the current session
SESSION SET SCHEMA /my_schema
'''

'''
// Set the home graph for the current user
SET USER GRAPH /default_schema/homegraph
'''

More information

  • To view the information about the current user, use SHOW CURRENT_USER.
  • To view the information about all users who are invited to the current service group, use SHOW USERS.
  • To view the information about the current session, use SHOW CURRENT_SESSION.
  • To view the information about all sessions, use SHOW SESSIONS.