#Advanced Alchemy Repository `.new` enhancement

1 messages · Page 1 of 1 (latest)

frosty axle
#

I'd like to move all of the service and repository overrides from full-stack into the main advanced-alchemy release. To do that though, we need a way of handling the new method.

What do you think about us letting the new method take an optional Adv Alchemy config that it can use to create a new session if one isn't supplied?

Alternately, we could implement some sort of management class a layer higher than the service. It could be more or less a "Model Manager" and be a factory for models, repos, and services.

Thoughts? https://github.com/cofin/litestar-fullstack/blob/main/src/app/lib/service.py#L108 for reference.

tidal starBOT
#

src/app/lib/service.py line 108

else:
cloud cedar
#

I think the first option is good enough for now. I like the Model Manager idea. I am concerned about increasing cognitive load by increasing complexity too much; seen too many frameworks become harder to maintain because of it. That said, I don't think ModelManager would be too bad in that regard.