mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
SQL命令执行监视 + Pgsql表达式(Array/HStore/Jsonb)实现与测试
This commit is contained in:
@ -4,6 +4,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NpgsqlTypes;
|
||||
using Npgsql.LegacyPostgis;
|
||||
|
||||
namespace FreeSql.Tests {
|
||||
public class UnitTest1 {
|
||||
@ -25,15 +28,11 @@ namespace FreeSql.Tests {
|
||||
.Having(a => a.Count() < 300 || a.Avg(a.Key.mod4) < 100)
|
||||
.OrderBy(a => a.Key.tt2)
|
||||
.OrderByDescending(a => a.Count())
|
||||
.ToSql(a => new { a.Key.tt2, cou1 = a.Count(), arg1 = a.Avg(a.Key.mod4),
|
||||
.ToList(a => new { a.Key.tt2, cou1 = a.Count(), arg1 = a.Avg(a.Key.mod4),
|
||||
ccc2 = a.Key.tt2 ?? "now()",
|
||||
ccc = Convert.ToDateTime("now()"), partby = Convert.ToDecimal("sum(num) over(PARTITION BY server_id,os,rid,chn order by id desc)")
|
||||
//ccc = Convert.ToDateTime("now()"), partby = Convert.ToDecimal("sum(num) over(PARTITION BY server_id,os,rid,chn order by id desc)")
|
||||
});
|
||||
|
||||
|
||||
var sss = new[] { 1, 2, 3 };
|
||||
sss.Count();
|
||||
|
||||
|
||||
var arrg = g.mysql.Select<TestInfo>().ToAggregate(a => new { sum = a.Sum(a.Key.Id + 11.11), avg = a.Avg(a.Key.Id), count = a.Count(), max = a.Max(a.Key.Id), min = a.Min(a.Key.Id) });
|
||||
|
||||
var arrg222 = g.mysql.Select<NullAggreTestTable>().ToAggregate(a => new { sum = a.Sum(a.Key.Id + 11.11), avg = a.Avg(a.Key.Id), count = a.Count(), max = a.Max(a.Key.Id), min = a.Min(a.Key.Id) });
|
||||
|
Reference in New Issue
Block a user