Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: to be able to use one or other DB #8

Open
Romerolweb opened this issue Oct 13, 2023 · 0 comments
Open

[FEAT]: to be able to use one or other DB #8

Romerolweb opened this issue Oct 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Romerolweb
Copy link

Description

Hi,
I am learning Golang, and I am reading through your repo. It is really helpful to read the code for learning, however, I see something that would make it difficult to change later on. let´s pretend I want to start a project using Postgres, and then I see this file:

`package repositories

import (
"context"
"github.com/solrac97gr/go-jwt-auth/internal/user/domain/models"
)

func (repo *UserMongoDB) Save(user *models.User) error {
_, err := repo.collection.InsertOne(context.Background(), user)
if err != nil {
repo.logger.Error("Error saving user", err)
return err
}
return nil
}`

I am not sure how would I switch from mongoDB to Postgres easily.

thanks for your time.

Additional Information

No response

@Romerolweb Romerolweb added the enhancement New feature or request label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant