Skip to content

Commit 7e43e4e

Browse files
committed
models/action: Add NewVersionOwnerAction::async_insert() fn
1 parent a1c02fd commit 7e43e4e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/models/action.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,16 @@ impl NewVersionOwnerAction {
114114
.values(self)
115115
.get_result(conn)
116116
}
117+
118+
pub async fn async_insert(
119+
&self,
120+
conn: &mut AsyncPgConnection,
121+
) -> QueryResult<VersionOwnerAction> {
122+
use diesel_async::RunQueryDsl;
123+
124+
diesel::insert_into(version_owner_actions::table)
125+
.values(self)
126+
.get_result(conn)
127+
.await
128+
}
117129
}

0 commit comments

Comments
 (0)