func SetupDb() (q *qbs.Qbs) { var ( err error migration *qbs.Migration ) q, err = qbs.GetQbs() if q, err = qbs.GetQbs(); err != nil { panic(err) } if migration, err = qbs.GetMigration(); err != nil { panic(err) } defer migration.Close() if err = migration.CreateTableIfNotExists(new(User)); err != nil { panic(err) } if err = migration.CreateTableIfNotExists(new(Profile)); err != nil { panic(err) } return q }
func SetupDb() (q *qbs.Qbs) { var ( err error migration *qbs.Migration ) qbs.SetLogger(log.New(os.Stdout, "query:", log.Lmicroseconds), log.New(os.Stdout, "error:", log.Lmicroseconds)) q, err = qbs.GetQbs() if q, err = qbs.GetQbs(); err != nil { panic(err) } if migration, err = qbs.GetMigration(); err != nil { panic(err) } defer migration.Close() if err = migration.CreateTableIfNotExists(new(User)); err != nil { panic(err) } return q }