You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
393 B

  1. package json
  2. import "github.com/seaweedfs/seaweedfs/weed/query/sqltypes"
  3. func ToJson(buf []byte, selections []string, values []sqltypes.Value) []byte {
  4. buf = append(buf, '{')
  5. for i, value := range values {
  6. if i > 0 {
  7. buf = append(buf, ',')
  8. }
  9. buf = append(buf, selections[i]...)
  10. buf = append(buf, ':')
  11. buf = append(buf, value.Raw()...)
  12. }
  13. buf = append(buf, '}')
  14. return buf
  15. }