Добавьте файлы проекта.
This commit is contained in:
17
SQLLinter/Infrastructure/Rules/InsertStarRule.cs
Normal file
17
SQLLinter/Infrastructure/Rules/InsertStarRule.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.SqlServer.TransactSql.ScriptDom;
|
||||
using SQLLinter.Common;
|
||||
|
||||
namespace SQLLinter.Infrastructure.Rules;
|
||||
|
||||
public class InsertStarRule : BaseRuleVisitor
|
||||
{
|
||||
public override string Text => "Запрещено INSERT без столбцов.";
|
||||
|
||||
public override void Visit(InsertStatement node)
|
||||
{
|
||||
if (node.InsertSpecification.Columns.Count == 0) // INSERT без перечисления колонок
|
||||
{
|
||||
AddViolation(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user