database: Change syntax of impl_to_insert!

This commit is contained in:
Steffo 2024-12-10 18:42:26 +01:00
parent 16e6d6b97a
commit cd1fc811ff
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
/// Implement `to_insert` and `to_inserted_async` for the given `$insert_type`, resulting in the given `$result_type`, adding a record to `$table_type`. /// Implement `to_insert` and `to_inserted_async` for the given `$insert_type`, resulting in the given `$result_type`, adding a record to `$table_type`.
#[macro_export] #[macro_export]
macro_rules! impl_to_insert { macro_rules! impl_to_insert {
($insert_type:ty => $table_type:expr => $result_type:ty) => { ($insert_type:ty => $result_type:ty: $table_type:expr) => {
impl $insert_type { impl $insert_type {
/// Syncronously insert the record into the table, returning the full inserted record. /// Syncronously insert the record into the table, returning the full inserted record.
pub fn to_inserted(self, conn: &mut diesel::pg::PgConnection) -> diesel::QueryResult<$result_type> { pub fn to_inserted(self, conn: &mut diesel::pg::PgConnection) -> diesel::QueryResult<$result_type> {

View file

@ -560,9 +560,9 @@ impl MetaProperty {
} }
} }
impl_to_insert!(MetaSubjectInsert => schema::meta_subjects::table => MetaSubject); impl_to_insert!(MetaSubjectInsert => MetaSubject: schema::meta_subjects::table);
impl_to_insert!(MetaAliasInsert => schema::meta_aliases::table => MetaAlias); impl_to_insert!(MetaAliasInsert => MetaAlias: schema::meta_aliases::table);
impl_to_insert!(MetaLinkInsert => schema::meta_links::table => MetaLink); impl_to_insert!(MetaLinkInsert => MetaLink: schema::meta_links::table);
impl_to_insert!(MetaLinkPropertyInsert => schema::meta_link_properties::table => MetaLinkProperty); impl_to_insert!(MetaLinkPropertyInsert => MetaLinkProperty: schema::meta_link_properties::table);
impl_to_insert!(MetaLinkTitleInsert => schema::meta_link_titles::table => MetaLinkTitle); impl_to_insert!(MetaLinkTitleInsert => MetaLinkTitle: schema::meta_link_titles::table);
impl_to_insert!(MetaPropertyInsert => schema::meta_properties::table => MetaProperty); impl_to_insert!(MetaPropertyInsert => MetaProperty: schema::meta_properties::table);