PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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