pub struct FieldSchemaBuilder { /* private fields */ }Expand description
Builder for FieldSchema.
Implementations§
Source§impl FieldSchemaBuilder
impl FieldSchemaBuilder
Sourcepub fn field_name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn field_name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
must start with a letter, only lowercase and uppercase letters, numbers and underscores are allowed
Sourcepub fn field_type<VALUE: Into<FieldType>>(&mut self, value: VALUE) -> &mut Self
pub fn field_type<VALUE: Into<FieldType>>(&mut self, value: VALUE) -> &mut Self
BOOL、INT8、UINT8、INT16、UINT16、INT32、UINT32、INT64、UINT64、FLOAT、DOUBLE、DATE、DATETIME、TIMESTAMP、UUID、STRING、BINARY、TEXT、TEXT_GBK、TEXT_GB18030、FLOAT_VECTOR
Sourcepub fn primary_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn primary_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
only a single field is supported for primary key currently, unsupport field with type: BOOL、FLOAT、DOUBLE、FLOAT_VECTOR
Sourcepub fn partition_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn partition_key<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
only a single field is supported as a partition key, which can be a primary key or not, a table can only have one partition key, each record will be hashed and mapped to diffrent partition, unsupport field with type: BOOL、FLOAT、DOUBLE、FLOAT_VECTOR
Sourcepub fn auto_increment<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn auto_increment<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
is autoincreament, only applicable to primary key fields of type UINT64
Sourcepub fn not_null<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn not_null<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
primary key field, partition key field, secondary index key field and vector field cannot be nullable
Sourcepub fn dimension<VALUE: Into<Option<u32>>>(&mut self, value: VALUE) -> &mut Self
pub fn dimension<VALUE: Into<Option<u32>>>(&mut self, value: VALUE) -> &mut Self
vector dimension. This parameter needs to be specified only when the data type is FLOAT_VECTOR.
Sourcepub fn build(&self) -> Result<FieldSchema, FieldSchemaBuilderError>
pub fn build(&self) -> Result<FieldSchema, FieldSchemaBuilderError>
Trait Implementations§
Source§impl Clone for FieldSchemaBuilder
impl Clone for FieldSchemaBuilder
Source§fn clone(&self) -> FieldSchemaBuilder
fn clone(&self) -> FieldSchemaBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more