Exemplo n.º 1
0
func (query *Query) encodeBindVariablesBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)
	for k, v := range query.BindVariables {
		bson.EncodeField(buf, k, v)
	}
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemplo n.º 2
0
func MarshalPKRowBson(buf *bytes2.ChunkedWriter, key string, pkRow []interface{}) {
	bson.EncodePrefix(buf, bson.Array, key)
	lenWriter := bson.NewLenWriter(buf)
	for i, v := range pkRow {
		bson.EncodeField(buf, bson.Itoa(i), v)
	}
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemplo n.º 3
0
func EncodeBindVariablesBson(buf *bytes2.ChunkedWriter, key string, bindVars map[string]interface{}) {
	bson.EncodePrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)
	for k, v := range bindVars {
		bson.EncodeField(buf, k, v)
	}
	buf.WriteByte(0)
	lenWriter.RecordLen()
}