sozsoft-platform/api/modules/Sozsoft.SqlQueryManager/Sozsoft.SqlQueryManager.Application.Contracts/ISqlObjectManagerAppService.cs

46 lines
1.9 KiB
C#
Raw Normal View History

2026-08-17 05:56:52 +00:00
using System.Collections.Generic;
2026-02-24 20:44:16 +00:00
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.
2026-02-24 20:44:16 +00:00
/// </summary>
public interface ISqlObjectManagerAppService : IApplicationService
{
/// <summary>
/// Returns tables (and optionally templates) available on the given data source.
2026-02-24 20:44:16 +00:00
/// </summary>
Task<SqlObjectExplorerDto> GetAllObjectsAsync(string dataSourceCode);
/// <summary>
/// Executes raw T-SQL against the specified data source.
/// </summary>
2026-02-24 20:44:16 +00:00
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);
2026-02-24 20:44:16 +00:00
/// <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>
2026-08-17 09:23:47 +00:00
/// Saves the T-SQL script to {SeedsRoot}/{host|tenants/{tenantId}}/{sql|postgres}/object/{fileName}.sql
/// (repo: configs/seeds). The scope folder follows the current tenant: host context writes to host/.
/// Called automatically after a successful SqlTableDesigner deploy so the script can be re-seeded.
/// </summary>
Task SaveTableScriptAsync(SaveTableScriptDto input);
/// <summary>
2026-08-17 09:23:47 +00:00
/// Deletes matching SQL seed files from the current scope's object folder when objects are
2026-08-17 05:56:52 +00:00
/// dropped from the UI.
/// Non-existing files are ignored.
/// </summary>
Task DeleteSqlDataFilesAsync(DeleteSqlDataFilesDto input);
2026-02-24 20:44:16 +00:00
}