We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using Newtonsoft.Json.Linq; internal class Program { static void Main(string[] args) { IFreeSql fsql = new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.PostgreSQL, @"Host=127.0.0.1;Port=5432;Username=postgres;Password=123; Database=freesqltest;") .UseMonitorCommand(cmd => Console.WriteLine($"Sql:{cmd.CommandText}")) .UseNoneCommandParameter(true) .UseAutoSyncStructure(true) .Build(); fsql.CodeFirst.SyncStructure<MyTestObj>(); fsql.Insert(new MyTestObj() { Json = "aaabbb" }).ExecuteAffrows(); } } class MyTestObj { public JToken Json { get; set; } }
包:
freesql生成的sql:INSERT INTO "MyTestObj"("Json") VALUES('aaabbb')
可以正确插入的sql应该为 INSERT INTO "MyTestObj"("Json") VALUES('"aaabbb"')
update同理
不过数值类型没问题
The text was updated successfully, but these errors were encountered:
FreeSql/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLAdo.cs
Line 75 in 1e089af
处理方式在这里,个人建议在使用当时上解决问题。
JToken 始终保存 Array 或 Json,基础类型可以选择 string 存储。
Sorry, something went wrong.
FreeSql/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLAdo.cs Line 75 in 1e089af return string.Concat("'", param.ToString().Replace("'", "''"), "'::jsonb"); 处理方式在这里,个人建议在使用当时上解决问题。 JToken 始终保存 Array 或 Json,基础类型可以选择 string 存储。
数值类型用起来没问题,只要针对string处理一下,JToken能存的数据就基本没问题了
No branches or pull requests
包:
freesql生成的sql:INSERT INTO "MyTestObj"("Json") VALUES('aaabbb')
可以正确插入的sql应该为 INSERT INTO "MyTestObj"("Json") VALUES('"aaabbb"')
update同理
不过数值类型没问题
The text was updated successfully, but these errors were encountered: