orange-orm icon indicating copy to clipboard operation
orange-orm copied to clipboard

[ENHANCEMENT]: support `enums`

Open Zer0xxxx opened this issue 1 year ago • 2 comments

Feature Description

Currently, enums are not supported in Orange ORM. As we discussed, it could relatively "easily" be implemented.

Related to: https://github.com/alfateam/orange-orm/discussions/96 (https://github.com/alfateam/orange-orm/discussions/96#discussioncomment-9638139)

Zer0xxxx avatar Jun 02 '24 14:06 Zer0xxxx

Btw, I think it should be typed also. Just calling a validation function on it will help to keep the enum safe at runtime, but not at compile time. :/

Likewise:

const wolfgang = await db.team.insert({
  'lang': '...', // * ... No IntelliSense?
  // * ...
});

Zer0xxxx avatar Jun 02 '24 15:06 Zer0xxxx

Yes, of course 😊

lroal avatar Jun 02 '24 15:06 lroal