Files
MegghysAPI/DB.cs
2025-02-25 22:28:49 +08:00

20 lines
475 B
C#

using FreeSql;
using MegghysAPI.Attributes;
namespace MegghysAPI
{
public static class DB
{
public static IFreeSql SQL { get; private set; }
[AutoInit(Order = 0)]
internal static void InitDB()
{
SQL = new FreeSqlBuilder()
.UseConnectionString(DataType.PostgreSQL, Config.Instance.DBConnectString)
.UseAutoSyncStructure(true)
.Build();
SQL.UseJsonMap();
}
}
}