Updated 添加 (markdown)

2881099
2023-12-14 19:45:30 +08:00
parent 7fb9e1b6d7
commit cf23e82fd1

@@ -118,7 +118,13 @@ FreeSql 适配了每一种数据类型参数化,和不参数化的使用。批
> 测试结果,是在相同操作系统下进行的,并且都有预热
## 4、插入指定的列
## 4、动态表名
```csharp
fsql.Insert(items).AsTable("Topic_201903").ExecuteAffrows(); //对 Topic_201903 表插入
```
## 5、插入指定的列
```csharp
var t3 = fsql.Insert(items).InsertColumns(a => a.Title).ExecuteAffrows();
@@ -134,7 +140,7 @@ var t4 = fsql.Insert(items).InsertColumns(a =>new { a.Title, a.Clicks }).Execute
//(@Clicks9, @Title9)
```
## 5、忽略列
## 6、忽略列
```csharp
var t5 = fsql.Insert(items).IgnoreColumns(a => a.CreateTime).ExecuteAffrows();
@@ -150,7 +156,7 @@ var t6 = fsql.Insert(items).IgnoreColumns(a => new { a.Title, a.CreateTime }).Ex
//(@Clicks5), (@Clicks6), (@Clicks7), (@Clicks8), (@Clicks9)
```
## 6、列插入优先级
## 7、列插入优先级
```csharp
全部列 < 指定列(InsertColumns) < 忽略列(IgnoreColumns)
@@ -162,7 +168,7 @@ var t6 = fsql.Insert(items).IgnoreColumns(a => new { a.Title, a.CreateTime }).Ex
在使用 `IgnoreColumns` 的情况下,只有未被指定的列插入数据库;
## 7、字典插入
## 8、字典插入
```csharp
var dic = new Dictionary<string, object>();
@@ -172,7 +178,7 @@ dic.Add("name", "xxxx");
fsql.InsertDict(dic).AsTable("table1").ExecuteAffrows();
```
## 8、导入表数据
## 9、导入表数据
```csharp
int affrows = fsql.Select<Topic>()
@@ -192,7 +198,7 @@ limit 10
注意:因为 `Clicks``CreateTime` 没有被选择,所以使用目标实体属性` [Column(InsertValueSql = xx)]` 设置的值,或者使用目标实体属性的 `c# `默认值。
## 9、MySql 特有功能 Insert Ignore Into
## 10、MySql 特有功能 Insert Ignore Into
```csharp
fsql.Insert<Topic>().MySqlIgnoreInto().AppendData(items).ExecuteAffrows();
@@ -201,11 +207,11 @@ fsql.Insert<Topic>().MySqlIgnoreInto().AppendData(items).ExecuteAffrows();
//(@Clicks5), (@Clicks6), (@Clicks7), (@Clicks8), (@Clicks9)
```
## 10、MySql 特有功能 `On Duplicate Key Update`
## 11、MySql 特有功能 `On Duplicate Key Update`
[请移步查看详情](%e6%b7%bb%e5%8a%a0%e6%88%96%e4%bf%ae%e6%94%b9#6mysql-%E7%89%B9%E6%9C%89%E5%8A%9F%E8%83%BD-on-duplicate-key-update)
## 11、PostgreSQL 特有功能 On Conflict Do Update
## 12、PostgreSQL 特有功能 On Conflict Do Update
[请移步查看详情](%e6%b7%bb%e5%8a%a0%e6%88%96%e4%bf%ae%e6%94%b9#7postgresql-%E7%89%B9%E6%9C%89%E5%8A%9F%E8%83%BD-on-conflict-do-update)