diff --git a/src/types.rs b/src/types.rs index 23f6f05a5..6091c6cc9 100644 --- a/src/types.rs +++ b/src/types.rs @@ -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(db: D, tbl: T) -> Self + where + D: IntoIden + 'static, + T: IntoIden + 'static, + { + Self::DatabaseTable(db.into_iden(), tbl.into_iden()) + } } impl Alias {