/src/resty_dbd_stream.h

http://github.com/agentzh/rds-json-nginx-module · C Header · 59 lines · 37 code · 14 blank · 8 comment · 0 complexity · fc0c48773f07054c97d1e38d8e8ab5a8 MD5 · raw file

  1. #ifndef RESTY_DBD_STREAME_H
  2. #define RESTY_DBD_STREAME_H
  3. #define resty_dbd_stream_version 3
  4. #define resty_dbd_stream_version_string "0.0.3"
  5. #define rds_content_type \
  6. "application/x-resty-dbd-stream"
  7. #define rds_content_type_len \
  8. (sizeof(rds_content_type) - 1)
  9. typedef enum {
  10. rds_rough_col_type_int = 0 << 14,
  11. rds_rough_col_type_float = 1 << 14,
  12. rds_rough_col_type_str = 2 << 14,
  13. rds_rough_col_type_bool = 3 << 14
  14. } rds_rough_col_type_t;
  15. /* The following types (or spellings thereof) are specified
  16. * by SQL:
  17. * bigint, bit, bit varying, boolean, char, character varying,
  18. * character, varchar, date, double precision, integer,
  19. * interval, numeric, decimal, real, smallint,
  20. * time (with or without time zone),
  21. * timestamp (with or without time zone), xml */
  22. typedef enum {
  23. rds_col_type_unknown = 0 | rds_rough_col_type_str,
  24. rds_col_type_bigint = 1 | rds_rough_col_type_int,
  25. rds_col_type_bit = 2 | rds_rough_col_type_str,
  26. rds_col_type_bit_varying = 3 | rds_rough_col_type_str,
  27. rds_col_type_bool = 4 | rds_rough_col_type_bool,
  28. rds_col_type_char = 5 | rds_rough_col_type_str,
  29. rds_col_type_varchar = 6 | rds_rough_col_type_str,
  30. rds_col_type_date = 7 | rds_rough_col_type_str,
  31. rds_col_type_double = 8 | rds_rough_col_type_float,
  32. rds_col_type_integer = 9 | rds_rough_col_type_int,
  33. rds_col_type_interval = 10 | rds_rough_col_type_float,
  34. rds_col_type_decimal = 11 | rds_rough_col_type_float,
  35. rds_col_type_real = 12 | rds_rough_col_type_float,
  36. rds_col_type_smallint = 13 | rds_rough_col_type_int,
  37. rds_col_type_time_with_time_zone = 14 | rds_rough_col_type_str,
  38. rds_col_type_time = 15 | rds_rough_col_type_str,
  39. rds_col_type_timestamp_with_time_zone = 16 | rds_rough_col_type_str,
  40. rds_col_type_timestamp = 17 | rds_rough_col_type_str,
  41. rds_col_type_xml = 18 | rds_rough_col_type_str,
  42. /* our additions */
  43. rds_col_type_blob = 19 | rds_rough_col_type_str
  44. } rds_col_type_t;
  45. #endif /* RESTY_DBD_STREAME_H */