示例#1
0
文件: main.go 项目: mabetle/mdb
package main

import (
	"github.com/mabetle/mdb/demo"
	"github.com/mabetle/mdb/sql_mysqld"
)

var (
	sql = sql_mysqld.NewSqlFromSchema("demo")
)

// SqlDemo
func Demo() {
	demo.InitDB(sql)
}

func main() {
	Demo()
}
示例#2
0
文件: ioc.go 项目: mabetle/mdb
func GetSql() *mdb.Sql {
	if sqlDB == nil {
		sqlDB = sql_mysqld.NewSqlFromSchema("demo")
	}
	return sqlDB
}