@grandlinex/kernel
    Preparing search index...

    Class ESchemaEditor<T>

    Type Parameters

    Index
    • Adds properties to the schema based on the provided options.

      Parameters

      • ...options: ESchemaAddOption[]

        The options describing the properties to add. Each option may specify a key, a schema or an entity, and optionally whether the property is a list, nullable, or required.

      Returns ESchemaEditor<T>

      The editor instance for chaining.

    • Removes the specified keys from the schema's properties and updates the required list.

      Parameters

      • ...keys: (keyof T)[]

        The keys of the properties to remove.

      Returns ESchemaEditor<T>

      The editor instance for method chaining.

    • Generates a JSON schema representation from a CoreEntity instance.

      This method inspects the entity's metadata to construct a schema object describing the entity's shape. The resulting schema contains:

      • type: always "object".
      • description: a string indicating the entity name.
      • required: an array of property names that are defined on the entity.
      • properties: an object mapping each property name to an object that includes the resolved database type and its nullability.

      If no metadata is found for the provided entity, the method returns undefined.

      Type Parameters

      Parameters

      • entity: T

        The entity instance for which to create a schema.

      Returns SSchemaElObj | undefined

      The generated schema object, or undefined if the entity's metadata could not be retrieved.