Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
YahuiWong authored May 15, 2021
1 parent 8456c14 commit eb5f76f
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
# Dapper.Contrib.BulkInsert
Make ClickHouse available to Dapper.Dapper's extensions.
>ClickHouse is a free analytic DBMS for big data.

Easy to use Dapper batch insert, support MySQL, SQLServer, ClickHouse


## Demo

### Entity

```c#
[Table("TestUser")]
public class TestUser
{
[Date]
public DateTime ResisterDate { get; set; }
public DateTime ResisterTime { get; set; }
public string Name { get; set; }
public int Age { get; set; }
}
}
```
### InsertBulk
```c#
MySqlConnection conn = new MySqlConnection("server=127.0.0.1;Database=Demo;Uid=root;Pwd=root");
conn.Open();
conn.Execute("CREATE TABLE IF NOT EXISTS TestUser (ResisterDate Date, ResisterTime DateTime, Name varchar(200), Age int(11)) ENGINE=InnoDB");
var user = new TestUser() { ResisterDate = DateTime.Now, ResisterTime = DateTime.Now, Age = 18, Name = "Jack" };
var user2 = new TestUser() { ResisterDate = DateTime.Now, ResisterTime = DateTime.Now, Age = 18, Name = "Tom" };

var users = new List<TestUser>() { user, user2 };
conn.InsertBulk(users);
```



Dapper: https://github.com/StackExchange/Dapper

Expand Down

0 comments on commit eb5f76f

Please sign in to comment.