I am a product engineer and have helped build software from small startups, to manipulating hundreds of millions of data points. I write API's and make tools that make developers lives easier.
I am still going through these and am new to Rust. But being used to frameworks like flask in python, is it easy or possible to abstract out the model methods to not have the boilerplate for the db connection?
some frameworks make it so you can do request.db or maybe move it to a parent model or something? that way the model methods are a lot cleaner?
Well, I think it's possible, passing the db connection through a Trait, and then implements the trait for every model. Seems like a fun thing to do, maybe in a future post I'll try to implement it.
I am a product engineer and have helped build software from small startups, to manipulating hundreds of millions of data points. I write API's and make tools that make developers lives easier.
I am still going through these and am new to Rust. But being used to frameworks like flask in python, is it easy or possible to abstract out the model methods to not have the boilerplate for the db connection?
some frameworks make it so you can do
request.db
or maybe move it to a parent model or something? that way the model methods are a lot cleaner?Well, I think it's possible, passing the db connection through a Trait, and then implements the trait for every model. Seems like a fun thing to do, maybe in a future post I'll try to implement it.
that would be great.