mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-27 13:12:51 +08:00

- 增加 PostgreSQL 的 Odbc 访问提供,相比 FreeSql.Provider.PostgreSQL 支持的类型更少; - 增加 通用的 Odbc 访问提供,不能迁移实体到数据库,不能 Skip 这样来分页,理论上能 crud 所有 odbc 数据库;
71 lines
1.5 KiB
C#
71 lines
1.5 KiB
C#
using FreeSql.DataAnnotations;
|
|
using System;
|
|
using Xunit;
|
|
|
|
namespace FreeSql.Tests.Odbc.PostgreSQL
|
|
{
|
|
public class PostgreSQLAdoTest
|
|
{
|
|
[Fact]
|
|
public void Pool()
|
|
{
|
|
var t1 = g.pgsql.Ado.MasterPool.StatisticsFullily;
|
|
}
|
|
|
|
[Fact]
|
|
public void SlavePools()
|
|
{
|
|
var t2 = g.pgsql.Ado.SlavePools.Count;
|
|
}
|
|
|
|
[Fact]
|
|
public void ExecuteReader()
|
|
{
|
|
|
|
}
|
|
[Fact]
|
|
public void ExecuteArray()
|
|
{
|
|
|
|
}
|
|
[Fact]
|
|
public void ExecuteNonQuery()
|
|
{
|
|
|
|
}
|
|
[Fact]
|
|
public void ExecuteScalar()
|
|
{
|
|
|
|
}
|
|
|
|
[Fact]
|
|
public void Query()
|
|
{
|
|
|
|
g.pgsql.CodeFirst.SyncStructure<xxx>();
|
|
var t3 = g.pgsql.Ado.Query<xxx>("select * from xxx");
|
|
|
|
var t4 = g.pgsql.Ado.Query<(int, string, string)>("select * from xxx");
|
|
|
|
var t5 = g.pgsql.Ado.Query<dynamic>("select * from xxx");
|
|
}
|
|
|
|
[Fact]
|
|
public void QueryMultipline()
|
|
{
|
|
g.pgsql.CodeFirst.SyncStructure<xxx>();
|
|
var t3 = g.pgsql.Ado.Query<xxx, (int, string, string), dynamic>("select * from xxx; select * from xxx; select * from xxx");
|
|
}
|
|
|
|
class xxx
|
|
{
|
|
public string Id { get; set; }
|
|
public string Path { get; set; }
|
|
public string Title2 { get; set; }
|
|
|
|
public string testf { get; set; }
|
|
}
|
|
}
|
|
}
|