Skip to content

$ref Support for Database or Callback IntegrationΒ #4406

@aress31

Description

@aress31

Prerequisites

What theme are you using?

mui

Is your feature request related to a problem? Please describe.

My application is built with Supabase, and some of the enum fields need to be fetched dynamically from database tables. As far as I know, there isn't a straightforward or out-of-the-box solution for this. Based on my understanding of the documentation, the $ref expects to be linked to a property within the definition object.

If support for either callbacks or external sources (e.g., databases) could be added, it would significantly enhance the versatility, developer experience (DX), and overall ease of use of this library.

Describe the solution you'd like

A solution could include a new valueGetter property that supports an asynchronous function to fetch relevant data. The returned array/value from this function would automatically set the fetched data as the value/enum to be consumed and dynamically manage the loading state.

Describe alternatives you've considered

An inefficient workaround that requires writing a lot of code to iterate through fields, handle specific ones, and implement custom widgets. In other words, adding unnecessary complexity and excessive code just to achieve this very important feature that is needed for most modern applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions