dotnetcore / dotnetcore/FreeSql

PostgreSQL数据库,DateTime类型映射不正确

Open
#1,958 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
910
PR merge metrics
No merged PRs in 30d

Description

#### 问题描述及重现代码:
DateTime类型创建时映射成了timestamptz,而实际应该timestamp
```c#
public class CollectionData
{
///
/// 实验时间
///
[Column(Name = "sampleTime")]
public DateTime SampleTime { get; set; }
}

var fsql = new FreeSqlBuilder()
.UseConnectionString(DataType.PostgreSQL, strSqlConn)
.UseAutoSyncStructure(true)
.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
.Build();

var date = new CollectionData()
{
SampleNo = "123456",
SampleIndex = 1,
SampleType = "实验",
SampleTime = DateTime.Now,
};

int row = fsql.Insert(date).ExecuteAffrows();
```
![image](https://github.com/user-attachments/assets/e0af88d4-d688-414e-a30a-9c5423d769a8)

#### 数据库版本
FreeSql3.5.102
FreeSql.Provider.PostgreSQL3.5.102

#### 安装的Nuget包

#### .net framework/. net core? 及具体版本
.net8

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.