You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bxcodec thanks for your amazing work! Go is just a hobby for me and I'm having fun. I'm learning a lot from your project.
I'm trying to understand if multi-tenancy column/table based is something to be "included", if it is "related to" the repository, usecase or handler level.
I think maybe the concept of FilterByTenant in the usecase layer is an unnecessary repetition and should belong to lower levels like repositories?
But I also think that the main multi-tenancy logic does not change with the change of possible repository types (Postgres, Mysql, Mongo, microservices).
What do you think about it?
The text was updated successfully, but these errors were encountered:
Oh my god, I missed this.
So sorry @frederikhors tough time back then.
Let's schedule some time to discuss this properly. I want to learn how's your approach to the solution, it may be useful to add other use cases in this repo?
@bxcodec thanks for your amazing work! Go is just a hobby for me and I'm having fun. I'm learning a lot from your project.
I'm trying to understand if multi-tenancy column/table based is something to be "included", if it is "related to" the repository, usecase or handler level.
Example
Adding
tenant.go
model like this:to other models like this:
and
Let's talk for example of the
Store()
method:article_handler.go
) level I callArticleUsecase.Store()
Store()
I callarticleRepo.Store()
Store()
I save the article object.Question
Let's say my
tenant_id
is a field of aUser
struct incontext
on every request (authenticated by a third party middleware).Where do you think I should do something like below? In handler, usecase or repository?
Doubts about fetch queries
Today, before I discover the amazing "clean architecture", I'm using a
where
clause in my SQL queries (go-pg/pg#1179), like this:I think maybe the concept of
FilterByTenant
in the usecase layer is an unnecessary repetition and should belong to lower levels like repositories?But I also think that the main multi-tenancy logic does not change with the change of possible repository types (Postgres, Mysql, Mongo, microservices).
What do you think about it?
The text was updated successfully, but these errors were encountered: