Skip to main content

Column

Struct Column 

Source
pub struct Column {
Show 17 fields pub name: String, pub ty: u32, pub typmod: i32, pub ndims: i16, pub collation: u32, pub not_null: bool, pub not_null_invalid: bool, pub has_default: bool, pub identity: u8, pub generated: u8, pub dropped: bool, pub stat_target: Option<i16>, pub storage: u8, pub compression: u8, pub options: Vec<String>, pub local: bool, pub inhcount: i16,
}
Expand description

A column of a relation, one row of pg_attribute with a positive attnum.

Fields§

§name: String

The name.

§ty: u32

The OID of the type.

§typmod: i32

The type modifier, or -1.

§ndims: i16

The number of array dimensions that the statement gives, attndims.

§collation: u32

The OID of the collation, or 0.

§not_null: bool

attnotnull.

§not_null_invalid: bool

True when attnotnull comes from a NOT VALID not-null constraint, as attnullability is ATTNULLABLE_INVALID. The new rows cannot have a null in the column, but the rows from before the constraint can.

§has_default: bool

atthasdef.

§identity: u8

attidentity: a for GENERATED ALWAYS, d for GENERATED BY DEFAULT, or 0 for a column that is not an identity column.

§generated: u8

attgenerated: s for a stored generated column, or 0 for a column that is not generated. The default of the column is its generation expression.

§dropped: bool

attisdropped. A dropped column keeps its place, so the later columns keep their numbers, but it has no name that a query can use and no type.

§stat_target: Option<i16>

attstattarget: the statistics target of SET STATISTICS, or None for the default.

§storage: u8

attstorage of STORAGE or SET STORAGE, or 0 for the storage of the type.

§compression: u8

attcompression: p for pglz, l for lz4, or 0 for the default method.

§options: Vec<String>

attoptions: each option as name=value.

§local: bool

attislocal: false for a column that only a parent table gives.

§inhcount: i16

attinhcount: the number of parent tables that give the column.

Implementations§

Source§

impl Column

Source

pub fn new( name: impl Into<String>, ty: u32, typmod: i32, collation: u32, ) -> Column

A column with no constraint and no default.

Trait Implementations§

Source§

impl Clone for Column

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Column

Source§

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

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

impl Eq for Column

Source§

impl PartialEq for Column

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Column

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.