mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 增加 实体属性 char 类型的映射#381 #235;
This commit is contained in:
@ -282,57 +282,7 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
{
|
||||
|
||||
var sql = g.mysql.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`testFieldBool` BIT(1) NOT NULL,
|
||||
`testFieldSByte` TINYINT(3) NOT NULL,
|
||||
`testFieldShort` SMALLINT(6) NOT NULL,
|
||||
`testFieldInt` INT(11) NOT NULL,
|
||||
`testFieldLong` BIGINT(20) NOT NULL,
|
||||
`testFieldByte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`testFieldUShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`testFieldUInt` INT(10) UNSIGNED NOT NULL,
|
||||
`testFieldULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`testFieldDouble` DOUBLE NOT NULL,
|
||||
`testFieldFloat` FLOAT NOT NULL,
|
||||
`testFieldDecimal` DECIMAL(10,2) NOT NULL,
|
||||
`testFieldTimeSpan` TIME NOT NULL,
|
||||
`testFieldDateTime` DATETIME(3) NOT NULL,
|
||||
`testFieldBytes` VARBINARY(255),
|
||||
`testFieldString` VARCHAR(255),
|
||||
`testFieldGuid` VARCHAR(36),
|
||||
`testFieldBoolNullable` BIT(1),
|
||||
`testFieldSByteNullable` TINYINT(3),
|
||||
`testFieldShortNullable` SMALLINT(6),
|
||||
`testFieldIntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`testFieldByteNullable` TINYINT(3) UNSIGNED,
|
||||
`testFieldUShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`testFieldUIntNullable` INT(10) UNSIGNED,
|
||||
`testFieldULongNullable` BIGINT(20) UNSIGNED,
|
||||
`testFieldDoubleNullable` DOUBLE,
|
||||
`testFieldFloatNullable` FLOAT,
|
||||
`testFieldDecimalNullable` DECIMAL(10,2),
|
||||
`testFieldTimeSpanNullable` TIME,
|
||||
`testFieldDateTimeNullable` DATETIME(3),
|
||||
`testFieldGuidNullable` VARCHAR(36),
|
||||
`testFieldPoint` POINT,
|
||||
`testFieldLineString` LINESTRING,
|
||||
`testFieldPolygon` POLYGON,
|
||||
`testFieldMultiPoint` MULTIPOINT,
|
||||
`testFieldMultiLineString` MULTILINESTRING,
|
||||
`testFieldMultiPolygon` MULTIPOLYGON,
|
||||
`testFieldEnum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`testFieldEnum1Nullable` ENUM('E1','E2','E3'),
|
||||
`testFieldEnum2` SET('F1','F2','F3') NOT NULL,
|
||||
`testFieldEnum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
sql = g.mysql.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -398,6 +348,7 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromSeconds(999),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -411,10 +362,12 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -561,6 +514,10 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
public string TestFieldString { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldChar", DbType = "char(1)", IsNullable = true)]
|
||||
public char testFieldChar { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldTimeSpan", DbType = "time")]
|
||||
public TimeSpan TestFieldTimeSpan { get; set; }
|
||||
|
||||
@ -665,6 +622,7 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -179,57 +179,7 @@ namespace FreeSql.Tests.Odbc.Dameng
|
||||
{
|
||||
|
||||
var sql = g.dameng.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`Bool` BIT(1) NOT NULL,
|
||||
`SByte` TINYINT(3) NOT NULL,
|
||||
`Short` SMALLINT(6) NOT NULL,
|
||||
`Int` INT(11) NOT NULL,
|
||||
`Long` BIGINT(20) NOT NULL,
|
||||
`Byte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`UShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`UInt` INT(10) UNSIGNED NOT NULL,
|
||||
`ULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`Double` DOUBLE NOT NULL,
|
||||
`Float` FLOAT NOT NULL,
|
||||
`Decimal` DECIMAL(10,2) NOT NULL,
|
||||
`TimeSpan` TIME NOT NULL,
|
||||
`DateTime` DATETIME NOT NULL,
|
||||
`Bytes` VARBINARY(255),
|
||||
`String` VARCHAR(255),
|
||||
`Guid` VARCHAR(36),
|
||||
`BoolNullable` BIT(1),
|
||||
`SByteNullable` TINYINT(3),
|
||||
`ShortNullable` SMALLINT(6),
|
||||
`IntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`ByteNullable` TINYINT(3) UNSIGNED,
|
||||
`UShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`UIntNullable` INT(10) UNSIGNED,
|
||||
`ULongNullable` BIGINT(20) UNSIGNED,
|
||||
`DoubleNullable` DOUBLE,
|
||||
`FloatNullable` FLOAT,
|
||||
`DecimalNullable` DECIMAL(10,2),
|
||||
`TimeSpanNullable` TIME,
|
||||
`DateTimeNullable` DATETIME,
|
||||
`GuidNullable` VARCHAR(36),
|
||||
`Point` POINT,
|
||||
`LineString` LINESTRING,
|
||||
`Polygon` POLYGON,
|
||||
`MultiPoint` MULTIPOINT,
|
||||
`MultiLineString` MULTILINESTRING,
|
||||
`MultiPolygon` MULTIPOLYGON,
|
||||
`Enum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`Enum1Nullable` ENUM('E1','E2','E3'),
|
||||
`Enum2` SET('F1','F2','F3') NOT NULL,
|
||||
`Enum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.dameng.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -272,6 +222,7 @@ namespace FreeSql.Tests.Odbc.Dameng
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -289,10 +240,12 @@ namespace FreeSql.Tests.Odbc.Dameng
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -323,6 +276,7 @@ namespace FreeSql.Tests.Odbc.Dameng
|
||||
public DateTime DateTimeOffSet { get; set; }
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -99,6 +99,7 @@ namespace FreeSql.Tests.Odbc.Default
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "我是中国人string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldUInt = uint.MaxValue,
|
||||
testFieldUIntNullable = uint.MinValue,
|
||||
testFieldULong = ulong.MaxValue,
|
||||
@ -117,10 +118,12 @@ namespace FreeSql.Tests.Odbc.Default
|
||||
var item3 = insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -148,6 +151,7 @@ namespace FreeSql.Tests.Odbc.Default
|
||||
public DateTime testFieldDateTime { get; set; }
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -177,8 +177,8 @@ namespace FreeSql.Tests.Odbc.KingbaseES
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.kingbaseES.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.kingbaseES.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -221,6 +221,7 @@ namespace FreeSql.Tests.Odbc.KingbaseES
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -255,19 +256,22 @@ namespace FreeSql.Tests.Odbc.KingbaseES
|
||||
a.DateTimeOffSet,
|
||||
a.Bytes,
|
||||
a.String,
|
||||
a.Char,
|
||||
a.Guid
|
||||
});
|
||||
var newitem22 = select.Where(a => a.Id == item2.Id).First(a => new
|
||||
{
|
||||
a.Id, a.id2, a.SByte, a.Short, a.Int, a.Long, a.Byte, a.UShort, a.UInt, a.ULong, a.Double, a.Float, a.Decimal, a.TimeSpan, a.DateTime, a.DateTimeOffSet, a.Bytes, a.String, a.Guid
|
||||
a.Id, a.id2, a.SByte, a.Short, a.Int, a.Long, a.Byte, a.UShort, a.UInt, a.ULong, a.Double, a.Float, a.Decimal, a.TimeSpan, a.DateTime, a.DateTimeOffSet, a.Bytes, a.String, a.Char, a.Guid
|
||||
});
|
||||
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -298,6 +302,7 @@ namespace FreeSql.Tests.Odbc.KingbaseES
|
||||
public DateTime DateTimeOffSet { get; set; }
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -153,57 +153,7 @@ namespace FreeSql.Tests.Odbc.MySql
|
||||
{
|
||||
|
||||
var sql = g.mysql.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`testFieldBool` BIT(1) NOT NULL,
|
||||
`testFieldSByte` TINYINT(3) NOT NULL,
|
||||
`testFieldShort` SMALLINT(6) NOT NULL,
|
||||
`testFieldInt` INT(11) NOT NULL,
|
||||
`testFieldLong` BIGINT(20) NOT NULL,
|
||||
`testFieldByte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`testFieldUShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`testFieldUInt` INT(10) UNSIGNED NOT NULL,
|
||||
`testFieldULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`testFieldDouble` DOUBLE NOT NULL,
|
||||
`testFieldFloat` FLOAT NOT NULL,
|
||||
`testFieldDecimal` DECIMAL(10,2) NOT NULL,
|
||||
`testFieldTimeSpan` TIME NOT NULL,
|
||||
`testFieldDateTime` DATETIME(3) NOT NULL,
|
||||
`testFieldBytes` VARBINARY(255),
|
||||
`testFieldString` VARCHAR(255),
|
||||
`testFieldGuid` VARCHAR(36),
|
||||
`testFieldBoolNullable` BIT(1),
|
||||
`testFieldSByteNullable` TINYINT(3),
|
||||
`testFieldShortNullable` SMALLINT(6),
|
||||
`testFieldIntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`testFieldByteNullable` TINYINT(3) UNSIGNED,
|
||||
`testFieldUShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`testFieldUIntNullable` INT(10) UNSIGNED,
|
||||
`testFieldULongNullable` BIGINT(20) UNSIGNED,
|
||||
`testFieldDoubleNullable` DOUBLE,
|
||||
`testFieldFloatNullable` FLOAT,
|
||||
`testFieldDecimalNullable` DECIMAL(10,2),
|
||||
`testFieldTimeSpanNullable` TIME,
|
||||
`testFieldDateTimeNullable` DATETIME(3),
|
||||
`testFieldGuidNullable` VARCHAR(36),
|
||||
`testFieldPoint` POINT,
|
||||
`testFieldLineString` LINESTRING,
|
||||
`testFieldPolygon` POLYGON,
|
||||
`testFieldMultiPoint` MULTIPOINT,
|
||||
`testFieldMultiLineString` MULTILINESTRING,
|
||||
`testFieldMultiPolygon` MULTIPOLYGON,
|
||||
`testFieldEnum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`testFieldEnum1Nullable` ENUM('E1','E2','E3'),
|
||||
`testFieldEnum2` SET('F1','F2','F3') NOT NULL,
|
||||
`testFieldEnum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
sql = g.mysql.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -246,6 +196,7 @@ namespace FreeSql.Tests.Odbc.MySql
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromSeconds(999),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -265,10 +216,12 @@ namespace FreeSql.Tests.Odbc.MySql
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -391,6 +344,10 @@ namespace FreeSql.Tests.Odbc.MySql
|
||||
public string TestFieldString { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldChar", DbType = "char(1)", IsNullable = true)]
|
||||
public char testFieldChar { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldTimeSpan", DbType = "time")]
|
||||
public TimeSpan TestFieldTimeSpan { get; set; }
|
||||
|
||||
@ -492,6 +449,7 @@ namespace FreeSql.Tests.Odbc.MySql
|
||||
public DateTime testFieldDateTime { get; set; }
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -176,59 +176,8 @@ namespace FreeSql.Tests.Odbc.Oracle
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.oracle.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`Bool` BIT(1) NOT NULL,
|
||||
`SByte` TINYINT(3) NOT NULL,
|
||||
`Short` SMALLINT(6) NOT NULL,
|
||||
`Int` INT(11) NOT NULL,
|
||||
`Long` BIGINT(20) NOT NULL,
|
||||
`Byte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`UShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`UInt` INT(10) UNSIGNED NOT NULL,
|
||||
`ULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`Double` DOUBLE NOT NULL,
|
||||
`Float` FLOAT NOT NULL,
|
||||
`Decimal` DECIMAL(10,2) NOT NULL,
|
||||
`TimeSpan` TIME NOT NULL,
|
||||
`DateTime` DATETIME NOT NULL,
|
||||
`Bytes` VARBINARY(255),
|
||||
`String` VARCHAR(255),
|
||||
`Guid` VARCHAR(36),
|
||||
`BoolNullable` BIT(1),
|
||||
`SByteNullable` TINYINT(3),
|
||||
`ShortNullable` SMALLINT(6),
|
||||
`IntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`ByteNullable` TINYINT(3) UNSIGNED,
|
||||
`UShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`UIntNullable` INT(10) UNSIGNED,
|
||||
`ULongNullable` BIGINT(20) UNSIGNED,
|
||||
`DoubleNullable` DOUBLE,
|
||||
`FloatNullable` FLOAT,
|
||||
`DecimalNullable` DECIMAL(10,2),
|
||||
`TimeSpanNullable` TIME,
|
||||
`DateTimeNullable` DATETIME,
|
||||
`GuidNullable` VARCHAR(36),
|
||||
`Point` POINT,
|
||||
`LineString` LINESTRING,
|
||||
`Polygon` POLYGON,
|
||||
`MultiPoint` MULTIPOINT,
|
||||
`MultiLineString` MULTILINESTRING,
|
||||
`MultiPolygon` MULTIPOLYGON,
|
||||
`Enum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`Enum1Nullable` ENUM('E1','E2','E3'),
|
||||
`Enum2` SET('F1','F2','F3') NOT NULL,
|
||||
`Enum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.oracle.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -239,7 +188,17 @@ namespace FreeSql.Tests.Odbc.Oracle
|
||||
public void CurdAllField()
|
||||
{
|
||||
var item = new TableAllType { };
|
||||
item.Id = (int)insert.AppendData(item).ExecuteIdentity();
|
||||
for (var a = 0; a < 100; a++)
|
||||
{
|
||||
try //ERROR [23000] [Oracle][ODBC][Ora]ORA-00001: Υ<><CEA5>ΨһԼ<D2BB><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1ODBC.1ODBC_TB_ALLTYPE_pk2)
|
||||
{
|
||||
item.Id = (int)insert.AppendData(item).ExecuteIdentity();
|
||||
break;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
var newitem = select.Where(a => a.Id == item.Id).ToOne();
|
||||
|
||||
@ -271,6 +230,7 @@ namespace FreeSql.Tests.Odbc.Oracle
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -288,10 +248,12 @@ namespace FreeSql.Tests.Odbc.Oracle
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -322,6 +284,7 @@ namespace FreeSql.Tests.Odbc.Oracle
|
||||
public DateTime DateTimeOffSet { get; set; }
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -105,8 +105,8 @@ namespace FreeSql.Tests.Odbc.PostgreSQL
|
||||
public void AddField()
|
||||
{
|
||||
var sql = g.pgsql.CodeFirst.GetComparisonDDLStatements<TopicAddField>();
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
g.pgsql.Select<TopicAddField>();
|
||||
|
||||
var id = g.pgsql.Insert<TopicAddField>().AppendData(new TopicAddField { }).ExecuteIdentity();
|
||||
}
|
||||
|
||||
@ -184,6 +184,7 @@ namespace FreeSql.Tests.Odbc.PostgreSQL
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromDays(1),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(90),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -202,10 +203,12 @@ namespace FreeSql.Tests.Odbc.PostgreSQL
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted().First();
|
||||
var newitem2 = select.Where(a => a.Id == item3.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted().First();
|
||||
newitem2 = select.Where(a => a.Id == item3.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -233,6 +236,7 @@ namespace FreeSql.Tests.Odbc.PostgreSQL
|
||||
public DateTime testFieldDateTime { get; set; }
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -166,9 +166,8 @@ namespace FreeSql.Tests.Odbc.SqlServer
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.sqlserver.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
sql = g.sqlserver.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -214,6 +213,7 @@ namespace FreeSql.Tests.Odbc.SqlServer
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromSeconds(999),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(30),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -234,10 +234,12 @@ namespace FreeSql.Tests.Odbc.SqlServer
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted();
|
||||
var newitem2 = select.Where(a => a.Id == item3[0].Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted();
|
||||
newitem2 = select.Where(a => a.Id == item3[0].Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -367,6 +369,10 @@ namespace FreeSql.Tests.Odbc.SqlServer
|
||||
public string TestFieldString { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldChar", DbType = "char(1)", IsNullable = true)]
|
||||
public char testFieldChar { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldTimeSpan", DbType = "time")]
|
||||
public TimeSpan TestFieldTimeSpan { get; set; }
|
||||
|
||||
@ -427,6 +433,7 @@ namespace FreeSql.Tests.Odbc.SqlServer
|
||||
public DateTimeOffset testFieldDateTimeOffset { get; set; }
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -22,8 +22,8 @@ namespace FreeSql.Tests.PostgreSQL.NetTopologySuite
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.pgsql.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
g.pgsql.Select<TableAllType>();
|
||||
}
|
||||
|
||||
@ -230,6 +230,7 @@ namespace FreeSql.Tests.PostgreSQL.NetTopologySuite
|
||||
testFieldShortArrayNullable = new short?[] { 1, 2, 3, null, 4, 5 },
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldStringArray = new[] { "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String1", "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String2", null, "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String3" },
|
||||
testFieldTimeSpan = TimeSpan.FromDays(1),
|
||||
testFieldTimeSpanArray = new[] { TimeSpan.FromDays(1), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(60) },
|
||||
@ -262,10 +263,12 @@ namespace FreeSql.Tests.PostgreSQL.NetTopologySuite
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted().First();
|
||||
var newitem2 = select.Where(a => a.Id == item3.Id && object.Equals(a.testFieldJToken["a"], "1")).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted().First();
|
||||
newitem2 = select.Where(a => a.Id == item3.Id && object.Equals(a.testFieldJToken["a"], "1")).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -296,6 +299,7 @@ namespace FreeSql.Tests.PostgreSQL.NetTopologySuite
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
public NpgsqlPoint testFieldNpgsqlPoint { get; set; }
|
||||
public NpgsqlLine testFieldNpgsqlLine { get; set; }
|
||||
|
@ -247,59 +247,8 @@ namespace FreeSql.Tests.Dameng
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.dameng.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`Bool` BIT(1) NOT NULL,
|
||||
`SByte` TINYINT(3) NOT NULL,
|
||||
`Short` SMALLINT(6) NOT NULL,
|
||||
`Int` INT(11) NOT NULL,
|
||||
`Long` BIGINT(20) NOT NULL,
|
||||
`Byte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`UShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`UInt` INT(10) UNSIGNED NOT NULL,
|
||||
`ULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`Double` DOUBLE NOT NULL,
|
||||
`Float` FLOAT NOT NULL,
|
||||
`Decimal` DECIMAL(10,2) NOT NULL,
|
||||
`TimeSpan` TIME NOT NULL,
|
||||
`DateTime` DATETIME NOT NULL,
|
||||
`Bytes` VARBINARY(255),
|
||||
`String` VARCHAR(255),
|
||||
`Guid` VARCHAR(36),
|
||||
`BoolNullable` BIT(1),
|
||||
`SByteNullable` TINYINT(3),
|
||||
`ShortNullable` SMALLINT(6),
|
||||
`IntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`ByteNullable` TINYINT(3) UNSIGNED,
|
||||
`UShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`UIntNullable` INT(10) UNSIGNED,
|
||||
`ULongNullable` BIGINT(20) UNSIGNED,
|
||||
`DoubleNullable` DOUBLE,
|
||||
`FloatNullable` FLOAT,
|
||||
`DecimalNullable` DECIMAL(10,2),
|
||||
`TimeSpanNullable` TIME,
|
||||
`DateTimeNullable` DATETIME,
|
||||
`GuidNullable` VARCHAR(36),
|
||||
`Point` POINT,
|
||||
`LineString` LINESTRING,
|
||||
`Polygon` POLYGON,
|
||||
`MultiPoint` MULTIPOINT,
|
||||
`MultiLineString` MULTILINESTRING,
|
||||
`MultiPolygon` MULTIPOLYGON,
|
||||
`Enum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`Enum1Nullable` ENUM('E1','E2','E3'),
|
||||
`Enum2` SET('F1','F2','F3') NOT NULL,
|
||||
`Enum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.dameng.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -338,6 +287,7 @@ namespace FreeSql.Tests.Dameng
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -355,10 +305,12 @@ namespace FreeSql.Tests.Dameng
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -389,6 +341,7 @@ namespace FreeSql.Tests.Dameng
|
||||
public DateTime DateTimeOffSet { get; set; }
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -177,54 +177,7 @@ namespace FreeSql.Tests.MsAccess
|
||||
{
|
||||
|
||||
var sql = g.msaccess.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE [tb_alltype] (
|
||||
[Id] AUTOINCREMENT,
|
||||
[Bool] BIT NOT NULL,
|
||||
[SByte] DECIMAL(3,0) NOT NULL,
|
||||
[Short] DECIMAL(6,0) NOT NULL,
|
||||
[Int] DECIMAL(11,0) NOT NULL,
|
||||
[Long] DECIMAL(20,0) NOT NULL,
|
||||
[Byte] DECIMAL(3,0) NOT NULL,
|
||||
[UShort] DECIMAL(5,0) NOT NULL,
|
||||
[UInt] DECIMAL(10,0) NOT NULL,
|
||||
[ULong] DECIMAL(20,0) NOT NULL,
|
||||
[Double] DOUBLE NOT NULL,
|
||||
[Float] SINGLE NOT NULL,
|
||||
[Decimal] DECIMAL(10,2) NOT NULL,
|
||||
[TimeSpan] TIME NOT NULL,
|
||||
[DateTime] DATETIME NOT NULL,
|
||||
[DateTimeOffSet] DATETIME NOT NULL,
|
||||
[Bytes] BINARY(255),
|
||||
[String] VARCHAR(255),
|
||||
[Guid] VARCHAR(36) NOT NULL,
|
||||
[BoolNullable] BIT,
|
||||
[SByteNullable] DECIMAL(3,0),
|
||||
[ShortNullable] DECIMAL(6,0),
|
||||
[IntNullable] DECIMAL(11,0),
|
||||
[testFielLongNullable] DECIMAL(20,0),
|
||||
[ByteNullable] DECIMAL(3,0),
|
||||
[UShortNullable] DECIMAL(5,0),
|
||||
[UIntNullable] DECIMAL(10,0),
|
||||
[ULongNullable] DECIMAL(20,0),
|
||||
[DoubleNullable] DOUBLE,
|
||||
[FloatNullable] SINGLE,
|
||||
[DecimalNullable] DECIMAL(10,2),
|
||||
[TimeSpanNullable] TIME,
|
||||
[DateTimeNullable] DATETIME,
|
||||
[DateTimeOffSetNullable] DATETIME,
|
||||
[GuidNullable] VARCHAR(36),
|
||||
[Enum1] DECIMAL(11,0) NOT NULL,
|
||||
[Enum1Nullable] DECIMAL(11,0),
|
||||
[Enum2] DECIMAL(20,0) NOT NULL,
|
||||
[Enum2Nullable] DECIMAL(20,0),
|
||||
PRIMARY KEY ([Id])
|
||||
)
|
||||
;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.msaccess.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -267,6 +220,7 @@ namespace FreeSql.Tests.MsAccess
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -280,10 +234,12 @@ namespace FreeSql.Tests.MsAccess
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -318,6 +274,7 @@ namespace FreeSql.Tests.MsAccess
|
||||
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -281,57 +281,7 @@ namespace FreeSql.Tests.MySql
|
||||
{
|
||||
|
||||
var sql = g.mysql.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`testFieldBool` BIT(1) NOT NULL,
|
||||
`testFieldSByte` TINYINT(3) NOT NULL,
|
||||
`testFieldShort` SMALLINT(6) NOT NULL,
|
||||
`testFieldInt` INT(11) NOT NULL,
|
||||
`testFieldLong` BIGINT(20) NOT NULL,
|
||||
`testFieldByte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`testFieldUShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`testFieldUInt` INT(10) UNSIGNED NOT NULL,
|
||||
`testFieldULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`testFieldDouble` DOUBLE NOT NULL,
|
||||
`testFieldFloat` FLOAT NOT NULL,
|
||||
`testFieldDecimal` DECIMAL(10,2) NOT NULL,
|
||||
`testFieldTimeSpan` TIME NOT NULL,
|
||||
`testFieldDateTime` DATETIME(3) NOT NULL,
|
||||
`testFieldBytes` VARBINARY(255),
|
||||
`testFieldString` VARCHAR(255),
|
||||
`testFieldGuid` VARCHAR(36),
|
||||
`testFieldBoolNullable` BIT(1),
|
||||
`testFieldSByteNullable` TINYINT(3),
|
||||
`testFieldShortNullable` SMALLINT(6),
|
||||
`testFieldIntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`testFieldByteNullable` TINYINT(3) UNSIGNED,
|
||||
`testFieldUShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`testFieldUIntNullable` INT(10) UNSIGNED,
|
||||
`testFieldULongNullable` BIGINT(20) UNSIGNED,
|
||||
`testFieldDoubleNullable` DOUBLE,
|
||||
`testFieldFloatNullable` FLOAT,
|
||||
`testFieldDecimalNullable` DECIMAL(10,2),
|
||||
`testFieldTimeSpanNullable` TIME,
|
||||
`testFieldDateTimeNullable` DATETIME(3),
|
||||
`testFieldGuidNullable` VARCHAR(36),
|
||||
`testFieldPoint` POINT,
|
||||
`testFieldLineString` LINESTRING,
|
||||
`testFieldPolygon` POLYGON,
|
||||
`testFieldMultiPoint` MULTIPOINT,
|
||||
`testFieldMultiLineString` MULTILINESTRING,
|
||||
`testFieldMultiPolygon` MULTIPOLYGON,
|
||||
`testFieldEnum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`testFieldEnum1Nullable` ENUM('E1','E2','E3'),
|
||||
`testFieldEnum2` SET('F1','F2','F3') NOT NULL,
|
||||
`testFieldEnum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
sql = g.mysql.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -397,6 +347,7 @@ namespace FreeSql.Tests.MySql
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromSeconds(999),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -416,10 +367,12 @@ namespace FreeSql.Tests.MySql
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -566,6 +519,10 @@ namespace FreeSql.Tests.MySql
|
||||
public string TestFieldString { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldChar", DbType = "char(1)", IsNullable = true)]
|
||||
public char testFieldChar { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldTimeSpan", DbType = "time")]
|
||||
public TimeSpan TestFieldTimeSpan { get; set; }
|
||||
|
||||
@ -670,6 +627,7 @@ namespace FreeSql.Tests.MySql
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -279,57 +279,7 @@ namespace FreeSql.Tests.Oracle
|
||||
{
|
||||
|
||||
var sql = g.oracle.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS `cccddd`.`tb_alltype` (
|
||||
`Id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`Bool` BIT(1) NOT NULL,
|
||||
`SByte` TINYINT(3) NOT NULL,
|
||||
`Short` SMALLINT(6) NOT NULL,
|
||||
`Int` INT(11) NOT NULL,
|
||||
`Long` BIGINT(20) NOT NULL,
|
||||
`Byte` TINYINT(3) UNSIGNED NOT NULL,
|
||||
`UShort` SMALLINT(5) UNSIGNED NOT NULL,
|
||||
`UInt` INT(10) UNSIGNED NOT NULL,
|
||||
`ULong` BIGINT(20) UNSIGNED NOT NULL,
|
||||
`Double` DOUBLE NOT NULL,
|
||||
`Float` FLOAT NOT NULL,
|
||||
`Decimal` DECIMAL(10,2) NOT NULL,
|
||||
`TimeSpan` TIME NOT NULL,
|
||||
`DateTime` DATETIME NOT NULL,
|
||||
`Bytes` VARBINARY(255),
|
||||
`String` VARCHAR(255),
|
||||
`Guid` VARCHAR(36),
|
||||
`BoolNullable` BIT(1),
|
||||
`SByteNullable` TINYINT(3),
|
||||
`ShortNullable` SMALLINT(6),
|
||||
`IntNullable` INT(11),
|
||||
`testFielLongNullable` BIGINT(20),
|
||||
`ByteNullable` TINYINT(3) UNSIGNED,
|
||||
`UShortNullable` SMALLINT(5) UNSIGNED,
|
||||
`UIntNullable` INT(10) UNSIGNED,
|
||||
`ULongNullable` BIGINT(20) UNSIGNED,
|
||||
`DoubleNullable` DOUBLE,
|
||||
`FloatNullable` FLOAT,
|
||||
`DecimalNullable` DECIMAL(10,2),
|
||||
`TimeSpanNullable` TIME,
|
||||
`DateTimeNullable` DATETIME,
|
||||
`GuidNullable` VARCHAR(36),
|
||||
`Point` POINT,
|
||||
`LineString` LINESTRING,
|
||||
`Polygon` POLYGON,
|
||||
`MultiPoint` MULTIPOINT,
|
||||
`MultiLineString` MULTILINESTRING,
|
||||
`MultiPolygon` MULTIPOLYGON,
|
||||
`Enum1` ENUM('E1','E2','E3') NOT NULL,
|
||||
`Enum1Nullable` ENUM('E1','E2','E3'),
|
||||
`Enum2` SET('F1','F2','F3') NOT NULL,
|
||||
`Enum2Nullable` SET('F1','F2','F3'),
|
||||
PRIMARY KEY (`Id`)
|
||||
) Engine=InnoDB;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.oracle.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -372,6 +322,7 @@ namespace FreeSql.Tests.Oracle
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -389,10 +340,12 @@ namespace FreeSql.Tests.Oracle
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -427,6 +380,7 @@ namespace FreeSql.Tests.Oracle
|
||||
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
@ -145,8 +145,8 @@ namespace FreeSql.Tests.PostgreSQL
|
||||
public void AddField()
|
||||
{
|
||||
var sql = g.pgsql.CodeFirst.GetComparisonDDLStatements<TopicAddField>();
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
g.pgsql.Select<TopicAddField>();
|
||||
|
||||
var id = g.pgsql.Insert<TopicAddField>().AppendData(new TopicAddField { }).ExecuteIdentity();
|
||||
}
|
||||
|
||||
@ -388,6 +388,7 @@ namespace FreeSql.Tests.PostgreSQL
|
||||
testFieldShortArrayNullable = new short?[] { 1, 2, 3, null, 4, 5 },
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldStringArray = new[] { "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String1", "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String2", null, "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String3" },
|
||||
testFieldTimeSpan = TimeSpan.FromDays(1),
|
||||
testFieldTimeSpanArray = new[] { TimeSpan.FromDays(1), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(60) },
|
||||
@ -420,10 +421,12 @@ namespace FreeSql.Tests.PostgreSQL
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted().First();
|
||||
var newitem2 = select.Where(a => a.Id == item3.Id && object.Equals(a.testFieldJToken["a"], "1")).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted().First();
|
||||
newitem2 = select.Where(a => a.Id == item3.Id && object.Equals(a.testFieldJToken["a"], "1")).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -454,6 +457,7 @@ namespace FreeSql.Tests.PostgreSQL
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
public NpgsqlPoint testFieldNpgsqlPoint { get; set; }
|
||||
public NpgsqlLine testFieldNpgsqlLine { get; set; }
|
||||
|
@ -143,8 +143,8 @@ namespace FreeSql.Tests.ShenTong
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.shentong.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
g.shentong.Select<TableAllType>();
|
||||
}
|
||||
|
||||
@ -217,6 +217,7 @@ namespace FreeSql.Tests.ShenTong
|
||||
//testFieldShortArrayNullable = new short?[] { 1, 2, 3, null, 4, 5 },
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
//testFieldStringArray = new[] { "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String1", "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String2", null, "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>String3" },
|
||||
testFieldTimeSpan = TimeSpan.FromHours(10),
|
||||
//testFieldTimeSpanArray = new[] { TimeSpan.FromHours(10), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(60) },
|
||||
@ -245,10 +246,12 @@ namespace FreeSql.Tests.ShenTong
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted().First();
|
||||
var newitem2 = select.Where(a => a.Id == item3.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted().First();
|
||||
newitem2 = select.Where(a => a.Id == item3.Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -279,6 +282,7 @@ namespace FreeSql.Tests.ShenTong
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -202,9 +202,8 @@ namespace FreeSql.Tests.SqlServer
|
||||
[Fact]
|
||||
public void GetComparisonDDLStatements()
|
||||
{
|
||||
|
||||
var sql = g.sqlserver.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
sql = g.sqlserver.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -250,6 +249,7 @@ namespace FreeSql.Tests.SqlServer
|
||||
testFieldShort = short.MaxValue,
|
||||
testFieldShortNullable = short.MinValue,
|
||||
testFieldString = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
testFieldChar = 'X',
|
||||
testFieldTimeSpan = TimeSpan.FromSeconds(999),
|
||||
testFieldTimeSpanNullable = TimeSpan.FromSeconds(30),
|
||||
testFieldUInt = uint.MaxValue,
|
||||
@ -270,10 +270,12 @@ namespace FreeSql.Tests.SqlServer
|
||||
var item3 = insert.AppendData(item2).ExecuteInserted();
|
||||
var newitem2 = select.Where(a => a.Id == item3[0].Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
item3 = insert.NoneParameter().AppendData(item2).ExecuteInserted();
|
||||
newitem2 = select.Where(a => a.Id == item3[0].Id).ToOne();
|
||||
Assert.Equal(item2.testFieldString, newitem2.testFieldString);
|
||||
Assert.Equal(item2.testFieldChar, newitem2.testFieldChar);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -403,6 +405,10 @@ namespace FreeSql.Tests.SqlServer
|
||||
public string TestFieldString { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldChar", DbType = "char(1)", IsNullable = true)]
|
||||
public char testFieldChar { get; set; }
|
||||
|
||||
|
||||
[JsonProperty, Column(Name = "testFieldTimeSpan", DbType = "time")]
|
||||
public TimeSpan TestFieldTimeSpan { get; set; }
|
||||
|
||||
@ -467,6 +473,7 @@ namespace FreeSql.Tests.SqlServer
|
||||
|
||||
public byte[] testFieldBytes { get; set; }
|
||||
public string testFieldString { get; set; }
|
||||
public char testFieldChar { get; set; }
|
||||
public Guid testFieldGuid { get; set; }
|
||||
|
||||
public bool? testFieldBoolNullable { get; set; }
|
||||
|
@ -239,53 +239,7 @@ namespace FreeSql.Tests.Sqlite
|
||||
{
|
||||
|
||||
var sql = g.sqlite.CodeFirst.GetComparisonDDLStatements<TableAllType>();
|
||||
if (string.IsNullOrEmpty(sql) == false)
|
||||
{
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS ""main"".""tb_alltype"" (
|
||||
""Id"" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
""Bool"" BOOLEAN NOT NULL,
|
||||
""SByte"" SMALLINT NOT NULL,
|
||||
""Short"" SMALLINT NOT NULL,
|
||||
""Int"" INTEGER NOT NULL,
|
||||
""Long"" INTEGER NOT NULL,
|
||||
""Byte"" INT2 NOT NULL,
|
||||
""UShort"" UNSIGNED NOT NULL,
|
||||
""UInt"" DECIMAL(10,0) NOT NULL,
|
||||
""ULong"" DECIMAL(21,0) NOT NULL,
|
||||
""Double"" DOUBLE NOT NULL,
|
||||
""Float"" FLOAT NOT NULL,
|
||||
""Decimal"" DECIMAL(10,2) NOT NULL,
|
||||
""TimeSpan"" BIGINT NOT NULL,
|
||||
""DateTime"" DATETIME NOT NULL,
|
||||
""DateTimeOffSet"" DATETIME NOT NULL,
|
||||
""Bytes"" BLOB,
|
||||
""String"" NVARCHAR(255),
|
||||
""Guid"" CHARACTER(36) NOT NULL,
|
||||
""BoolNullable"" BOOLEAN,
|
||||
""SByteNullable"" SMALLINT,
|
||||
""ShortNullable"" SMALLINT,
|
||||
""IntNullable"" INTEGER,
|
||||
""testFielLongNullable"" INTEGER,
|
||||
""ByteNullable"" INT2,
|
||||
""UShortNullable"" UNSIGNED,
|
||||
""UIntNullable"" DECIMAL(10,0),
|
||||
""ULongNullable"" DECIMAL(21,0),
|
||||
""DoubleNullable"" DOUBLE,
|
||||
""FloatNullable"" FLOAT,
|
||||
""DecimalNullable"" DECIMAL(10,2),
|
||||
""TimeSpanNullable"" BIGINT,
|
||||
""DateTimeNullable"" DATETIME,
|
||||
""DateTimeOffSetNullable"" DATETIME,
|
||||
""GuidNullable"" CHARACTER(36),
|
||||
""Enum1"" MEDIUMINT NOT NULL,
|
||||
""Enum1Nullable"" MEDIUMINT,
|
||||
""Enum2"" BIGINT NOT NULL,
|
||||
""Enum2Nullable"" BIGINT
|
||||
)
|
||||
;
|
||||
", sql);
|
||||
}
|
||||
|
||||
Assert.True(string.IsNullOrEmpty(sql)); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>
|
||||
//sql = g.Sqlite.CodeFirst.GetComparisonDDLStatements<Tb_alltype>();
|
||||
}
|
||||
|
||||
@ -328,6 +282,7 @@ namespace FreeSql.Tests.Sqlite
|
||||
Short = short.MaxValue,
|
||||
ShortNullable = short.MinValue,
|
||||
String = "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>string'\\?!@#$%^&*()_+{}}{~?><<>",
|
||||
Char = 'X',
|
||||
TimeSpan = TimeSpan.FromSeconds(999),
|
||||
TimeSpanNullable = TimeSpan.FromSeconds(60),
|
||||
UInt = uint.MaxValue,
|
||||
@ -341,10 +296,12 @@ namespace FreeSql.Tests.Sqlite
|
||||
item2.Id = (int)insert.AppendData(item2).ExecuteIdentity();
|
||||
var newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
item2.Id = (int)insert.NoneParameter().AppendData(item2).ExecuteIdentity();
|
||||
newitem2 = select.Where(a => a.Id == item2.Id).ToOne();
|
||||
Assert.Equal(item2.String, newitem2.String);
|
||||
Assert.Equal(item2.Char, newitem2.Char);
|
||||
|
||||
var items = select.ToList();
|
||||
var itemstb = select.ToDataTable();
|
||||
@ -379,6 +336,7 @@ namespace FreeSql.Tests.Sqlite
|
||||
|
||||
public byte[] Bytes { get; set; }
|
||||
public string String { get; set; }
|
||||
public char Char { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public bool? BoolNullable { get; set; }
|
||||
|
Reference in New Issue
Block a user