@@ -93,6 +93,9 @@ impl Query {
93
93
}
94
94
95
95
/// Executes the query, returning a [`watch::RowJsonCursor`] to obtain results.
96
+ ///
97
+ /// Beware that with `JSONEachRow` format, Clickhouse always returns
98
+ /// a JSON object in the `{ "column1": value1, "column2": value2 }` format and not as `[value1, value2]`.
96
99
#[ cfg( feature = "watch" ) ]
97
100
pub fn fetch_json < T > ( mut self ) -> Result < watch:: RowJsonCursor < T > > {
98
101
self . sql . append ( " FORMAT JSONEachRowWithProgress" ) ;
@@ -104,6 +107,9 @@ impl Query {
104
107
/// Executes the query and returns just a single row.
105
108
///
106
109
/// Note that `T` must be owned.
110
+ ///
111
+ /// Beware that with `JSONEachRow` format, Clickhouse always returns
112
+ /// a JSON object in the `{ "column1": value1, "column2": value2 }` format and not as `[value1, value2]`.
107
113
#[ cfg( feature = "watch" ) ]
108
114
pub async fn fetch_json_one < T > ( self ) -> Result < T >
109
115
where
@@ -119,6 +125,9 @@ impl Query {
119
125
/// Executes the query and returns at most one row.
120
126
///
121
127
/// Note that `T` must be owned.
128
+ ///
129
+ /// Beware that with `JSONEachRow` format, Clickhouse always returns
130
+ /// a JSON object in the `{ "column1": value1, "column2": value2 }` format and not as `[value1, value2]`.
122
131
#[ cfg( feature = "watch" ) ]
123
132
pub async fn fetch_json_optional < T > ( self ) -> Result < Option < T > >
124
133
where
@@ -131,6 +140,9 @@ impl Query {
131
140
/// collected into a [`Vec`].
132
141
///
133
142
/// Note that `T` must be owned.
143
+ ///
144
+ /// Beware that with `JSONEachRow` format, Clickhouse always returns
145
+ /// a JSON object in the `{ "column1": value1, "column2": value2 }` format and not as `[value1, value2]`.
134
146
#[ cfg( feature = "watch" ) ]
135
147
pub async fn fetch_json_all < T > ( self ) -> Result < Vec < T > >
136
148
where
0 commit comments