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

Discussion : Do we want to add Property type constraints ? #751

Open mariusconjeaud opened 11 months ago

mariusconjeaud commented 11 months ago

Neo4j (Enterprise Edition) 5.9 introduced property type constraints.

The question is the following : do we want to add support for this in neomodel ?

Since neomodel defines property types in the Node and Relationship classes, we technically already provide property type constraints on top of Neo4j, but only when you go through neomodel. So I see a use case where other apps also connect to the Neo4j database (or scripts, ETL, ...), without using the models defined in neomodel => then you cannot control property type. But I am unsure if in those use cases, you would want to give to neomodel the responsibility of creating such constraints on the Neo4j database ?

Happy for feedback here !

Note : this is an Enterprise Edition feature only, but we recently made neomodel Neo4j edition- and version-aware, so we could control creation of said constraints only to those apps running against an EE 5.9+ database