dotnetcore / FreeSql

🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, QuestDB orm, MsAccess orm.
http://freesql.net
MIT License
3.99k stars 842 forks source link

Questdb 7.3.10 BulkCopy 问题 #1757

Closed 1185497683 closed 1 month ago

1185497683 commented 2 months ago

QuestDB版本:7.3.10

问题描述:插入之后,questdb界面查询显示时间是空

代码如下:
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; } 
  }
  [HttpGet(Name = "GetWeatherForecast")]
  public IEnumerable<WeatherForecast> Get()
  {
      IFreeSql fsql = new FreeSql.FreeSqlBuilder()

.UseConnectionString(FreeSql.DataType.QuestDb, @"host=localhost;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;") //连接字符串 .UseMonitorCommand(cmd => Console.WriteLine($"Sql:{cmd.CommandText}")) .UseQuestDbRestAPI("localhost:9000", "admin", "quest") //RestAPI,建议开启 .Build();

      fsql.CodeFirst.SyncStructure<Test0111>();
      var count=  fsql.Insert(new List<Test0111>() {
      new Test0111(){ 
                    CreateTime=DateTime.Now,
                      CustomId=1,  Name="test",
                       Price=1,
                        Value=1 }
      }).ExecuteBulkCopy();

      var list = fsql.Select<Test0111>().ToList();
d4ilys commented 2 months ago

我这边测试没有复现,你有没有安装其他 Provider? 例如FreeSql.Provider.Clickhouse

1185497683 commented 2 months ago

只有freesql和questdb,使用的是.net 8,windows 10环境, 没有安装任何其它东西。

d4ilys commented 1 month ago

加我q 963922242,看看什么情况

d4ilys commented 1 month ago

时期格式问题,Windows 日期格式中包含 星期

处理方式:

1.插入时格式化时间格式

2.调整QuestDb所在的服务器为正常时间格式

1185497683 commented 1 month ago

嗯,时间格式修改一下,如果然可以了,谢谢大神 05618ef86401750ce25c4e36bdd9613

1185497683 commented 1 month ago

thanks