Search code examples
memgraphdb

Can GQLAlchemy be used to validate the scheme of the dataset?


Memgraph is schemaless, but some use cases require strict validation rules. Instead of enforcing the schema in Memgraph is there a way to enforce it easily in GQLAlchemy?


Solution

  • Yes, you can enforce it. Memgraph uses Pydantic. It's actually very Pythonic. Please take a look at tests/ogm/test_loading.py in the GitHub repo to see the code.