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() } }
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) }