Attributes
- Companion
- class
- Source
- AvroPrism.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AvroPrism.type
Members list
Value members
Concrete methods
Root AvroPrism[S], summoning the schema from the codec (AvroCodec[S].schema). The reader schema always matches the codec's — there is no explicit-schema overload, since a reader schema diverging from its codec is a footgun (silent misreads on structural drift).
Root AvroPrism[S], summoning the schema from the codec (AvroCodec[S].schema). The reader schema always matches the codec's — there is no explicit-schema overload, since a reader schema diverging from its codec is a footgun (silent misreads on structural drift).
Attributes
- Source
- AvroPrism.scala
Extensions
Extensions
.field(_.x) — drill via selector lambda.
.fieldNamed[B]("schema_name") — drill by the EXPLICIT schema field name, bypassing resolution entirely. The escape hatch for a hand-written codec the resolver cannot read (a field list that both renames beyond recognition and reorders, a column bearing another field's name, two columns normalising alike); the common (derived / order-preserving / name-transformed) codecs need .field(_.x) instead, which resolves the name for you.
.fieldNamed[B]("schema_name") — drill by the EXPLICIT schema field name, bypassing resolution entirely. The escape hatch for a hand-written codec the resolver cannot read (a field list that both renames beyond recognition and reorders, a column bearing another field's name, two columns normalising alike); the common (derived / order-preserving / name-transformed) codecs need .field(_.x) instead, which resolves the name for you.
The name is CHECKED against the schema it will be looked up in, at construction (issue #95): a name the record does not carry throws rather than Missing silently at runtime. A MAP parent is carved out — .fieldNamed is also how a map KEY is addressed, and an absent key is data, not a mistake. To feature-detect a RECORD field, ask the schema: codec.schema.getField(name).
Attributes
- Source
- AvroPrism.scala
.at(i) — drill into the i-th array element / map entry.
.union[Branch] — drill into a union alternative by branch type.
.each — split into an AvroTraversal over the iterated array.
.fields(_.a, _.b, ...) — focus a NamedTuple over selected fields.
.fields(_.a, _.b, ...) — focus a NamedTuple over selected fields.
The AvroCodec for the synthesised NamedTuple is summoned at the call site; with no hand-written given in scope it auto-derives through kindlings. That works for '''2 to 22''' selectors. At 23 or more, Scala has no TupleN spelling left — the focus type IS a *: cons chain — and kindlings 0.3.0 / hearth 0.4.0 cannot construct one, so the call fails to compile with too many arguments for constructor *:. Chain two .fields covers, or drill with .field, until the dependency moves to hearth ≥ 0.4.2. (Issue #96.)
Attributes
- Source
- AvroPrism.scala