pub struct BulkColumn {
pub name: String,
pub sql_type: String,
pub nullable: bool,
pub ordinal: usize,
/* private fields */
}Expand description
Column definition for bulk insert.
Fields§
§name: StringColumn name.
sql_type: StringSQL Server type (e.g., “INT”, “NVARCHAR(100)”).
nullable: boolWhether the column allows NULL values.
ordinal: usizeColumn ordinal (0-based).
Implementations§
Source§impl BulkColumn
impl BulkColumn
Sourcepub fn new<S: Into<String>>(
name: S,
sql_type: S,
ordinal: usize,
) -> Result<Self, TypeError>
pub fn new<S: Into<String>>( name: S, sql_type: S, ordinal: usize, ) -> Result<Self, TypeError>
Create a new bulk column definition.
§Errors
Returns TypeError::UnsupportedType when sql_type names a deprecated
large object type (TEXT, NTEXT, IMAGE). Use VARCHAR(MAX) /
NVARCHAR(MAX) / VARBINARY(MAX) instead — Microsoft deprecated
TEXT / NTEXT / IMAGE in SQL Server 2005 and recommends the MAX
types for all new development.
Sourcepub fn with_nullable(self, nullable: bool) -> Self
pub fn with_nullable(self, nullable: bool) -> Self
Set whether this column allows NULL values.
Sourcepub fn with_collation(self, collation: Collation) -> Self
pub fn with_collation(self, collation: Collation) -> Self
Set the collation used for VARCHAR/CHAR columns.
Required when Client::bulk_insert_without_schema_discovery
targets VARCHAR columns on a server whose default collation is not
Latin1_General_CI_AS and the target column uses a different code page.
Ignored for NVARCHAR/NCHAR columns (always UTF-16).
Trait Implementations§
Source§impl Clone for BulkColumn
impl Clone for BulkColumn
Source§fn clone(&self) -> BulkColumn
fn clone(&self) -> BulkColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more