We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8fe958 commit 8280807Copy full SHA for 8280807
butane_core/src/lib.rs
@@ -156,7 +156,12 @@ pub trait DataObjectOps<T: DataObject> {
156
.nth(0))
157
}
158
159
- /// Save the object to the database.
+ /// Save the object to the database, handling both inserts and updates.
160
+ ///
161
+ /// If the object has an AutoPk that is uninitialized, save will always
162
+ /// perform an insert. If the AutoPk is initialized or there is no AutoPk,
163
+ /// save will perform an upsert (insert or replace).
164
+ /// After saving the main object, many-to-many relationships it holds are also saved.
165
async fn save(&mut self, conn: &impl ConnectionMethods) -> Result<()>
166
where
167
Self: DataObject,
0 commit comments