We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be very helpful if there was an option to choose from an SQL DB and a NoSQL DB. ( PostgreSQL, MongoDB )
internal/config
ConnectDB
localhost
package main import ( "context" "log" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) var collection *mongo.Collection var ctx = context.TODO() func init() { clientOptions := options.Client().ApplyURI("mongodb://localhost:27017/") client, err := mongo.Connect(ctx, clientOptions) if err != nil { log.Fatal(err) } err = client.Ping(ctx, nil) if err != nil { log.Fatal(err) } return client }
The text was updated successfully, but these errors were encountered:
This issue is fixed in PR #6
Sorry, something went wrong.
Currently, both db configs are provided. It should be based on user input
No branches or pull requests
Feature Proposal Description
It would be very helpful if there was an option to choose from an SQL DB and a NoSQL DB. ( PostgreSQL, MongoDB )
internal/config
will contain aConnectDB
function to connect with Database,localhost
of the respective DB will be used for connectionFeature Examples
Checklist:
The text was updated successfully, but these errors were encountered: