All Projects → KostovMartin → Dapper.bulk

KostovMartin / Dapper.bulk

Licence: mit
Dapper.Bulk SqlServer

Labels

Projects that are alternatives of or similar to Dapper.bulk

Dapper
Dapper - a simple object mapper for .Net
Stars: ✭ 14,330 (+18271.79%)
Mutual labels:  sql, dapper
Dapper Plus
Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
Stars: ✭ 265 (+239.74%)
Mutual labels:  sql, dapper
Declarativesql
Attribute-based database access
Stars: ✭ 41 (-47.44%)
Mutual labels:  sql, dapper
Scan
Scan database/sql rows directly to structs, slices, and primitive types
Stars: ✭ 69 (-11.54%)
Mutual labels:  sql
Think Soar
SQL optimizer and rewriter extension package for thinkphp5/6 framework.
Stars: ✭ 71 (-8.97%)
Mutual labels:  sql
Sql to sqlalchemy
本教程是为了展现 sql 原始语句转换为 sqlalchemy 语句的各个实例。
Stars: ✭ 75 (-3.85%)
Mutual labels:  sql
Bvcms
The open source church management system
Stars: ✭ 77 (-1.28%)
Mutual labels:  sql
Atsd
Axibase Time Series Database Documentation
Stars: ✭ 68 (-12.82%)
Mutual labels:  sql
Sql Apiconsumer
Database Project with generic procedures to consume API through GET/POST methods.
Stars: ✭ 77 (-1.28%)
Mutual labels:  sql
Locopy
locopy: Loading/Unloading to Redshift and Snowflake using Python.
Stars: ✭ 73 (-6.41%)
Mutual labels:  sql
Kamu Cli
Next generation tool for decentralized exchange and transformation of semi-structured data
Stars: ✭ 69 (-11.54%)
Mutual labels:  sql
Ebean
Ebean ORM
Stars: ✭ 1,172 (+1402.56%)
Mutual labels:  sql
Spark Website
Apache Spark Website
Stars: ✭ 75 (-3.85%)
Mutual labels:  sql
Donald
A simple F# interface for ADO.NET.
Stars: ✭ 70 (-10.26%)
Mutual labels:  sql
Elasticsql
ElasticSQL package converts SQL to ElasticSearch DSL
Stars: ✭ 77 (-1.28%)
Mutual labels:  sql
Awesome Business Intelligence
Actively curated list of awesome BI tools. PRs welcome!
Stars: ✭ 1,157 (+1383.33%)
Mutual labels:  sql
Laravel Log To Db
Custom Laravel and Lumen 5.6+ Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel/Monolog native logging functionality.
Stars: ✭ 76 (-2.56%)
Mutual labels:  sql
Athenax
SQL-based streaming analytics platform at scale
Stars: ✭ 1,178 (+1410.26%)
Mutual labels:  sql
Purescript Selda
A type-safe, high-level SQL library for PureScript
Stars: ✭ 72 (-7.69%)
Mutual labels:  sql
Devops Resources
DevOps resources - Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP
Stars: ✭ 1,194 (+1430.77%)
Mutual labels:  sql

Dapper.Bulk- bulk inserts for Dapper

Features

Dapper.Bulk contains helper methods for bulk inserting.

Download

Dapper.Bulk Nuget

PM> Install-Package Dapper.Bulk

Usage

  • Inserts entities, without result for best performance:
connection.BulkInsert(data);
await connection.BulkInsertAsync(data);
  • Inserts and returns inserted entities:
var inserted = connection.BulkInsertAndSelect(data);
var inserted = await connection.BulkInsertAndSelectAsync(data);

Default Conventions

  • TableName is TypeName + s. When Interface I is removed.
  • Key is Id property (case-insensitive)

Custom Conventions

TableName - somewhere before usage call.

TableMapper.SetupConvention("tbl", "s")

Attributes

We do not rely on specific attributes. This means you can use whatever attributes with following names:

  • TableAttribute - Must have string Name property. Exists in System.ComponentModel.Annotations Nuget.
  • ColumnAttribute - Must have string Name property. Exists in System.ComponentModel.Annotations Nuget.
  • KeyAttribute - Marking only attribute. Exists in System.ComponentModel.Annotations Nuget.
  • ComputedAttribute - Marking only attribute. For fields returned from Db.
  • NotMapped - Marking only attribute. For ignored fields.
// Table Cars by default convention 
public class Car
{
    // Identity by convention
    public int Id { get; set; }
    
    public string Name { get; set; }
	
    public DateTime ManufactureDate { get; set; }
}
// Supported in v1.2+
public enum CarType : int
{
    Classic = 1,
    Coupe = 2
}

[Table("tblCars")]
public class Car
{
    [Key] // Identity
    public int CarId { get; set; }
    
    public string Name { get; set; }
	
    public CarType CarType { get; set; } //SQL Data Type should match Enum type
	
    [Computed] // Will be ignored for inserts, but the value in database after insert will be returned
    public DateTime ManufactureDate { get; set; }
}
public class IdentityAndNotMappedTest
{
    [Key]
    public int IdKey { get; set; }

    public string Name { get; set; }

	// Will be ignored for inserts
    public virtual TestSublass TestSublass { get; set; }

    [NotMapped] // Will be ignored for inserts
    public int Ignored { get; set; }
}
// Supported in v1.4+
private class CustomColumnName
{
    [Key]
    public int IdKey { get; set; }

    [Column("Name_1")] // Will map to SQL column Name_1
    public string Name { get; set; } 

    [Column("Int_Col")] // Will map to SQL column Int_Col
    public int IntCol { get; set; }

    [Column("Long_Col")] // Will map to SQL column Long_Col
    public long LongCol { get; set; }

    [NotMapped] // Will be ignored for inserts
    public int Ignored { get; set; }

    [Write(false)] // Will be ignored for inserts
    public int Ignored { get; set; }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].