@wearesage/schema
    Preparing search index...

    Class SchemaReflector

    SchemaReflector provides utilities for inspecting and validating schema metadata from entity classes.

    Index

    Constructors

    Methods

    • Automatically detect and register relationships from property types This method would be used to enhance the reflection capabilities in the future

      Parameters

      • entityClass: Function

        The entity class to analyze

      Returns void

    • Infer relationship type based on property type This method can be used to automatically determine relationship types based on TypeScript's metadata when using TypeScript with emitDecoratorMetadata

      Parameters

      • target: any

        The target object (prototype)

      • propertyKey: string

        The property name

      Returns "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many"

      The inferred relationship type or undefined if it cannot be determined

    • Parameters

      • entity: any

      Returns { errors: string[]; valid: boolean }