2026-02-24 20:44:16 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Sozsoft.SqlQueryManager.Domain.Services;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides SQL templates for creating database objects
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISqlTemplateProvider
|
|
|
|
|
{
|
2026-03-02 18:31:49 +00:00
|
|
|
/// <summary>Get stored procedure template.</summary>
|
2026-02-24 20:44:16 +00:00
|
|
|
string GetStoredProcedureTemplate(string procedureName, string schemaName = "dbo");
|
2026-03-02 18:31:49 +00:00
|
|
|
|
|
|
|
|
/// <summary>Get view template.</summary>
|
2026-02-24 20:44:16 +00:00
|
|
|
string GetViewTemplate(string viewName, string schemaName = "dbo", bool withSchemaBinding = false);
|
2026-03-02 18:31:49 +00:00
|
|
|
|
2026-02-24 20:44:16 +00:00
|
|
|
/// <summary>
|
2026-03-02 18:31:49 +00:00
|
|
|
/// Get function template. functionType: "Scalar" | "TableValued" | "InlineTableValued"
|
2026-02-24 20:44:16 +00:00
|
|
|
/// </summary>
|
2026-03-02 18:31:49 +00:00
|
|
|
string GetFunctionTemplate(string functionName, string functionType = "Scalar", string schemaName = "dbo");
|
|
|
|
|
|
|
|
|
|
/// <summary>Get query template with common patterns.</summary>
|
2026-02-24 20:44:16 +00:00
|
|
|
string GetQueryTemplate(string queryType);
|
2026-03-02 18:31:49 +00:00
|
|
|
|
|
|
|
|
/// <summary>Get available query template types.</summary>
|
2026-02-24 20:44:16 +00:00
|
|
|
List<QueryTemplateInfo> GetAvailableQueryTemplates();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class QueryTemplateInfo
|
|
|
|
|
{
|
|
|
|
|
public string Type { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Description { get; set; }
|
|
|
|
|
}
|