Selecto.FieldResolver.ParameterizedParser (Selecto v0.3.16)
Parser for parameterized joins with dot notation support.
This module handles parsing field references that include parameterized joins
using the new dot notation syntax: table.field and table:param1:param2.field
examples
Examples
# Simple dot notation
"posts.title" → %{type: :qualified, join: "posts", field: "title"}
# Parameterized join with single parameter
"posts:published.title" → %{type: :parameterized, join: "posts", field: "title", parameters: []}
# Multiple parameters with type inference
"products:electronics:25.0:true.name" → %{
type: :parameterized,
join: "products",
field: "name",
parameters: [
{:string, "electronics"},
{:float, 25.0},
{:boolean, true}
]
}
Link to this section Summary
Functions
Parse a field reference string into its components.
Parse parameters from a join string like "table:param1:param2"
Parse a single parameter string into a typed value. Used for testing and debugging individual parameters.
Validate parsed parameters against join parameter definitions.
Link to this section Types
parameter()
parsed_field()
Link to this section Functions
parse_field_reference(field_ref)
@spec parse_field_reference(String.t()) :: {:ok, parsed_field()} | {:error, String.t()}
Parse a field reference string into its components.
Supports dot notation with optional parameterized joins.
parse_join_with_parameters(join_string)
Parse parameters from a join string like "table:param1:param2"
parse_single_parameter(param)
Parse a single parameter string into a typed value. Used for testing and debugging individual parameters.
validate_parameters(provided_params, param_definitions)
Validate parsed parameters against join parameter definitions.