Driver¶
Driver Class¶
- class gs_interactive.client.driver.Driver(admin_endpoint: str | None = None, stored_proc_endpoint: str | None = None, cypher_endpoint: str | None = None, gremlin_endpoint: str | None = None)[source]¶
The main entry point for the Interactive SDK. With the Interactive endpoints provided, you can create a Interactive Session to interact with the Interactive service, and create a Neo4j Session to interact with the Neo4j service.
- __init__(admin_endpoint: str | None = None, stored_proc_endpoint: str | None = None, cypher_endpoint: str | None = None, gremlin_endpoint: str | None = None)[source]¶
Construct a new driver using the specified endpoints. If no endpoints are provided, the driver will read them from environment variables. You will receive the endpoints after starting the Interactive service.
- Parameters:
admin_endpoint – the endpoint for the admin service.
stored_proc_endpoint (str, optional) – the endpoint for the stored procedure service.
cypher_endpoint (str, optional) – the endpoint for the cypher service.
- getNeo4jEndpoint() str [source]¶
Get the bolt endpoint from the service status endpoint. Only works if the sdk was running in the same pod as the service.
- getNeo4jSession(**config) Session [source]¶
Create a neo4j session with the specified endpoints. :param config: a dictionary of configuration options, the same as the ones
in neo4j.Driver.session
- read_endpoints_from_env()[source]¶
Construct a new driver from the endpoints declared in environment variables. INTERACTIVE_ADMIN_ENDPOINT: http://host:port INTERACTIVE_STORED_PROC_ENDPOINT: http://host:port INTERACTIVE_CYPHER_ENDPOINT: neo4j://host:port or bolt://host:port