schultek / stormberry

Access your postgres database effortlessly from dart code.
https://pub.dev/packages/stormberry
MIT License
68 stars 17 forks source link

Build runner error when attempting to generate simple one-to-many relationship #30

Closed kylehayes closed 1 year ago

kylehayes commented 2 years ago

A simple reproducible example is:

@Model()
abstract class Foo {
  @PrimaryKey()
  String get id;
  List<Bar> get bars;
}

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

This results in the following build_runner error:

Failed to build database schema:

type 'ReferenceColumnBuilder' is not a subtype of type 'ForeignColumnBuilder' of 'value'
schultek commented 2 years ago

Strange that this wasn't catched before, I'll look into it.

schultek commented 2 years ago

Should be fixed on main. Before I release can you test with:

dependency_overrides:
  stormberry:
    git: github.com/schultek/stormberry