neo4j-contrib / neomodel

An Object Graph Mapper (OGM) for the Neo4j graph database.
https://neomodel.readthedocs.io
MIT License
939 stars 231 forks source link

Refactor independent `db` functions into `Database` #739

Open aanastasiou opened 1 year ago

aanastasiou commented 1 year ago

Feature description (Mandatory)

A number of functions in neomodel/core.py and neomodel/util.py take a db argument whether explicitly, or implicitly (i.e. take db from the global context).

These can be refactored under the Database class.

This will result in better code organisation and it will also avoid circular import issues that appear at the moment when working on more advanced features.

However, this will also have a relatively large impact on tests and possibly user code, so it has to be scheduled for release appropriately.