update

28810
2019-02-28 18:10:32 +08:00
parent 255b50c5b8
commit 3d294775a5
2 changed files with 5 additions and 5 deletions

@@ -41,12 +41,12 @@ public class SongRepository : BaseRepository<Song, int> {
## 兼容问题
FreeSql 支持五种数据库,分别为 MySql/SqlServer/PostgreSQL/Oracle/Sqlite虽然他们都为关系型数据库但各自有着独特的技术亮点有许多亮点值得我们使用
FreeSql 支持五种数据库,分别为 MySql/SqlServer/PostgreSQL/Oracle/Sqlite虽然他们都为关系型数据库但各自有着独特的技术亮点有许多亮点值得我们使用
比如 SqlServer 提供的 output inserted 特性,在表使用了自增或数据库定义了默认值的时候,使用它可以快速将 insert 的数据返回。这样的功能如此方便,但并不是每个数据库都支持,已经支持的有 SqlServer、PostgreSQL。FreeSql 在 IInsert 接口定义了 ExecuteInserted 接口,针对其他几种数据库,使用该方法会抛出异常
比如 SqlServer 提供的 output inserted 特性,在表使用了自增或数据库定义了默认值的时候,使用它可以快速将 insert 的数据返回。PostgreSQL 也有相应的功能如此方便不是每个数据库都支持。
BaseRepository 采用了 ExecuteInserted 执行;
GuidRepository 采用了 ExecuteAffrows 执行(兼容性好);
- BaseRepository 采用了 ExecuteInserted 执行;
- GuidRepository 采用了 ExecuteAffrows 执行(兼容性好);
当采用了不支持的数据库时Sqlite/MySql/Oracle建议如下

@@ -22,7 +22,7 @@
* [缓存](https://github.com/2881099/FreeSql/wiki/%e7%bc%93%e5%ad%98)
* [延时加载](https://github.com/2881099/FreeSql/wiki/%e5%bb%b6%e6%97%b6%e5%8a%a0%e8%bd%bd)
* [贪婪加载](https://github.com/2881099/FreeSql/wiki/%e8%b4%aa%e5%a9%aa%e5%8a%a0%e8%bd%bd)
* [Repository](https://github.com/2881099/FreeSql/wiki/Repository)
* [仓储层Repository](https://github.com/2881099/FreeSql/wiki/Repository)
* [CodeFirst](https://github.com/2881099/FreeSql/wiki/CodeFirst)
* [实体特性](https://github.com/2881099/FreeSql/wiki/CodeFirst#%e5%ae%9e%e4%bd%93%e7%89%b9%e6%80%a7)
* [外部配置实体](https://github.com/2881099/FreeSql/wiki/CodeFirst#%e5%a4%96%e9%83%a8%e9%85%8d%e7%bd%ae%e5%ae%9e%e4%bd%93)