RenameProperties

io.getquill.norm.RenameProperties
class RenameProperties(traceConfig: TraceConfig)

Rename properties now relies on the Quats themselves to propagate field renames. The previous iterations of this phase relied on schema propagation via stateful transforms holding field-renames which were then compared to Property AST elements. This was a painstakingly complex and highly error-prone especially when embedded objects were used requiring computation of sub-schemas in a process called 'schema protraction'. The new variation of this phase relies on the Quats directly since the Quats of every Identity, Lift, etc... now know what the field-names contained therein as well as the sub-Quats of any embedded property. This is fairly simple process:

  • Learning what Quats have which renames is simple since this can be propagated from the Quats of the Entity objects, to the rest of the AST.

This has the simple requirement that renames must be propagated fully before they are actually committed so that the knowledge of what needs to be renamed into what can be distributed easily throughout the AST.

  • Once these future-renames are staged to Quats through the AST, a simple stateless reduction will then apply the renames to the Property AST elements around the Ident's (and potentially Lifts etc...) with the renamed Quats.

The entire process above can be done with a series of stateless transformations with straightforward operations since the majority of the logic actually lives within the Quats themselves.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply(ast: Ast): Ast