Skip to content

Complete rewrite proposal #1078

@0x00A1FA

Description

@0x00A1FA

Describe the feature

Dear Mr Becker,

I would like to kindly propose that we would start a collab on rewriting this whole package.

I am sure that you have learned a lot of things during the creation of Pinia ORM, so I would like to ask you if you would be interested in rewriting everything for v2.0.

The aspects of the package that I would like to focus on are:

  1. Generic types (there are lots of possible improvements that could be achieved by generics see feat: Attribute autocompletion in where and with #816 for example);
  2. Better hook types (Using hooks with Typescript #1067);
  3. Better Model API:
    Typing a Partial type for Element taking into account the field declaration for the current Model instance. For example, let's say we have a Post model that has the following fields: @Uid field and a @Str(null) declare title: string | null. My proposed/theoretical RequiredModelAttributes<TModel extends Model> would see which fields can be null (in this case it would be the title field) and return a type that has all the required fields. This type could be used when using the Repository.save method (i.e. Repository.save<TModel extends Model>(model: RequiredModelAttributes<TModel>).
  4. Implement library interface overloads for globally declaring what entities the app has (e.g. module redeclaration/overloading with an Entities interface).

Let me know what you think, sir. I'm confident this could revolutionize the way people create Vue apps.

Thank you for your consideration!

All the best,
Alfa

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions