prisma / tiberius

TDS 7.2+ (Microsoft SQL Server) driver for Rust
Apache License 2.0
311 stars 113 forks source link

Bulk Copy Options #302

Open aersam opened 1 year ago

aersam commented 1 year ago

Hi there!

Thanks for this great library! I use it to write to MS SQL Server using Bulk Insert (here is the code). One thing I'm missing is the options for bulk copy: https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopyoptions?view=dotnet-plat-ext-7.0#fields . It seems to be pretty simple to implement, you can add this to the INSERT BULK statement, see C# implementation. Eg it would be something like INSERT BULK ({})({}) WITH (TABLOCK, KEEP_NULLS)

I could also do a PR, tough my rust is not that great yet, just learned it last week :)