Skip to content

Commit

Permalink
Add helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Nov 29, 2021
1 parent 1f2c7db commit ebff108
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ impl TableRef {
Self::SubQuery(statement, _) => Self::SubQuery(statement, alias.into_iden()),
}
}

/// Helper method for creating [TableRef::DatabaseTable]
pub fn db_tbl<D, T>(db: D, tbl: T) -> Self
where
D: IntoIden + 'static,
T: IntoIden + 'static,
{
Self::DatabaseTable(db.into_iden(), tbl.into_iden())
}
}

impl Alias {
Expand Down

0 comments on commit ebff108

Please sign in to comment.