Releases: schultek/stormberry
Releases · schultek/stormberry
v0.12.0
- Support self-joins. Models can now have relations to itself.
- Added
value
property toQueryParams
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
- [BREAKING] Switched to generating
part
files for each model.- Migrate by adding
part <myfile>.schema.dart
on top of each model file.
- Migrate by adding
- [BREAKING] Changed how Views are defined.
- The
@Model()
annotation now only defines the names of existing views asSymbol
s:
@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
- 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.