Update SqlSugar.MySqlConnectorCore

This commit is contained in:
sunkaixuan
2022-02-26 23:54:39 +08:00
parent 5a53949480
commit a55a9c340c
20 changed files with 26 additions and 22 deletions

View File

@@ -341,6 +341,10 @@ namespace SqlSugar.MySqlConnector
{
if (item.ColumnDescription != null)
{
if (item.UnderType == UtilConstants.GuidType && item.Length == 0)
{
item.Length = 36;
}
var mySqlCodeFirst = this.Context.CodeFirst as MySqlCodeFirst;
string sql = GetUpdateColumnSql(entity.DbTableName, mySqlCodeFirst.GetEntityColumnToDbColumn(entity, entity.DbTableName, item))+" "+(item.IsIdentity? "AUTO_INCREMENT" : "")+" " + " COMMENT '" + item.ColumnDescription + "'";
db.Ado.ExecuteCommand(sql);

View File

@@ -54,7 +54,7 @@ namespace SqlSugar.MySqlConnector
}
public override IDataAdapter GetAdapter()
{
return new MySqlConnectorDataAdapter();
return new MySqlDataAdapter();
}
public override DbCommand GetCommand(string sql, SugarParameter[] parameters)
{
@@ -75,7 +75,7 @@ namespace SqlSugar.MySqlConnector
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((MySqlConnectorDataAdapter)dataAdapter).SelectCommand = (MySqlCommand)command;
((MySqlDataAdapter)dataAdapter).SelectCommand = (MySqlCommand)command;
}
/// <summary>
/// if mysql return MySqlParameter[] pars