Selecto.FieldResolver.ParameterizedParser
(Selecto v0.4.5)
Copy Markdown
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
# 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}
]
}
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.
Types
Functions
@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 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.