You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6 KiB

2 years ago
  1. using System.Collections.Generic;
  2. namespace SqlSugar
  3. {
  4. public partial interface IDbMaintenance
  5. {
  6. SqlSugarClient Context { get; set; }
  7. #region DML
  8. List<DbTableInfo> GetViewInfoList();
  9. List<DbTableInfo> GetTableInfoList();
  10. List<DbColumnInfo> GetColumnInfosByTableName(string tableName);
  11. List<string> GetIsIdentities(string tableName);
  12. List<string> GetPrimaries(string tableName);
  13. #endregion
  14. #region Check
  15. bool IsAnyTable(string tableName);
  16. bool IsAnyColumn(string tableName, string column);
  17. bool IsPrimaryKey(string tableName, string column);
  18. bool IsIdentity(string tableName, string column);
  19. bool IsAnyConstraint(string ConstraintName);
  20. bool IsAnySystemTablePermissions();
  21. #endregion
  22. #region DDL
  23. bool DropTable(string tableName);
  24. bool TruncateTable(string tableName);
  25. bool CreateTable(string tableName, List<DbColumnInfo> columns,bool isCreatePrimaryKey=true);
  26. bool AddColumn(string tableName, DbColumnInfo column);
  27. bool UpdateColumn(string tableName, DbColumnInfo column);
  28. bool AddPrimaryKey(string tableName,string columnName);
  29. bool DropConstraint(string tableName, string constraintName);
  30. bool BackupDataBase(string databaseName,string fullFileName);
  31. bool BackupTable(string oldTableName, string newTableName, int maxBackupDataRows = int.MaxValue);
  32. bool DropColumn(string tableName,string columnName);
  33. bool RenameColumn(string tableName, string oldColumnName, string newColumnName);
  34. #endregion
  35. }
  36. }