Skip to main content

gqlalchemy.connection

Connection Objects

class Connection(ABC)

execute

@abstractmethod
def execute(query: str, parameters: Dict[str, Any] = {}) -> None

Executes Cypher query without returning any results.

execute_and_fetch

@abstractmethod
def execute_and_fetch(
query: str,
parameters: Dict[str, Any] = {}) -> Iterator[Dict[str, Any]]

Executes Cypher query and returns iterator of results.

is_active

@abstractmethod
def is_active() -> bool

Returns True if connection is active and can be used.

MemgraphConnection Objects

class MemgraphConnection(Connection)

execute

@database_error_handler
def execute(query: str, parameters: Dict[str, Any] = {}) -> None

Executes Cypher query without returning any results.

execute_and_fetch

@database_error_handler
def execute_and_fetch(
query: str,
parameters: Dict[str, Any] = {}) -> Iterator[Dict[str, Any]]

Executes Cypher query and returns iterator of results.

is_active

def is_active() -> bool

Returns True if connection is active and can be used.

Neo4jConnection Objects

class Neo4jConnection(Connection)

execute

def execute(query: str, parameters: Dict[str, Any] = {}) -> None

Executes Cypher query without returning any results.

execute_and_fetch

def execute_and_fetch(
query: str,
parameters: Dict[str, Any] = {}) -> Iterator[Dict[str, Any]]

Executes Cypher query and returns iterator of results.

is_active

def is_active() -> bool

Returns True if connection is active and can be used.