This pr tries to address the following problem:
When inserting NaiveDateTime into ms datetime columns with bulk_insert and tds73 is turned on by default, it would raise Err` value: BulkInput("invalid data type, expecting Some(VarLenSized(VarLenContext { type: Datetimen, len: 8, collation: None })) but found DateTime2(Some(DateTime2 { date: Date(693604), time: Time { increments: 330110000000, scale: 7 } }))
cannot just disable tds73 feature as date/time might in the same table with datetime simultaneously and into_sql/to_sql is impl for date/time in without tds73 only.
This pr tries to address the following problem: When inserting
NaiveDateTime
into msdatetime
columns withbulk_insert
andtds73
is turned on by default, it would raiseErr` value: BulkInput("invalid data type, expecting Some(VarLenSized(VarLenContext { type: Datetimen, len: 8, collation: None })) but found DateTime2(Some(DateTime2 { date: Date(693604), time: Time { increments: 330110000000, scale: 7 } }))
cannot just disable
tds73
feature asdate
/time
might in the same table withdatetime
simultaneously andinto_sql
/to_sql
is impl fordate
/time
in withouttds73
only.normal inserting with
execute
does not get this issue as it callsDateTime2
toNone
when converting. https://github.com/prisma/tiberius/blob/98943b21b5f7a5135d3ae4bd51acbf268bb99189/src/tds/codec/column_data.rs#L615-L619Don't know whether it is a good solution. Or maybe any other impl can solve this issue is appreciated. Thank you so much~