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 the model from the websocket into TypeOrm #13

Closed
microwavekonijn opened this issue Aug 20, 2020 · 6 comments · Fixed by #17
Closed

Implement the model from the websocket into TypeOrm #13

microwavekonijn opened this issue Aug 20, 2020 · 6 comments · Fixed by #17
Assignees
Labels
donext enhancement New feature or request
Milestone

Comments

@microwavekonijn
Copy link
Member

All models need to be copied over to the API and needs reimplementing into TypeOrm.

@Maelstromeous
Copy link
Member

Just to enquire, and I know you lightly touched upon it but I missed it in the meeting, how come we're axing Mongoose?

@microwavekonijn
Copy link
Member Author

The API will require a sql database for API tokens(OAuth is an option later on)/user features. I would like to stick to one ORM/ODM. Besides I wanted to use Typegoose which is Mongoose + decorators, but it is essentially the same a TypeORM.

@Maelstromeous
Copy link
Member

My biggest issue with TypeORM is that it doesn't appear to support enums, I could be totally wrong however. Also from what I remember it doesn't have as many features supported for NoSQL, such as indexes and the like. I would probably recommend keeping the PS2Alerts data as Mongoose as that's just a lift and shift, already familiar and won't require any time to change. and the stuff you're making for the API tokens as a seperate entity, which thankfully doesn't have to be touched. If however it's a configuration nightmare, then I'll let it slide.

@Maelstromeous Maelstromeous added this to the API 3.0 Alpha milestone Aug 21, 2020
@microwavekonijn
Copy link
Member Author

TypeOrm will work the same as Mongoose, like updateOne is the same for instance. Enums should be supported, even for databases that do not support it natively(maybe you have to use simple-enum as the type, there is a list of supported types but I cannot find it). Indexes are supported just like sql databases and work the same.

@Maelstromeous
Copy link
Member

Ok, well that satisfies my issues, thankfully you can use entity classes in type ORM which was my initial attraction to it in the first place, so it's probably going to make a lot more sense within the API.

@zhenghung
Copy link
Contributor

@Maelstromeous Shall we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
donext enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants