Action Table Remark

This commit is contained in:
sunkaixuan 2018-11-10 16:54:02 +08:00
parent 706e583527
commit c5f53a33fd
7 changed files with 245 additions and 1 deletions

View File

@ -45,7 +45,7 @@ namespace SqlSugar
cacheKey = GetCacheKey(cacheKey);
var sql = string.Format(this.GetColumnInfosByTableNameSql, tableName);
if (isCache)
return GetListOrCache<DbColumnInfo>(cacheKey, sql).GroupBy(it=>it.DbColumnName).Select(it=>it.First()).ToList();
return GetListOrCache<DbColumnInfo>(cacheKey, sql).GroupBy(it => it.DbColumnName).Select(it => it.First()).ToList();
else
return this.Context.Ado.SqlQuery<DbColumnInfo>(sql).GroupBy(it => it.DbColumnName).Select(it => it.First()).ToList();
@ -208,6 +208,42 @@ namespace SqlSugar
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool AddColumnRemark(string columnName, string tableName, string description)
{
string sql = string.Format(this.AddColumnRemarkSql, columnName, tableName, description);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool DeleteColumnRemark(string columnName, string tableName)
{
string sql = string.Format(this.DeleteColumnRemarkSql, columnName, tableName);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool IsAnyColumnRemark(string columnName, string tableName)
{
string sql = string.Format(this.IsAnyColumnRemarkSql, columnName, tableName);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool AddTableRemark(string columnName, string tableName, string description)
{
string sql = string.Format(this.AddTableRemarkSql, columnName, tableName, description);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool DeleteTableRemark(string columnName, string tableName)
{
string sql = string.Format(this.DeleteTableRemarkSql, columnName, tableName);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
public virtual bool IsAnyTableRemark(string columnName, string tableName)
{
string sql = string.Format(this.IsAnyTableRemarkSql, columnName, tableName);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
#endregion
#region Private

View File

@ -43,6 +43,12 @@ namespace SqlSugar
protected abstract string DropConstraintSql { get; }
protected abstract string AddPrimaryKeySql { get; }
protected abstract string RenameColumnSql { get; }
protected abstract string AddColumnRemarkSql { get; }
protected abstract string DeleteColumnRemarkSql { get; }
protected abstract string IsAnyColumnRemarkSql { get; }
protected abstract string AddTableRemarkSql { get; }
protected abstract string DeleteTableRemarkSql { get; }
protected abstract string IsAnyTableRemarkSql { get; }
#endregion
#region Check

View File

@ -37,6 +37,12 @@ namespace SqlSugar
bool BackupTable(string oldTableName, string newTableName, int maxBackupDataRows = int.MaxValue);
bool DropColumn(string tableName,string columnName);
bool RenameColumn(string tableName, string oldColumnName, string newColumnName);
bool AddColumnRemark(string columnName,string tableName,string description);
bool DeleteColumnRemark(string columnName, string tableName);
bool IsAnyColumnRemark(string columnName, string tableName);
bool AddTableRemark(string columnName, string tableName, string description);
bool DeleteTableRemark(string columnName, string tableName);
bool IsAnyTableRemark(string columnName, string tableName);
#endregion
}
}

View File

@ -176,6 +176,54 @@ namespace SqlSugar
return "AUTO_INCREMENT";
}
}
protected override string AddColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string AddTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
#endregion
#region Methods

View File

@ -169,6 +169,54 @@ namespace SqlSugar
return "IDENTITY(1,1)";
}
}
protected override string AddColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string AddTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
#endregion
#region Methods

View File

@ -200,6 +200,58 @@ namespace SqlSugar
return "IDENTITY(1,1)";
}
}
protected override string AddColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string AddTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
#endregion
public override bool CreateTable(string tableName, List<DbColumnInfo> columns, bool isCreatePrimaryKey = true)

View File

@ -161,6 +161,54 @@ namespace SqlSugar
return "AUTOINCREMENT";
}
}
protected override string AddColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyColumnRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string AddTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string DeleteTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
protected override string IsAnyTableRemarkSql
{
get
{
throw new NotImplementedException();
}
}
#endregion
#region Methods