Skip to content

Releases: schultek/stormberry

v0.12.0

27 Feb 10:19
Compare
Choose a tag to compare
  • Support self-joins. Models can now have relations to itself.
  • Added value property to QueryParams to supply custom query parameters.
  • Added @BindTo() annotation to resolve ambiguous field relations.

When you have multiple relations between the same types, it may be ambiguous fields refer to each other.
In those cases, you can use the @BindTo(#otherField) annotation like this:

@Model()
abstract class User {
  @PrimaryKey()
  String get id;

  @BindTo(#author)
  List<Post> get posts;
  @BindTo(#likes)
  List<Post> get liked;
}

@Model()
abstract class Post {
  @PrimaryKey()
  String get id;

  @BindTo(#posts)
  User get author;
  @BindTo(#liked)
  List<User> get likes;
}

v0.10.0

23 Jan 10:02
Compare
Choose a tag to compare
  • [BREAKING] Switched to generating part files for each model.
    • Migrate by adding part <myfile>.schema.dart on top of each model file.
  • [BREAKING] Changed how Views are defined.
    • The @Model() annotation now only defines the names of existing views as Symbols:
      @Model(views: [#Full, #Reduced, #Other]).
    • Field modifications are done by annotating the specific field with either @HiddenIn(#MyView),
      @ViewedIn(#MyView, as: #OtherView) and @TransformedIn(#MyView, by: MyTransformer()).
  • The CLI supports setting connection values via command args or prompts missing values.
  • Views are now virtual (queries) and not written to the database. This enables more flexibility for queries
    and fixes some migration issues.
  • All query inputs are now properly parameterized to prevent sql injections.
  • [BREAKING] The on conflict clause for inserts is removed. Inserts now fail when a given key already exists.
  • Added proper testing.