DozerDB / dozerdb-core

DozerDB Plugin Core Project
GNU General Public License v3.0
27 stars 4 forks source link

Implement constraint checker when data is present in a graph #2

Open jmsuhy opened 1 year ago

jmsuhy commented 1 year ago

Currently, we can add new constraints to a blank database. We want to implement the checking logic to verify that there is not data that violates a constraint being added before adding the constraint.

For example - if the sample movie graph is created and the there are duplicates Movie nodes, then we want the following constraint to give an error indicating there is currently data that will violate the constraint.

CREATE CONSTRAINT movie_unique_title IF NOT EXISTS FOR (movie:Movie) REQUIRE movie.title IS UNIQUE