Sessions overview¶
A session is a consecutive series of interactions between a client and the NebulaGraph Database Developer Edition server-side. Sessions maintain the context between queries, which includes information such as session ID, username, client address, the default schema and graph, and time format settings.
The following sections cover how sessions are created, used, and closed in NebulaGraph Database Developer Edition.
Session initiation¶
A session is created when a user logs in to a Graph service in NebulaGraph Database Developer Edition. To successfully establish a session, the user must provide valid credentials, including a username and password. For more information, see Connect and run your first query.
Session customization¶
After a session is created, you can customize the session behavior as follows:
- Adjust the schema and graph set in the session.
- Add or delete parameters that take effect for all queries executed in the session.
For more information, see SESSION SET and SESSION RESET.
Session termination¶
A session is terminated in the following scenarios:
- The logged-in user explicitly closes the session by using SESSION CLOSE.
- The session is killed by the user with the role
ADMINby using KILL SESSION.
- The session times out after a period of inactivity.
- The Graph service is restarted or shut down.
Note
Apart from the preceding scenarios, the method to terminate a session varies depending on the client tool you are using. For example, when using ngql, you can enter :exit, :quit, or :q to terminate the session.