sqlode/query_analyzer/placeholder

Types

pub type PlaceholderOccurrence {
  PlaceholderOccurrence(
    index: Int,
    token: String,
    default_name: String,
  )
}

Constructors

  • PlaceholderOccurrence(
      index: Int,
      token: String,
      default_name: String,
    )

Values

pub fn extract(
  ctx: context.AnalyzerContext,
  engine: model.Engine,
  tokens: List(lexer.Token),
) -> List(PlaceholderOccurrence)
pub fn is_placeholder_token(value: String) -> Bool
pub fn placeholder_index_for_token(
  engine: model.Engine,
  token: String,
  occurrence: Int,
) -> option.Option(Int)
pub fn resolve_index(
  engine: model.Engine,
  token: String,
  occurrence: Int,
  seen: dict.Dict(String, Int),
) -> #(option.Option(Int), Int, dict.Dict(String, Int))

Resolves placeholder index with SQLite named-placeholder deduplication. Returns #(Option(index), next_occurrence, updated_seen_dict). For SQLite named tokens (not bare ?), reuses the index of the first occurrence so that the same placeholder always maps to the same index.

pub fn sequential_placeholder(engine: model.Engine) -> Bool
pub fn unique(
  occurrences: List(PlaceholderOccurrence),
) -> List(PlaceholderOccurrence)
Search Document