sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.06k stars 499 forks source link

[SQLServer] insert bool value #437 #697

Open mvernikUt opened 8 months ago

mvernikUt commented 8 months ago

The same issue still exists: #437

Could you please specify if am I doing something wrong, because I just need to have generated SQL?

public class ClientMode
  {
      public Guid Id { get; set; }
      public Guid ClientId { get; set; }
      public string Name { get; set; }
      public string Url { get; set; }
      public string Secret { get; set; }
      public string? Version { get; set; }
      public string? DataCsv { get; set; }
      public bool Enabled { get; set; }
  }
var queryBuilder = new Query("ClientMode").AsInsert(entry);
SqlResult result = _sqlCompiler.Compile(queryBuilder);

INSERT INTO [ClientMode] ([Id], [ClientId], [Name], [Url], [Secret], [Version], [DataCsv], [Enabled]) VALUES ('732ae0ec-6409-445d-9dfe-bc77a1ac85d0', '00000000-0000-0000-0000-000000000000', 'test0004', 'test0004', 'CVhulQgha6TpAcEx4rDrTVxBE0DQ11sV', 'test', 'string', true)

Issue: SQL Server accepts BIT instead of Boolean

vip32 commented 2 months ago

this just bit me, still a thing in 2024?