blob: c9b1b2908fa65d60f71ca04e7f9ef5d6faf4d9f2 [file] [log] [blame]
:mod:`airflow.providers.neo4j.hooks.neo4j`
==========================================
.. py:module:: airflow.providers.neo4j.hooks.neo4j
.. autoapi-nested-parse::
This module allows to connect to a Neo4j database.
Module Contents
---------------
.. py:class:: Neo4jHook(conn_id: str = default_conn_name, *args, **kwargs)
Bases: :class:`airflow.hooks.base.BaseHook`
Interact with Neo4j.
Performs a connection to Neo4j and runs the query.
:param neo4j_conn_id: Reference to :ref:`Neo4j connection id <howto/connection:neo4j>`.
:type neo4j_conn_id: str
.. attribute:: conn_name_attr
:annotation: = neo4j_conn_id
.. attribute:: default_conn_name
:annotation: = neo4j_default
.. attribute:: conn_type
:annotation: = neo4j
.. attribute:: hook_name
:annotation: = Neo4j
.. method:: get_conn(self)
Function that initiates a new Neo4j connection
with username, password and database schema.
.. method:: get_uri(self, conn: Connection)
Build the uri based on extras
- Default - uses bolt scheme(bolt://)
- neo4j_scheme - neo4j://
- certs_self_signed - neo4j+ssc://
- certs_trusted_ca - neo4j+s://
:param conn: connection object.
:return: uri
.. method:: run(self, query)
Function to create a neo4j session
and execute the query in the session.
:param query: Neo4j query
:return: Result