Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Enum datatype in OGM #342

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

james-geiger
Copy link
Contributor

Description

This PR implements the Enum datatype in the OGM.

Pull request type

Please delete options that are not relevant.

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring with functional or API changes
  • Refactoring without functional or API changes
  • Build or packaging related changes
  • Documentation content changes
  • Other (please describe):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

######################################

Reviewer checklist (the reviewer checks this part)

  • Core feature implementation
  • Tests
  • Code documentation
  • Documentation on gqlalchemy/docs

######################################

Sorry, something went wrong.

@katarinasupe
Copy link
Contributor

Hi @james-geiger, thank you for the contribution! 🙏 Can you add some tests as well? It would be good to test saving a node with enum property and checking whether it's properly stored. Also, test all procedures you implemented to create, drop and ensure enums.

@james-geiger
Copy link
Contributor Author

There are still quite a few things that need to be done, but wanted to provide a working proof of concept for feedback and alignment.

Because we cannot currently drop enums in Memgraph, I'm thinking this needs to be an error or warning at this point.

TODO:

  • Implement default for supported databases which do not have an enum type (neo4j).
  • Implement enum creation on node/relationship instantiation where it needs to exist.
  • Implement alter statements or issue warning when enum in OGM does not match the values in database
  • Documentation
  • Tests

Sorry, something went wrong.

@katarinasupe
Copy link
Contributor

This will then be a part of the next release and I'll take a closer look later 😄
Btw. can you check my last comment on #341 so we can merge it?

@katarinasupe katarinasupe added this to the GQLAlchemy 1.8.0 milestone Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants