Results 42 comments of

## In tRPC If we have the following entities: ```ts export const User = new EntitySchema({ name: "User", properties: { id: { primary: true, type: "number" }, email: { type:...

In fact, the biggest reason I want Mikro Entity to follow the `standard schema` is that it allows us to use the Entity Schema directly in third-party libraries without wrapping...

You're quite right that a wrapper function that provides extended functionality is quite necessary. In addition to the relations' types you mentioned, more frequent usage scenes are arrays and nullable:...

> Those examples look like we should implement all those helpers like .optional() and whatnot, and I don't see a proper reason to do that. Also, such things can easily...

Additionally, for complete type safety, we need a hook that can populate default values for entities when `em.create()` is called. Currently, default values declared via `onCreate` or `default` only take...

`defineEntity` is a very appropriate name. I will refactor a version as soon as possible.

> Maybe you could extract some smaller part of this PR which we could merge right ahead, so the PR checks would start for you without me allowing them (you...

@B4nan The new `defineEntity` feature has been completed and includes comprehensive tests. Next, we can consider updating the documentation.

@B4nan I've added fully documents for `defineEntity`. If there are any areas that could benefit from improvement or further discussion, please feel free to let me know.

@B4nan Thank you for the suggestions you provided regarding this PR. This PR has completed a well-refined `Zod-like` API and provided relevant documentation. However, there is still some room for...