33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Sozsoft.SqlQueryManager.Domain.Services;
|
|
|
|
/// <summary>
|
|
/// Provides SQL templates for creating database objects
|
|
/// </summary>
|
|
public interface ISqlTemplateProvider
|
|
{
|
|
/// <summary>Get stored procedure template.</summary>
|
|
string GetStoredProcedureTemplate(string procedureName, string schemaName = "dbo");
|
|
|
|
/// <summary>Get view template.</summary>
|
|
string GetViewTemplate(string viewName, string schemaName = "dbo", bool withSchemaBinding = false);
|
|
|
|
/// <summary>
|
|
/// Get function template. functionType: "Scalar" | "TableValued" | "InlineTableValued"
|
|
/// </summary>
|
|
string GetFunctionTemplate(string functionName, string functionType = "Scalar", string schemaName = "dbo");
|
|
|
|
/// <summary>Get query template with common patterns.</summary>
|
|
string GetQueryTemplate(string queryType);
|
|
|
|
/// <summary>Get available query template types.</summary>
|
|
List<QueryTemplateInfo> GetAvailableQueryTemplates();
|
|
}
|
|
|
|
public class QueryTemplateInfo
|
|
{
|
|
public string Type { get; set; }
|
|
public string Name { get; set; }
|
|
public string Description { get; set; }
|
|
}
|