mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	测试验证QuestDb Issue
This commit is contained in:
		@@ -0,0 +1,41 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Xunit;
 | 
			
		||||
 | 
			
		||||
namespace FreeSql.Tests.QuestDb.QuestDbIssue
 | 
			
		||||
{
 | 
			
		||||
    internal class QuestDbIssue : QuestDbTest
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        [Fact]
 | 
			
		||||
        public void Issue1757()
 | 
			
		||||
        {
 | 
			
		||||
            restFsql.CodeFirst.SyncStructure<Test0111>();
 | 
			
		||||
            var count=  fsql.Insert(new List<Test0111>() {
 | 
			
		||||
                new Test0111(){ 
 | 
			
		||||
                    CreateTime=DateTime.Now,
 | 
			
		||||
                    CustomId=2,  Name="test111",
 | 
			
		||||
                    Price=2,
 | 
			
		||||
                    Value=2 }
 | 
			
		||||
            }).ExecuteQuestBulkCopyAsync();
 | 
			
		||||
 | 
			
		||||
            var list = fsql.Select<Test0111>().ToList();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class Test0111
 | 
			
		||||
    {
 | 
			
		||||
        public long Id { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string Name { get; set; }
 | 
			
		||||
        public decimal Price { get; set; } 
 | 
			
		||||
        public DateTime CreateTime { get; set; } 
 | 
			
		||||
        public long CustomId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public double Value { get; set; } 
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -4,6 +4,7 @@ using System.Diagnostics;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Xunit;
 | 
			
		||||
 | 
			
		||||
namespace FreeSql.Tests.QuestDb
 | 
			
		||||
{
 | 
			
		||||
@@ -11,16 +12,19 @@ namespace FreeSql.Tests.QuestDb
 | 
			
		||||
    {
 | 
			
		||||
        public static IFreeSql fsql = new FreeSql.FreeSqlBuilder()
 | 
			
		||||
            .UseConnectionString(FreeSql.DataType.QuestDb,
 | 
			
		||||
                @"host=192.168.0.36;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;")
 | 
			
		||||
                @"host=192.168.1.114;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;")
 | 
			
		||||
            .UseMonitorCommand(cmd => Debug.WriteLine($"Sql:{cmd.CommandText}")) //监听SQL语句
 | 
			
		||||
            .UseNoneCommandParameter(true)
 | 
			
		||||
            .Build();
 | 
			
		||||
 | 
			
		||||
        public static IFreeSql restFsql = new FreeSql.FreeSqlBuilder()
 | 
			
		||||
            .UseConnectionString(FreeSql.DataType.QuestDb,
 | 
			
		||||
                @"host=192.168.0.36;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;")
 | 
			
		||||
                @"host=192.168.1.114;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;")
 | 
			
		||||
            .UseMonitorCommand(cmd => Debug.WriteLine($"Sql:{cmd.CommandText}")) //监听SQL语句
 | 
			
		||||
            .UseQuestDbRestAPI("192.168.0.36:9001", "admin", "ushahL(aer2r")
 | 
			
		||||
            .UseQuestDbRestAPI("192.168.1.114:9000")
 | 
			
		||||
            .Build();
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user