diesel/
reexport_ambiguities.rs

1// This macro exists to workaround
2// https://github.com/rust-lang/rust/issues/149845
3//
4// The underlying problem there is that for sql function
5// diesel generates items in multiple namespaces (type and function)
6// with the same name. We often want only to import from one namespace
7// which can be done by shadowing the relevant items from the other
8// namespace with a private item after the glob import.
9//
10// TODO: Fixme Diesel 3.0, resolve this ambiguity in the macro itself
11macro_rules! make_proxy_mod {
12    ($name:ident, $path:path) => {
13        #[allow(hidden_glob_reexports, non_camel_case_types, dead_code)]
14        mod $name {
15            #[doc(inline)]
16            pub use $path::*;
17
18            // Drop unintended types
19            type abbrev = ();
20            type array_append = ();
21            type array_cat = ();
22            type array_dims = ();
23            type array_fill_with_lower_bound = ();
24            type array_fill = ();
25            type array_length = ();
26            type array_lower = ();
27            type array_ndims = ();
28            type array_position_with_subscript = ();
29            type array_position = ();
30            type array_positions = ();
31            type array_prepend = ();
32            type array_remove = ();
33            type array_replace = ();
34            type array_sample = ();
35            type array_shuffle = ();
36            type array_to_json = ();
37            type array_to_string_with_null_string = ();
38            type array_to_string = ();
39            type array_upper = ();
40            type avg = ();
41            type broadcast = ();
42            type cardinality = ();
43            type daterange = ();
44            type family = ();
45            type first_value = ();
46            type host = ();
47            type hostmask = ();
48            type inet_merge = ();
49            type inet_same_family = ();
50            type int4range = ();
51            type int8range = ();
52            type isempty = ();
53            type json_array_length = ();
54            type json_build_array_0 = ();
55            type json_build_array_1 = ();
56            type json_build_array_2 = ();
57            type json_extract_path_1 = ();
58            type json_extract_path_2 = ();
59            type json_extract_path_text_1 = ();
60            type json_extract_path_text_2 = ();
61            type json_object_with_keys_and_values = ();
62            type json_object = ();
63            type json_populate_record = ();
64            type json_strip_nulls = ();
65            type json_typeof = ();
66            type jsonb_array_length = ();
67            type jsonb_build_array_0 = ();
68            type jsonb_build_array_1 = ();
69            type jsonb_build_array_2 = ();
70            type jsonb_extract_path_1 = ();
71            type jsonb_extract_path_2 = ();
72            type jsonb_extract_path_text_1 = ();
73            type jsonb_extract_path_text_2 = ();
74            type jsonb_insert_with_insert_after = ();
75            type jsonb_insert = ();
76            type jsonb_object_with_keys_and_values = ();
77            type jsonb_object = ();
78            type jsonb_populate_record = ();
79            type jsonb_pretty = ();
80            type jsonb_set_create_if_missing = ();
81            type jsonb_set_lax = ();
82            type jsonb_set = ();
83            type jsonb_strip_nulls = ();
84            type jsonb_typeof = ();
85            type lag_with_offset_and_default = ();
86            type lag_with_offset = ();
87            type lag = ();
88            type last_value = ();
89            type lead_with_offset_and_default = ();
90            type lead_with_offset = ();
91            type lead = ();
92            type lower_inc = ();
93            type lower_inf = ();
94            type lower = ();
95            type masklen = ();
96            type max = ();
97            type min = ();
98            type multirange_merge = ();
99            type netmask = ();
100            type network = ();
101            type nth_value = ();
102            type numrange = ();
103            type range_merge = ();
104            type row_to_json = ();
105            type set_masklen = ();
106            type sum = ();
107            type to_json = ();
108            type to_jsonb = ();
109            type trim_array = ();
110            type tsrange = ();
111            type tstzrange = ();
112            type upper_inc = ();
113            type upper_inf = ();
114            type upper = ();
115
116            // sqlite
117            type json = ();
118            type json_array_0 = ();
119            type json_array_1 = ();
120            type json_array_2 = ();
121            type json_array_length_with_path = ();
122            type json_error_position = ();
123            type json_group_array = ();
124            type json_group_object = ();
125            type json_object_0 = ();
126            type json_object_1 = ();
127            type json_object_2 = ();
128            type json_patch = ();
129            type json_pretty = ();
130            type json_pretty_with_indentation = ();
131            type json_quote = ();
132            type json_remove_0 = ();
133            type json_remove_1 = ();
134            type json_remove_2 = ();
135            type json_type = ();
136            type json_type_with_path = ();
137            type json_valid = ();
138            type json_valid_with_flags = ();
139            type jsonb = ();
140            type jsonb_array_0 = ();
141            type jsonb_array_1 = ();
142            type jsonb_array_2 = ();
143            type jsonb_group_array = ();
144            type jsonb_group_object = ();
145            type jsonb_object_0 = ();
146            type jsonb_object_1 = ();
147            type jsonb_object_2 = ();
148            type jsonb_patch = ();
149            type jsonb_remove_0 = ();
150            type jsonb_remove_1 = ();
151            type jsonb_remove_2 = ();
152        }
153    };
154}