@@ -13,15 +13,17 @@ pub enum RowKind {
1313/// Represents a row that can be used in queries.
1414///
1515/// Implemented for:
16- /// * All `#[derive(Row)]` items
16+ /// * All [ `#[derive(Row)]`][row-derive] items
1717/// * `(P1, P2, ...)` where P* is a primitive type or string
1818///
19- /// Do not implement this trait directly, use `#[derive(Row)]` instead.
19+ /// Do not implement this trait directly, use [ `#[derive(Row)]`][row-derive] instead.
2020///
2121/// In order to write a generic code over rows, check
2222/// * [`RowRead`] for reading queries.
2323/// * [`RowWrite`] for writing queries.
2424/// * [`RowOwned`] for rows that do not hold any references.
25+ ///
26+ /// [row-derive]: derive@crate::Row
2527pub trait Row {
2628 // NOTE: all properties are unstable and, hence, not following semver.
2729
@@ -277,21 +279,21 @@ pub(crate) fn join_column_names<R: Row>() -> Option<String> {
277279
278280#[ cfg( test) ]
279281mod tests {
280- // XXX: need for `derive(Row)`. Provide `row(crate = ..)` instead.
281- use crate as clickhouse;
282- use clickhouse:: Row ;
282+ use crate :: Row ;
283283
284284 use super :: * ;
285285
286286 #[ test]
287287 fn it_grabs_simple_struct ( ) {
288288 #[ derive( Row ) ]
289+ #[ clickhouse( crate = "crate" ) ]
289290 #[ allow( dead_code) ]
290291 struct Simple1 {
291292 one : u32 ,
292293 }
293294
294295 #[ derive( Row ) ]
296+ #[ clickhouse( crate = "crate" ) ]
295297 #[ allow( dead_code) ]
296298 struct Simple2 {
297299 one : u32 ,
@@ -305,6 +307,7 @@ mod tests {
305307 #[ test]
306308 fn it_grabs_mix ( ) {
307309 #[ derive( Row ) ]
310+ #[ clickhouse( crate = "crate" ) ]
308311 struct SomeRow {
309312 _a : u32 ,
310313 }
@@ -317,6 +320,7 @@ mod tests {
317320 use serde:: Serialize ;
318321
319322 #[ derive( Row , Serialize ) ]
323+ #[ clickhouse( crate = "crate" ) ]
320324 #[ allow( dead_code) ]
321325 struct TopLevel {
322326 #[ serde( rename = "two" ) ]
@@ -331,6 +335,7 @@ mod tests {
331335 use serde:: Serialize ;
332336
333337 #[ derive( Row , Serialize ) ]
338+ #[ clickhouse( crate = "crate" ) ]
334339 #[ allow( dead_code) ]
335340 struct TopLevel {
336341 one : u32 ,
@@ -346,6 +351,7 @@ mod tests {
346351 use serde:: Deserialize ;
347352
348353 #[ derive( Row , Deserialize ) ]
354+ #[ clickhouse( crate = "crate" ) ]
349355 #[ allow( dead_code) ]
350356 struct TopLevel {
351357 one : u32 ,
@@ -360,6 +366,7 @@ mod tests {
360366 fn it_rejects_other ( ) {
361367 #[ allow( dead_code) ]
362368 #[ derive( Row ) ]
369+ #[ clickhouse( crate = "crate" ) ]
363370 struct NamedTuple ( u32 , u32 ) ;
364371
365372 assert_eq ! ( join_column_names:: <u32 >( ) , None ) ;
@@ -372,6 +379,7 @@ mod tests {
372379 use serde:: Serialize ;
373380
374381 #[ derive( Row , Serialize ) ]
382+ #[ clickhouse( crate = "crate" ) ]
375383 #[ allow( dead_code) ]
376384 struct MyRow {
377385 r#type : u32 ,
0 commit comments