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

Function select_collection

tests/collection_tests.rs:207–229  ·  view source on GitHub ↗
(db: &DatabaseConnection)

Source from the content-addressed store, hash-verified

205}
206
207pub async fn select_collection(db: &DatabaseConnection) -> Result<(), DbErr> {
208 use collection::*;
209
210 #[derive(DerivePartialModel, FromQueryResult, Debug, PartialEq)]
211 #[sea_orm(entity = "Entity")]
212 struct PartialSelectResult {
213 name: String,
214 }
215
216 let result = Entity::find_by_id(1)
217 .into_partial_model::<PartialSelectResult>()
218 .one(db)
219 .await?;
220
221 assert_eq!(
222 result,
223 Some(PartialSelectResult {
224 name: "Collection 1".into(),
225 })
226 );
227
228 Ok(())
229}

Callers 1

mainFunction · 0.85

Calls 1

oneMethod · 0.45

Tested by

no test coverage detected