NebulaGraph Python Client  release-3.8
Session Class Reference
+ Inheritance diagram for Session:
+ Collaboration diagram for Session:

Public Member Functions

def __init__ (self, "Connection" connection, AuthResult auth_result, "ConnectionPool" pool, retry_connect=True, execution_retry_count=0, retry_interval_seconds=1)
 
def execute (self, stmt)
 
def execute_parameter (self, stmt, params)
 
def execute_json (self, stmt)
 
def execute_json_with_parameter (self, stmt, params)
 
def release (self)
 
def ping (self)
 
def ping_session (self)
 
def __del__ (self)
 
- Public Member Functions inherited from BaseExecutor
ResultSet execute_parameter (self, str stmt, Optional[Dict[str, Any]] params)
 
bytes execute_json_with_parameter (self, str stmt, Optional[Dict[str, Any]] params)
 
ResultSet execute (self, str stmt)
 
bytes execute_json (self, str stmt)
 
def execute_py (self, str stmt, Optional[Dict[str, Any]] params=None)
 

Detailed Description

Definition at line 28 of file Session.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
"Connection"  connection,
AuthResult  auth_result,
"ConnectionPool"  pool,
  retry_connect = True,
  execution_retry_count = 0,
  retry_interval_seconds = 1 
)
Initialize the Session object.

:param connection: The connection object associated with the session.
:param auth_result: The result of the authentication process.
:param pool: The pool object where the session was created.
:param retry_connect: A boolean indicating whether to retry the connection if it fails.
:param execution_retry_count: The number of attempts to retry the execution upon encountering an execution error(-1005), with the default being 0 (no retries).
:param retry_interval_seconds: The interval between connection retries in seconds.

Definition at line 29 of file Session.py.

Member Function Documentation

◆ execute()

def execute (   self,
  stmt 
)
execute statement

:param stmt: the ngql
:return: ResultSet

Definition at line 60 of file Session.py.

+ Here is the caller graph for this function:

◆ execute_json()

def execute_json (   self,
  stmt 
)
execute statement and return the result as a JSON bytes
    Date and Datetime will be returned in UTC
    JSON struct:
    {
        "results": [
        {
            "columns": [],
            "data": [
            {
                "row": [
                "row-data"
                ],
                "meta": [
                "metadata"
                ]
            }
            ],
            "latencyInUs": 0,
            "spaceName": "",
            "planDesc ": {
            "planNodeDescs": [
                {
                "name": "",
                "id": 0,
                "outputVar": "",
                "description": {
                    "key": ""
                },
                "profiles": [
                    {
                    "rows": 1,
                    "execDurationInUs": 0,
                    "totalDurationInUs": 0,
                    "otherStats": {}
                    }
                ],
                "branchInfo": {
                    "isDoBranch": false,
                    "conditionNodeId": -1
                },
                "dependencies": []
                }
            ],
            "nodeIndexMap": {},
            "format": "",
            "optimize_time_in_us": 0
            },
            "comment ": ""
        }
        ],
        "errors": [
        {
            "code": 0,
            "message": ""
        }
        ]
    }
:param stmt: the ngql
:return: JSON bytes

Definition at line 123 of file Session.py.

◆ execute_json_with_parameter()

def execute_json_with_parameter (   self,
  stmt,
  params 
)
execute statement and return the result as a JSON bytes
    Date and Datetime will be returned in UTC
    JSON struct:
    {
        "results": [
        {
            "columns": [],
            "data": [
            {
                "row": [
                "row-data"
                ],
                "meta": [
                "metadata"
                ]
            }
            ],
            "latencyInUs": 0,
            "spaceName": "",
            "planDesc ": {
            "planNodeDescs": [
                {
                "name": "",
                "id": 0,
                "outputVar": "",
                "description": {
                    "key": ""
                },
                "profiles": [
                    {
                    "rows": 1,
                    "execDurationInUs": 0,
                    "totalDurationInUs": 0,
                    "otherStats": {}
                    }
                ],
                "branchInfo": {
                    "isDoBranch": false,
                    "conditionNodeId": -1
                },
                "dependencies": []
                }
            ],
            "nodeIndexMap": {},
            "format": "",
            "optimize_time_in_us": 0
            },
            "comment ": ""
        }
        ],
        "errors": [
        {
            "code": 0,
            "message": ""
        }
        ]
    }
:param stmt: the ngql
:param params: parameter map
:return: JSON bytes

Definition at line 186 of file Session.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execute_parameter()

def execute_parameter (   self,
  stmt,
  params 
)
execute statement
:param stmt: the ngql
:param params: parameter map
:return: ResultSet

Definition at line 68 of file Session.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ping()

def ping (   self)
ping at connection level check the connection is valid

:return: True or False

Definition at line 302 of file Session.py.

+ Here is the caller graph for this function:

◆ ping_session()

def ping_session (   self)
ping at session level, check whether the session is usable

Definition at line 311 of file Session.py.

+ Here is the call graph for this function:

◆ release()

def release (   self)
release the connection to pool, and the session couldn't been use again

:return:

Definition at line 291 of file Session.py.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: