MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / cursor_by_other

Method cursor_by_other

src/executor/cursor.rs:453–472  ·  view source on GitHub ↗

Convert into a cursor using column of second entity

(self, order_columns: C)

Source from the content-addressed store, hash-verified

451
452 /// Convert into a cursor using column of second entity
453 pub fn cursor_by_other<C>(self, order_columns: C) -> Cursor<SelectTwoModel<M, N>>
454 where
455 C: IdentityOf<F>,
456 {
457 let primary_keys: Vec<(DynIden, Identity)> = <E::PrimaryKey as Iterable>::iter()
458 .map(|pk| {
459 (
460 SeaRc::new(E::default()),
461 Identity::Unary(SeaRc::new(pk.into_column())),
462 )
463 })
464 .collect();
465 let mut cursor = Cursor::new(
466 self.query,
467 SeaRc::new(F::default()),
468 order_columns.identity_of(),
469 );
470 cursor.set_secondary_order_by(primary_keys);
471 cursor
472 }
473}
474
475impl<E, F, G, M, N, O> SelectThree<E, F, G>

Callers

nothing calls this directly

Calls 3

identity_ofMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected