-
-
Save avary/ee3a45f002cdb70f63eda2722add7dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package datastore | |
| import ( | |
| "github.com/go-sql-driver/mysql" | |
| "github.com/jinzhu/gorm" | |
| ) | |
| func NewDB() (*gorm.DB, error) { | |
| DBMS := "mysql" | |
| mySqlConfig := &mysql.Config{ | |
| User: "root", | |
| Passwd: "root", | |
| Net: "tcp", | |
| Addr: "127.0.0.1:3306", | |
| DBName: "firebase-authentication-app", | |
| AllowNativePasswords: true, | |
| Params: map[string]string{ | |
| "parseTime": "true", | |
| }, | |
| } | |
| return gorm.Open(DBMS, mySqlConfig.FormatDSN()) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment