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

Function update_embedding

tests/embedding_tests.rs:83–103  ·  view source on GitHub ↗
(db: &DatabaseConnection)

Source from the content-addressed store, hash-verified

81 }
82
83 pub async fn update_embedding(db: &DatabaseConnection) -> Result<(), DbErr> {
84 use embedding::*;
85
86 let model = Entity::find_by_id(1).one(db).await?.unwrap();
87
88 ActiveModel {
89 embedding: Set(PgVector::from(vec![10.])),
90 ..model.into_active_model()
91 }
92 .update(db)
93 .await?;
94
95 ActiveModel {
96 id: Unchanged(3),
97 embedding: Set(PgVector::from(vec![10., 20., 30.])),
98 }
99 .update(db)
100 .await?;
101
102 Ok(())
103 }
104
105 pub async fn select_embedding(db: &DatabaseConnection) -> Result<(), DbErr> {
106 use embedding::*;

Callers 1

mainFunction · 0.85

Calls 4

unwrapMethod · 0.80
into_active_modelMethod · 0.80
oneMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected