示例#1
0
func (c *Context) Batch(b *gocql.Batch) error {
	stmt, placeHolders, err := BuildStatement(c)

	if err != nil {
		return err
	}

	if c.Debug {
		debugStmt(stmt, placeHolders)
	}

	b.Query(stmt, placeHolders...)

	return nil
}
示例#2
0
文件: cqlc.go 项目: EverythingMe/cqlc
func (c *Context) Batch(b *gocql.Batch) error {
	stmt, placeHolders, err := BuildStatement(c)

	if err != nil {
		return err
	}

	if c.Debug {
		fmt.Printf("%+v bound to stmt: %s\n", placeHolders, stmt)
	}

	b.Query(stmt, placeHolders...)

	return nil
}