SHARE
TWEET
Untitled
a guest
Sep 28th, 2018
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- package models
- import (
- "github.com/astaxie/beego/orm"
- _ "github.com/lib/pq"
- )
- var ormObject orm.Ormer
- func ConnectToDb() {
- orm.RegisterDriver("postgres", orm.DRPostgres)
- orm.RegisterDataBase("default", "postgres", "user=postgres password=root dbname=shoes host=localhost ssl=disable")
- orm.RegisterModel(new(Shoes))
- ormObject = orm.NewOrm()
- }
- func GetOrmObject() orm.Ormer {
- return ormObject
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
