Ejemplo n.º 1
0
func runParse(repeat int, sql string, readContext vm.ContextReader) {
	for i := 0; i < repeat; i++ {
		sqlVm, err := vm.NewSqlVm(sql)
		if err != nil {
			panic(err.Error())
		}

		writeContext := vm.NewContextSimple()
		err = sqlVm.Execute(writeContext, readContext)
		if err != nil {
			panic(err.Error())
		}
	}
}
Ejemplo n.º 2
0
func runVm(repeat int, sql string, readContext vm.ContextReader) {
	sqlVm, err := vm.NewSqlVm(sql)
	if err != nil {
		panic(err.Error())
	}

	for i := 0; i < repeat; i++ {

		writeContext := vm.NewContextSimple()
		err = sqlVm.Execute(writeContext, readContext)
		//log.Println(writeContext.All())
		if err != nil {
			panic(err.Error())
		}
	}
}