Object.SchemaRegistry (object v0.1.2)
ETS-based registry for tracking object schemas and evolution. Provides fast lookup and atomic updates for the object schema space.
Summary
Functions
Returns a specification to start this module under a supervisor.
Finds objects compatible with the specified object.
Gets all object schemas as a map.
Gets the schema for a specific object.
Gets the schema evolution history for an object.
Lists all registered objects and their schemas.
Lists objects filtered by subtype.
Registers an object's schema in the registry.
Starts the schema registry GenServer.
Unregisters an object from the schema registry.
Updates an object's schema and records the evolution.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Finds objects compatible with the specified object.
Parameters
object_id
- ID of the reference objectcompatibility_threshold
- Minimum compatibility score (default: 0.7)
Returns
{:ok, compatible_objects}
- List of compatible objects with scores{:error, reason}
- Object not found or other error
Gets all object schemas as a map.
Returns
Map of object IDs to schemas
Gets the schema for a specific object.
Parameters
object_id
- ID of the object
Returns
{:ok, schema}
- Object schema found{:error, :not_found}
- Object not found
Gets the schema evolution history for an object.
Parameters
object_id
- ID of the object
Returns
{:ok, history}
- Evolution history list
Lists all registered objects and their schemas.
Returns
List of tuples with object IDs and schemas
Lists objects filtered by subtype.
Parameters
object_type
- Object subtype to filter by
Returns
List of objects matching the specified type
Registers an object's schema in the registry.
Parameters
object
- Object struct to register
Returns
:ok
- Object schema registered successfully
Starts the schema registry GenServer.
Creates ETS tables for fast schema lookup and evolution tracking.
Returns
{:ok, pid}
- Successfully started schema registry
Unregisters an object from the schema registry.
Parameters
object_id
- ID of the object to unregister
Returns
:ok
- Object unregistered successfully
Updates an object's schema and records the evolution.
Parameters
object_id
- ID of the object to updateschema_updates
- Schema changes to apply
Returns
:ok
- Schema updated successfully{:error, :object_not_found}
- Object not found