-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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 )
- There should be templates for the mentioned DB connection configs.
- Based on user selection the
internal/configwill contain aConnectDBfunction to connect with Database, localhostof the respective DB will be used for connection
Feature Examples
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
}Checklist:
- I agree to follow Optical's Code of Conduct.
- I have searched for existing issues that describe my proposal before opening this one.
- I understand that a proposal that does not meet these guidelines may be closed without explanation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels