53 lines
2.2 KiB
C#
53 lines
2.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.Application.Services;
|
|
|
|
namespace Sozsoft.SqlQueryManager.Application.Contracts;
|
|
|
|
/// <summary>
|
|
/// SQL Query Manager - executes T-SQL and provides database metadata.
|
|
/// Does not persist SQL objects to its own tables.
|
|
/// </summary>
|
|
public interface ISqlObjectManagerAppService : IApplicationService
|
|
{
|
|
/// <summary>
|
|
/// Returns tables (and optionally templates) available on the given data source.
|
|
/// </summary>
|
|
Task<SqlObjectExplorerDto> GetAllObjectsAsync(string dataSourceCode);
|
|
|
|
/// <summary>
|
|
/// Executes raw T-SQL against the specified data source.
|
|
/// </summary>
|
|
Task<SqlQueryExecutionResultDto> ExecuteQueryAsync(ExecuteSqlQueryDto input);
|
|
|
|
// Database Metadata Operations
|
|
Task<List<DatabaseColumnDto>> GetTableColumnsAsync(string dataSourceCode, string schemaName, string tableName);
|
|
Task<string> GetTableCreateScriptAsync(string dataSourceCode, string schemaName, string tableName);
|
|
|
|
/// <summary>
|
|
/// Gets the SQL definition/body of a native SQL Server object (Stored Procedure, View, or Function)
|
|
/// </summary>
|
|
Task<string> GetNativeObjectDefinitionAsync(string dataSourceCode, string schemaName, string objectName);
|
|
|
|
/// <summary>
|
|
/// Saves the T-SQL script to Seeds/SqlData/{fileName}.sql in the DbMigrator project.
|
|
/// Called automatically after a successful SqlTableDesigner deploy so the script can be re-seeded.
|
|
/// </summary>
|
|
Task SaveTableScriptAsync(SaveTableScriptDto input);
|
|
|
|
/// <summary>
|
|
/// Deletes matching SQL seed files from Seeds/SqlData when objects are dropped from the UI.
|
|
/// Non-existing files are ignored.
|
|
/// </summary>
|
|
Task DeleteSqlDataFilesAsync(DeleteSqlDataFilesDto input);
|
|
|
|
/// <summary>
|
|
/// Lists .sql files currently available under DbMigrator Seeds/SqlData.
|
|
/// </summary>
|
|
Task<List<SqlDataFileDto>> GetSqlDataFilesAsync(string dataDirectoryName = "SqlData", string relativePath = "");
|
|
|
|
/// <summary>
|
|
/// Moves a SQL seed file between the selected data directory root and HostData.
|
|
/// </summary>
|
|
Task MoveSqlDataFileAsync(MoveSqlDataFileDto input);
|
|
}
|