conf

package module
v1.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 4 Imported by: 0

README

GORM Conf

提供GORM常用配置

快速上手

package main

import(
  "github.com/jinzhu/gorm"
  gorm_conf "github.com/asr-go/gorm_conf"

  //
  _ "github.com/jinzhu/gorm/dialects/mysql"

)

func main() {
  db, err := gorm.Open("mysql", connString)
  // Error
  if err != nil {
    panic("连接数据库不成功", err)
  }
  gorm_conf.Conf(db)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(dialect string, debug bool) (*gorm.DB, error)

NewDatabase 新建数据库

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL