pub struct Column { /* private fields */ }Expand description
PostgreSQL table column.
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(table_name: impl ToString, column_name: impl ToString) -> Self
pub fn new(table_name: impl ToString, column_name: impl ToString) -> Self
Create new table column, given the table name and column name.
Columns are ideally always fully qualified with the table name to avoid ambiguous errors.
Sourcepub fn name(column_name: impl ToString) -> Self
pub fn name(column_name: impl ToString) -> Self
Create new table column, given the column name.
Not fully qualified, so use with care, or you’ll get ambiguous column error when joining, especially with common column names like “id”.
pub fn qualified(&self) -> bool
pub fn qualify(self, table_name: impl ToString) -> Self
pub fn unqualify(self) -> Self
pub fn as_value(self, value: impl ToValue) -> Self
Trait Implementations§
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more