Created
          January 17, 2020 02:22 
        
      - 
      
- 
        Save manakuro/1a4f2c8f90281cf39d4189241e6853a6 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