rust-teos icon indicating copy to clipboard operation
rust-teos copied to clipboard

DBM insert statements can be simplified using rusqlite::Statement::insert

Open sr-gi opened this issue 2 years ago • 5 comments

This may be irrelevant though, given @SpoonBuoy is working or reworking all the DBM logic.

Leaving it here as a note just in case it ends up being relevant.

sr-gi avatar Jun 08 '22 10:06 sr-gi

I don't think it will be required now, since we are removing the dependency of rusqlite as you suggested to use sqlx instead.

SpoonBuoy avatar Jun 08 '22 17:06 SpoonBuoy

I just took a look at sqlx. Nice project, but I think it's a bit low level than what we need here. An ORM would do nice and keep things clean. I'm thinking about one of these:

Would like to here your opinion.

mariocynicys avatar Jun 08 '22 18:06 mariocynicys

Yeah, an ORM like SeaORM would handle lot of edges that we would have to take care of using sqlx like (making two different queries for sqlite and postgres in some cases), thus making code much cleaner and non repetitive.

SpoonBuoy avatar Jun 08 '22 21:06 SpoonBuoy

I'm just personally not a big fan of ORM, but it's ultimately on you @SpoonBuoy. If you rather go with one of the ORM options I won't complain. It's your project at the end of the day.

sr-gi avatar Jun 08 '22 21:06 sr-gi

I had already implemented users related functions with sqlx, but I think ORM is a better option as @meryacine mentioned. Would start working on an altogether new dbm with SeaORM. Have to hurry up a little since I have to submit mid-term report by the end of this month.

SpoonBuoy avatar Jun 09 '22 08:06 SpoonBuoy