{"id":13458337,"url":"https://github.com/zzzprojects/Bulk-Operations","last_synced_at":"2025-03-24T15:31:05.828Z","repository":{"id":59352162,"uuid":"51544670","full_name":"zzzprojects/Bulk-Operations","owner":"zzzprojects","description":"C# SQL Bulk Operations | High-performance C# bulk insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL, and SQLite.","archived":false,"fork":false,"pushed_at":"2025-03-11T08:05:15.000Z","size":365,"stargazers_count":144,"open_issues_count":4,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-21T07:09:42.707Z","etag":null,"topics":["csharp","dotnet","sqlbulkcopy"],"latest_commit_sha":null,"homepage":"https://bulk-operations.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzzprojects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-11T20:26:54.000Z","updated_at":"2025-01-30T01:23:11.000Z","dependencies_parsed_at":"2023-01-23T18:46:06.346Z","dependency_job_id":"caaf6a1d-db00-46b5-9187-7d555c408779","html_url":"https://github.com/zzzprojects/Bulk-Operations","commit_stats":null,"previous_names":[],"tags_count":174,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FBulk-Operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FBulk-Operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FBulk-Operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FBulk-Operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzzprojects","download_url":"https://codeload.github.com/zzzprojects/Bulk-Operations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245297964,"owners_count":20592509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","sqlbulkcopy"],"created_at":"2024-07-31T09:00:51.031Z","updated_at":"2025-03-24T15:31:05.498Z","avatar_url":"https://github.com/zzzprojects.png","language":"C#","readme":"## What's Bulk Operations?\nBulk Operations is a library that allows to overcomes SqlBulkCopy limitations by adding high-performance bulk operations to insert, update, delete and merge.\n\n##### Scalable\nSQL Server - Benchmarks\n\n| Operations | 1,000 Rows | 10,000 Rows | 100,000 Rows | 1,000,000 Rows |\n| ---------- | ---------: | ----------: | -----------: | -------------: |\n|**Insert**  | 6 ms       | 25 ms       | 200 ms       | 2,000 ms       |\n|**Update**  | 50 ms      | 80 ms       | 575 ms       | 6,500 ms       |\n|**Delete**  | 45 ms      | 70 ms       | 625 ms       | 6,800 ms       |\n|**Merge**   | 65 ms      | 160 ms      | 1,200 ms     | 12,000 ms      |\n\n\u003e _As fast as SqlBulkCopy for insert but with way more capabilities_\n\n##### Extensible\nSupport Multiple SQL Providers:\n- SQL Server 2008+\n- SQL Azure\n- SQL Compact\n- MySQL\n- SQLite\n- PostgreSQL\n- Oracle\n\nSupport Multiple Datasources:\n- Entity\n- DataTable\n- DataRow\n- DataReader\n- DataSet\n- Expando Object\n\n## Download\n\u003ca href=\"https://www.nuget.org/packages/Z.BulkOperations/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/bulk-operations-v.svg\" alt=\"download\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.nuget.org/packages/Z.BulkOperations/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/bulk-operations-d.svg\" alt=\"\" /\u003e\u003c/a\u003e\n\n```\nPM\u003e Install-Package Z.BulkOperations\n```\n\n_* PRO Version unlocked for the current month_\n\n## Insert - Output Identity Value\n\n##### Problem\nYou need to output the newly generated identity value, but SqlBulkCopy does not support it.\n\n##### Solution\nMap your identity column with output direction.\n\n```\nvar bulk = new BulkOperation(connection);\n\nbulk.ColumnMappings.Add(\"CustomerID\", ColumnMappingDirectionType.Output);\n// ... mappings ...\n\nbulk.BulkInsert(dt);\n```\n\n##### Flexibility\nYou can also output concurrency column (Timestamp) or any other column values. All kinds of mapping directions are supported, including \"Formula\" to use with a SQL Formula.\n\n## Entity DataSource / Lambda Mapping\n##### Problem\nYou have a list of entities to insert, but SqlBulkCopy doesn't support entity and lambda expression mapping.\n\n##### Solution\nCreate generic bulk operations with your entity type and use lambda expression for your column input, output, and primary key mapping.\n\n```csharp\nvar bulk = new BulkOperation\u003cCustomer\u003e(connection);\n\nbulk.ColumnInputExpression = c =\u003e new { c.Name,  c.FirstName };\nbulk.ColumnOutputExpression = c =\u003e c.CustomerID;\nbulk.ColumnPrimaryKeyExpression = c =\u003e c.Code;\n\nbulk.BulkMerge(customers);\n```\n\n##### Maintainability\nGet rid of hardcoded string and use strongly-typed lambda expressions.\n\n## AutoMapping \u0026 Case Sensitivity\n##### Problem\nYou have a DataTable which columns name match name in the database, but SqlBulkCopy throws an error because name matches are case insensitive.\n\n##### Solution\nTurn off case sensitivity with **IsCaseSensitive** property.\n\n```csharp\nvar bulk = new BulkOperation(connection);\n\nbulk.IsCaseSensitive = false;\n\nbulk.BulkMerge(dt);\n```\n\n##### Readability\nRemove useless code that would have required you to create your own mapping and keep the essentials.\n\n## PRO\n_PRO Version unlocked for the current month_\n\nFeatures                    | [PRO Version](https://bulk-operations.net/#pro)\n--------                    | :-------------: |\nBulk Insert                 | Yes\nBulk Update                 | Yes\nBulk Delete                 | Yes\nBulk Merge                  | Yes\nBulk SaveChanges            | Yes\nBulk Synchronize            | Yes\nDeleteFromQuery             | Yes\nUpdateFromQuery             | Yes\nCommercial License          | Yes\nRoyalty-Free                | Yes\nSupport \u0026 Upgrades (1 year) | Yes\n\nLearn more about the **[PRO Version](https://bulk-operations.net/#pro)**\n\n## Contribute\n\nThe best way to contribute is by **spreading the word** about the library:\n\n - Blog it\n - Comment it\n - Star it\n - Share it\n \nA **HUGE THANKS** for your help.\n\n## More Projects\n\n- Projects:\n   - [EntityFramework Extensions](https://entityframework-extensions.net/)\n   - [Dapper Plus](https://dapper-plus.net/)\n   - [C# Eval Expression](https://eval-expression.net/)\n- Learn Websites\n   - [Learn EF Core](https://www.learnentityframeworkcore.com/)\n   - [Learn Dapper](https://www.learndapper.com/)\n- Online Tools:\n   - [.NET Fiddle](https://dotnetfiddle.net/)\n   - [SQL Fiddle](https://sqlfiddle.com/)\n   - [ZZZ Code AI](https://zzzcode.ai/)\n- and much more!\n\nTo view all our free and paid projects, visit our website [ZZZ Projects](https://zzzprojects.com/).\n","funding_links":[],"categories":["C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzprojects%2FBulk-Operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzzprojects%2FBulk-Operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzprojects%2FBulk-Operations/lists"}