Skip to content

Use facades for API and cleanup tech debt #56

@WhyAsh5114

Description

@WhyAsh5114

For example: create() right now takes Prisma.Args<Delegate, "create">, tx?: TransactionType as parameters, but it should be just Prisma.Args<Delegate, "create">.

We should create a facade to hide this current create(), probably by prefixing it with an _, and have a higher-level API that takes care of transaction creation and makes the tx param required instead of optional.

This will simplify the API, make it more similar to Prisma, and reduce transaction bugs when passing around the tx parameter. However, it will increase the complexity of the client's situation. Maybe something to work on in the future.

Tech debt cleanup:

  • Better _getStoresNeeded() handling
  • An abstract class for all model classes instead of a base class
  • Better _applyRelations() for all clauses
  • Facade API
  • Cleanup repetitive code
  • Use for (const elem of arr) instead of arr.forEach((elem) => {})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions