Skip to content

Releases: ridafkih/schemix

v1.5.0

30 Sep 04:08
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.4.0...v1.5.0

v1.4.0

24 Sep 17:16
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.3.0...v1.4.0

v1.3.0

12 Sep 09:24
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.0...v1.3.0

v1.2.0

31 Aug 18:11
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.4...v1.2.0

v1.1.2

14 Aug 01:12
Compare
Choose a tag to compare

Full Changelog: v0.6.0...v1.1.2

This release of Schemix drastically changes the functionality of the library.

Schema Indexing

Schemix will now automatically index the folders relative to the file in which the createSchema function is called for three folders.

  • ./models/
  • ./mixins/
  • ./enums/

It will pull the respective items from these folders, register them into the schema, and include it in the schema export.

Model Declaration

The way in which models, enums, and mixins are declared has changed. Now, you import createModel, createEnum, and createMixin from the library itself, the name of the item will default to the file name, but an overriding name can be provided as the first parameter for these functions.

This means you no longer need to define the item in the index, import it into an external configuration file, and then import that configuration back into the index. This will all be managed automatically.

// models/User.model.ts
import { createModel } from "../../dist";

import PostModel from "./Post.model";
import UUIDMixin from "../mixins/UUID.mixin";

export default createModel((UserModel) => {
  UserModel
    .mixin(UUIDMixin)
    .relation("friends", UserModel, { list: true, name: "friends" })
    .relation("friendsRelation", UserModel, { list: true, name: "friends" })
    .relation("posts", PostModel, { list: true });
});

The name in the aforementioned model will default to User, as that is the name of the file. If we want to change it to UserModel, for example, we can do so as follows.

// models/User.model.ts
// ...

export default createModel("UserModel", (UserModel) => {
  UserModel
    .mixin(UUIDMixin)
    .relation("friends", UserModel, { list: true, name: "friends" })
    .relation("friendsRelation", UserModel, { list: true, name: "friends" })
    .relation("posts", PostModel, { list: true });
});

Contributions

If any issues are discovered, suggestions can be provided, etc., please get in contact! Feel free to open an issue, or PR!

v0.6.0

02 Aug 23:52
Compare
Choose a tag to compare

What's Changed

  • feat: support multiple generators by @itsjxck in #8

New Contributors

Full Changelog: v0.5.13...v0.6.0

v0.5.13

06 Jul 22:48
Compare
Choose a tag to compare

What's Changed

  • feat: 🎨 add ability to pass in "env" key in datasource "shadowDatabaseUrl" prop by @evist0 in #6

New Contributors

  • @evist0 made their first contribution in #6

Full Changelog: v0.5.12...v0.5.13

v0.5.12

11 May 15:51
bbd98e1
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.11...v0.5.12

v0.5.11

11 May 07:49
Compare
Choose a tag to compare

Number Types

This adds the Decimal, and BigInt types to Schemix.
The corresponding methods are PrismaModel#bigInt and PrismaModel#decimal, alongside the other model chain methods.