SqlIdentifierChecker

zio.blocks.sql.SqlIdentifierChecker

Pure identifier checker for SQL literal parts produced by the sql interpolator.

Tokenizes literal parts respecting single-quoted string literals, double-quoted identifiers and interpolation holes, subtracts the SQL keyword/function allowlist, tracks aliases introduced via AS alias, and reports unknown identifiers with Levenshtein suggestions.

Attributes

Source
SqlIdentifierChecker.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Diagnostic(message: String, position: Int, suggestion: Option[String])

Attributes

Source
SqlIdentifierChecker.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def validate(parts: Seq[String], knownTables: Set[String], knownColumns: Set[String]): List[Diagnostic]

Attributes

Source
SqlIdentifierChecker.scala
def validate(parts: Seq[String], knownTables: Set[String], knownColumns: Set[String], allowlist: Set[String]): List[Diagnostic]

Attributes

Source
SqlIdentifierChecker.scala
def validate(parts: Seq[String], tables: Seq[Table[_]]): List[Diagnostic]

Attributes

Source
SqlIdentifierChecker.scala
def validate(parts: Seq[String], tables: Seq[Table[_]], allowlist: Set[String]): List[Diagnostic]

Attributes

Source
SqlIdentifierChecker.scala
def validate(parts: Seq[String], knownNames: Set[String], allowlist: Set[String], dummy: Unit): List[Diagnostic]

Attributes

Source
SqlIdentifierChecker.scala

Concrete fields

val DefaultAllowlist: Set[String]

Default SQL allowlist — keywords, types, functions and pseudo-identifiers that are never flagged as unknown. Comparison is case-insensitive.

Default SQL allowlist — keywords, types, functions and pseudo-identifiers that are never flagged as unknown. Comparison is case-insensitive.

Attributes

Source
SqlIdentifierChecker.scala