Skip to main content

ColumnRef

Enum ColumnRef 

Source
pub enum ColumnRef {
    Column(DynIden),
    TableColumn(DynIden, DynIden),
    SchemaTableColumn(DynIden, DynIden, DynIden),
    Asterisk,
    TableAsterisk(DynIden),
}
Expand description

Reference to a column in a SQL query.

This enum represents different ways to reference a column, from simple column names to fully qualified references.

Variants§

§

Column(DynIden)

Simple column reference (e.g., name)

§

TableColumn(DynIden, DynIden)

Table-qualified column reference (e.g., users.name)

§

SchemaTableColumn(DynIden, DynIden, DynIden)

Schema and table-qualified column reference (e.g., public.users.name)

§

Asterisk

Asterisk for selecting all columns (e.g., *)

§

TableAsterisk(DynIden)

Table-qualified asterisk (e.g., users.*)

Implementations§

Source§

impl ColumnRef

Source

pub fn column<I: IntoIden>(column: I) -> Self

Create a simple column reference.

§Example
use reinhardt_query::ColumnRef;

let col = ColumnRef::column("name");
Source

pub fn table_column<T: IntoIden, C: IntoIden>(table: T, column: C) -> Self

Create a table-qualified column reference.

§Example
use reinhardt_query::ColumnRef;

let col = ColumnRef::table_column("users", "name");
Source

pub fn schema_table_column<S: IntoIden, T: IntoIden, C: IntoIden>( schema: S, table: T, column: C, ) -> Self

Create a schema and table-qualified column reference.

§Example
use reinhardt_query::ColumnRef;

let col = ColumnRef::schema_table_column("public", "users", "name");
Source

pub fn asterisk() -> Self

Create an asterisk reference for all columns.

§Example
use reinhardt_query::ColumnRef;

let col = ColumnRef::asterisk();
Source

pub fn table_asterisk<T: IntoIden>(table: T) -> Self

Create a table-qualified asterisk reference.

§Example
use reinhardt_query::ColumnRef;

let col = ColumnRef::table_asterisk("users");

Trait Implementations§

Source§

impl Clone for ColumnRef

Source§

fn clone(&self) -> ColumnRef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ColumnRef> for SimpleExpr

Source§

fn from(c: ColumnRef) -> Self

Converts to this type from the input type.
Source§

impl IntoColumnRef for ColumnRef

Source§

fn into_column_ref(self) -> ColumnRef

Convert this type into a ColumnRef.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.