def _create_memory_database_interface(self) -> GraphDatabaseInterface:
        """
        Creates and returns the in-memory database interface the graph will use.
        """
        Base = declarative_base()
        engine = sqlalchemy.create_engine("sqlite://", poolclass=StaticPool)
        Session = sessionmaker(bind=engine)

        dbi: GraphDatabaseInterface = create_graph_database_interface(
            sqlalchemy, Session(), Base, sqlalchemy.orm.relationship
        )

        Base.metadata.drop_all(engine)
        Base.metadata.create_all(engine)

        return dbi
def _create_memory_database_interface ( self ) -> GraphDatabaseInterface : Base = declarative_base ( ) engine = sqlalchemy . create_engine ( "sqlite://" , poolclass = StaticPool ) Session = sessionmaker ( bind = engine ) dbi : GraphDatabaseInterface = create_graph_database_interface ( sqlalchemy , Session ( ) , Base , sqlalchemy . orm . relationship ) Base . metadata . drop_all ( engine ) Base . metadata . create_all ( engine ) return dbi
Creates and returns the in-memory database interface the graph will use.