Package-level declarations

Types

Link copied to clipboard
fun interface DiagnosticReporter

Receives diagnostics emitted by a rule.

Link copied to clipboard
abstract class RegexRule(ruleName: String, pattern: String, message: String, val defaultSeverity: Severity = Severity.Warning, val defaultEnable: Boolean = true, val targetCapability: DialectCapability? = null, hashLineComments: Boolean = false) : Rule

Base implementation for rules that report regular expression matches in masked SQL source text.

Link copied to clipboard
interface Rule

Lint or formatting rule contributed by a rule set.

Link copied to clipboard
interface RuleContext

Stable analysis view exposed to custom rules.

Link copied to clipboard
fun interface RuleProvider

Creates fresh rule instances for thread-safe analysis.

Link copied to clipboard
interface RuleSetProvider

Provides a named collection of rules.

Link copied to clipboard
class SqlFacts(val statements: List<SqlStatementFacts> = emptyList())

Stable SQL structure facts exposed to custom rules.

Link copied to clipboard
class SqlJoinFacts(val range: SourceRange, val kind: String, val table: SqlTableReferenceFacts)

Stable facts for a JOIN clause.

Link copied to clipboard
class SqlQualifiedReferenceFacts(val range: SourceRange, val qualifier: String, val name: String)

Stable facts for a qualified reference such as table.column.

Link copied to clipboard
class SqlResultColumnFacts(val range: SourceRange, val alias: String? = null, val wildcard: Boolean = false)

Stable facts for a SELECT result column.

Link copied to clipboard
class SqlSelectFacts(val selectListRange: SourceRange, val resultColumns: List<SqlResultColumnFacts>)

Stable facts for a SELECT statement.

Link copied to clipboard
class SqlStatementFacts(val kind: SqlStatementKind, val range: SourceRange, val select: SqlSelectFacts? = null, val tableReferences: List<SqlTableReferenceFacts> = emptyList(), val joins: List<SqlJoinFacts> = emptyList(), val qualifiedReferences: List<SqlQualifiedReferenceFacts> = emptyList())

Stable facts for one top-level SQL statement.

Link copied to clipboard

Coarse statement kinds used by parser-backed rules.

Link copied to clipboard
class SqlTableReferenceFacts(val range: SourceRange, val name: String? = null, val alias: String? = null, val subquery: Boolean = false)

Stable facts for a table or derived-table reference.

Link copied to clipboard
class SqlToken(val text: String, val startOffset: Int, val endOffset: Int)

SQL-like source token outside comments and quoted text.

Properties

Link copied to clipboard

Default enablement derived from Rule.defaultEnable.

Functions

Link copied to clipboard
fun Map<String, String>.booleanOption(name: String, defaultValue: Boolean): Boolean

Reads a strict boolean option from rule configuration.

Link copied to clipboard

Reads a comma-separated string list from rule configuration.

Link copied to clipboard

Returns true when this token matches value ignoring case.

Link copied to clipboard
fun String.maskSqlCommentsAndQuotedText(hashLineComments: Boolean = false): String

Replaces comments and quoted text with spaces while preserving offsets.

Link copied to clipboard

Converts a source offset into a 1-based line/column position.

Link copied to clipboard
fun Map<String, String>.positiveIntOption(name: String, defaultValue: Int): Int

Reads a positive integer option from rule configuration.

Link copied to clipboard
fun String.rangeAtOffsets(startOffset: Int, endOffset: Int): SourceRange

Converts source offsets into a 1-based line/column range.

Link copied to clipboard

Splits a token stream into statements at semicolon tokens.

Link copied to clipboard
fun String.sqlTokens(hashLineComments: Boolean = false): Sequence<SqlToken>

Tokenizes SQL-like identifiers and semicolons outside comments and quoted text.