Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zql5201314y opened this issue Jan 2, 2025 · 2 comments
Open

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

zql5201314y opened this issue Jan 2, 2025 · 2 comments

Comments

@zql5201314y
Copy link

问题描述及重现代码:

DateTime类型创建时映射成了timestamptz,而实际应该timestamp

 public class CollectionData
 {
     /// <summary>
     /// 实验时间
     /// </summary>
     [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

数据库版本

FreeSql3.5.102
FreeSql.Provider.PostgreSQL3.5.102

安装的Nuget包

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

.net8

@2881099
Copy link
Collaborator

2881099 commented Jan 2, 2025

是指表创建成了 timestamptz 还是?

目前,DateTime 创建表是 timestamp 不是 timestamptz

@zql5201314y
Copy link
Author

对,表创建成了 timestamptz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants