pub struct TableFieldSchema {
pub name: String,
pub type: i32,
pub mode: i32,
pub fields: Vec<TableFieldSchema>,
pub description: String,
pub max_length: i64,
pub precision: i64,
pub scale: i64,
pub default_value_expression: String,
pub range_element_type: Option<FieldElementType>,
}
Expand description
TableFieldSchema defines a single field/column within a table schema.
Fields§
§name: String
Required. The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
type: i32
Required. The field data type.
mode: i32
Optional. The field mode. The default value is NULLABLE.
fields: Vec<TableFieldSchema>
Optional. Describes the nested schema fields if the type property is set to STRUCT.
description: String
Optional. The field description. The maximum length is 1,024 characters.
max_length: i64
Optional. Maximum length of values of this field for STRINGS or BYTES.
If max_length is not specified, no maximum length constraint is imposed on this field.
If type = “STRING”, then max_length represents the maximum UTF-8 length of strings in this field.
If type = “BYTES”, then max_length represents the maximum number of bytes in this field.
It is invalid to set this field if type is not “STRING” or “BYTES”.
precision: i64
Optional. Precision (maximum number of total digits in base 10) and scale (maximum number of digits in the fractional part in base 10) constraints for values of this field for NUMERIC or BIGNUMERIC.
It is invalid to set precision or scale if type is not “NUMERIC” or “BIGNUMERIC”.
If precision and scale are not specified, no value range constraint is imposed on this field insofar as values are permitted by the type.
Values of this NUMERIC or BIGNUMERIC field must be in this range when:
- Precision (P) and scale (S) are specified: [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)]
- Precision (P) is specified but not scale (and thus scale is interpreted to be equal to zero): [-10^P + 1, 10^P - 1].
Acceptable values for precision and scale if both are specified:
- If type = “NUMERIC”: 1 <= precision - scale <= 29 and 0 <= scale <= 9.
- If type = “BIGNUMERIC”: 1 <= precision - scale <= 38 and 0 <= scale <= 38.
Acceptable values for precision if only precision is specified but not scale (and thus scale is interpreted to be equal to zero):
- If type = “NUMERIC”: 1 <= precision <= 29.
- If type = “BIGNUMERIC”: 1 <= precision <= 38.
If scale is specified but not precision, then it is invalid.
scale: i64
Optional. See documentation for precision.
default_value_expression: String
Optional. A SQL expression to specify the [default value] (https://cloud.google.com/bigquery/docs/default-values) for this field.
range_element_type: Option<FieldElementType>
Optional. The subtype of the RANGE, if the type of this field is RANGE. If the type is RANGE, this field is required. Possible values for the field element type of a RANGE include:
- DATE
- DATETIME
- TIMESTAMP
Implementations§
Trait Implementations§
Source§impl Clone for TableFieldSchema
impl Clone for TableFieldSchema
Source§fn clone(&self) -> TableFieldSchema
fn clone(&self) -> TableFieldSchema
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TableFieldSchema
impl Debug for TableFieldSchema
Source§impl Default for TableFieldSchema
impl Default for TableFieldSchema
Source§impl Message for TableFieldSchema
impl Message for TableFieldSchema
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for TableFieldSchema
impl PartialEq for TableFieldSchema
impl StructuralPartialEq for TableFieldSchema
Auto Trait Implementations§
impl Freeze for TableFieldSchema
impl RefUnwindSafe for TableFieldSchema
impl Send for TableFieldSchema
impl Sync for TableFieldSchema
impl Unpin for TableFieldSchema
impl UnwindSafe for TableFieldSchema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request