Giter Club home page Giter Club logo

cajuncoding / sqlbulkhelpers Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 9.0 718 KB

Lightweight library for working with high performance bulk updates & materialized data in SQL Server with support for Identity columns, Annotations, Materialization from disparate systems, etc.

Home Page: https://github.com/cajuncoding/SqlBulkHelpers

License: MIT License

C# 99.66% TSQL 0.34%
sql sqlbulkcopy sqlbulk sql-bulk-update sql-bulk-insert identity identity-column sqlserver dapper dapper-crud

sqlbulkhelpers's People

Contributors

cajuncoding avatar dependabot[bot] avatar simelis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sqlbulkhelpers's Issues

Fails when there are no identity columns

When the table does not have an identity column, the SqlBulkHelpersMergeScriptBuilder generates an empty identitycolumn name and it generates the sql for the temporary table as
SELECT TOP(0) 1 as [{identityColumnName}],

This gives a SQL exception, maybe skip it or generate a unique name ?

Feature Request: Add support for BIGINT Identity Columns

Currently the library only supports INT identity columns. Would be nice to support BIGINT for different design scenarios. i.e. multi-tenant SAAS applications. GUIDS are another use case, but probably not easy to implement.

Thanks!

System.TypeInitializationException thrown when Instantiating SqlBulkIdentityHelper

Throws straight up when newing up the Helper with a TypeInitializationException. Pity.

Inner Exception

The application configuration is missing a value for setting [SqlConnectionString], so default Sql Connection cannot be initialized; check the App.config Xml file and try again.

                    await using var connection = database.GetConnection();

                    await connection.OpenAsync();

                    await using var transaction = connection.BeginTransaction(IsolationLevel.ReadUncommitted);

                    ISqlBulkHelper<SomeType> sqlBulkIdentityHelper = new SqlBulkIdentityHelper<SomeType>();

                    await sqlBulkIdentityHelper.BulkInsertOrUpdateAsync(myData, "SomeTable", transaction);

Dynamic Mapping

Nice library you created here.

I have been looking through the code and there doesn't appear to be a way to dynamically map columns. All of the "Bulk" methods take an IEnumerable as the first argument. I saw where you can decorate the entity properties with a ModelMapping attribute, but what if the mapping isn't know until runtime?

In my case I have a front end client that allows the user to map the columns themselves.

Is there a way to pass in the model mappings at runtime and hook the ColumnMappings.Add() method??

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.