Hi all, I'm writing a backend server with sqlc, pgx, for interfacing with my postgres db. I've seen online many popular ways of abstracting it to have a handlers, services, and repositories.
To my understanding, handlers are strictily for the API handling and call upon the service to actually do the business logic
services handle business logic, transforming data etc but they call upon the repository to actually make the db call
now that I get, but I'm using sqlc which generate go code from sql. Should I still have a repository folder in that case? And what will that look like when I have to make db transactions (for example) at the service level.
For example,
I want signing up a user to be atomic so I start a transaction at the service level and pass them into the function in the repositories.
However this means that i usually have two function, for example func CreateUser(...) and then func CreateUser(tx pgx.Tx, ...). To me this seems a bit redundant. But is this normal?