You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gearshaft's EntityStore and PostgresDocumentStore currently require entities to be implemented using classes. Class constructors are the expected value of the entity parameter when creating such stores.
Existing users would be familiar with the following entity store declaration:
The proposed change would instead require users to provide a function to instantiate entities. For class-based entities, the syntax would look as follows:
Gearshaft's EntityStore and PostgresDocumentStore currently require entities to be implemented using classes. Class constructors are the expected value of the
entity
parameter when creating such stores.Existing users would be familiar with the following entity store declaration:
The proposed change would instead require users to provide a function to instantiate entities. For class-based entities, the syntax would look as follows:
Note, the
entity
parameter now encapsulates how the entities are instantiated.Reasoning
The proposed change enables more flexible construction of entities and lifts the requirement for all entities to be implemented as classes.
Plan
entity
parameter usageentity
parameter usageentity
parameter usageThe text was updated successfully, but these errors were encountered: