mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
## v0.9.17 (ODBC)
- 增加 FreeSql.Provider.Odbc,实现 Oracle/SqlServer/MySql 的 Odbc 访问提供; - 增加 FreeSqlBuilder.UseConnectionString 参数 providerType,可解决因包版本冲突时,可能无法反射获得 FreeSql.Provider 对应的类型,通常这个参数不需要设置; - 优化 MaxLength 特性,当指定为 -1 时 DbType 会分别映射类型 text/nvarchar(max)/nvarchar2(4000);
This commit is contained in:
@ -0,0 +1,66 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Data.Odbc;
|
||||
using Xunit;
|
||||
|
||||
namespace FreeSql.Tests.Odbc.MySql
|
||||
{
|
||||
public class MySqlAdoTest
|
||||
{
|
||||
[Fact]
|
||||
public void Pool()
|
||||
{
|
||||
var t1 = g.mysql.Ado.MasterPool.StatisticsFullily;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SlavePools()
|
||||
{
|
||||
var t2 = g.mysql.Ado.SlavePools.Count;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExecuteReader()
|
||||
{
|
||||
|
||||
}
|
||||
[Fact]
|
||||
public void ExecuteArray()
|
||||
{
|
||||
|
||||
}
|
||||
[Fact]
|
||||
public void ExecuteNonQuery()
|
||||
{
|
||||
|
||||
}
|
||||
[Fact]
|
||||
public void ExecuteScalar()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Query()
|
||||
{
|
||||
var t3 = g.mysql.Ado.Query<xxx>("select * from song");
|
||||
|
||||
var t4 = g.mysql.Ado.Query<(int, string, string)>("select * from song");
|
||||
|
||||
var t5 = g.mysql.Ado.Query<dynamic>("select * from song");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QueryMultipline()
|
||||
{
|
||||
Assert.Throws<OdbcException>(() => g.mysql.Ado.Query<xxx, (int, string, string), dynamic>("select * from song; select * from song; select * from song"));
|
||||
}
|
||||
|
||||
class xxx
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Path { get; set; }
|
||||
public string Title2 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user