Ejemplo n.º 1
0
func controlTrace(trace bool, DbMap *gorp.DbMap) {
	if trace {
		dbTraceWriter := util.ConstructSomeLogWriter(traceLog, os.Stdout)
		DbMap.TraceOn("", log.New(dbTraceWriter, "gorptest: ", log.Lmicroseconds))
	} else {
		DbMap.TraceOff()
	}
}
Ejemplo n.º 2
0
func AllNodes(dbMap *gorp.DbMap, prefix string) []*Node {
	sql := "select nid,vid,type,language,title,uid,status,created,changed,comment,promote,sticky,tnid,translate from " + prefix + "node"
	list, err := dbMap.Select(Node{}, sql)
	util.CheckErrFatal(err, sql)
	return copyOutNode(list)
}