ndelvalle / rustapi

🚀 RESTful Rust API Template / Boilerplate
468 stars 58 forks source link

Migrate to Postgresql #408

Open ndelvalle opened 6 months ago

ndelvalle commented 6 months ago

After doing some research I think I will give https://github.com/SeaQL/sea-orm a try and implement it.

Interesting reads about different ORM options:

opeolluwa commented 1 month ago

Do you want help with this?

ndelvalle commented 1 month ago

@opeolluwa Yes, but I still haven’t decided what to use for PostgreSQL. I’m leaning more towards Diesel over SeaORM—it seems simpler and doesn’t clutter the code with ORM-related elements everywhere. I also need to put more effort into my #458 PR to make it more stable so that others can contribute, as it’s currently a bit messy. Do you have strong opinions about these ORMs?

opeolluwa commented 1 month ago

yes, I've used both in production environment. My opinion is that, diesel is more battle tested than SeaORM, especially looking at the stats, on the other end, SeaORM seems more promising.

Also on the other end, Diesel isn't async-first unlike, SeaORM.

opeolluwa commented 1 month ago

Do you want me to look at this

ndelvalle commented 1 month ago

@opeolluwa I’m currently using diesel-async for async support, and it seems to be working correctly. If you’re interested in continuing the work, that would be fantastic. I haven’t had much time lately to make progress, so any help would be greatly appreciated!

opeolluwa commented 1 month ago

I'll see what can be done

opeolluwa commented 1 month ago

@ndelvalle do you want to use diese-async or I should revamp with sea-orm

ndelvalle commented 1 month ago

@opeolluwa i think using async diesel is the best idea.

opeolluwa commented 1 month ago

alright

opeolluwa commented 1 month ago

I'll put it up locally tomorrow!

opeolluwa commented 1 month ago

@ndelvalle would you be kind to tag the branch you're working on

ndelvalle commented 1 month ago

@ndelvalle would you be kind to tag the branch you're working on

I just added you as a collaborator, feel free to keep working on the same branch or tag it.

opeolluwa commented 1 month ago

awesome thanks

opeolluwa commented 1 month ago

@ndelvalle the use-diesel branch has a handful of issues, I'm going to squash it and incrementally make PR to the main branch till all it is all setup

ndelvalle commented 1 month ago

@ndelvalle the use-diesel branch has a handful of issues, I'm going to squash it and incrementally make PR to the main branch till all it is all setup

Yeah @opeolluwa , we don't need to use the use-diesel branch, you can create another one and we can work on that one.

opeolluwa commented 1 month ago

Awesome!

I've done that