Closed mhmzdev closed 1 year ago
I found the issue. Its with int4
vs int8
.
Stormberry uses int8
by default for all integer types, including lists of ints -> _int8
. However the postgres
package currently only supports _int4
(list of int4) and therefore has a type mismatch both when inserting and querying data.
For querying you can work around this by changing the likes
database column manually to _int4
.
For inserting/updating you would have to modify the post.schema.dart
file and replace all :_int8
with :_int4
.
I will try to open a pr on the postgres package to add support, but that might take some time until released
@mhmzdev This is already merged. When updating postgres it should work without any changes to stormberry.
Awesome!! @schultek Thank you so much for figuring this out.
Lemme, try updating postgres and see if it works
Worked like a charm! ✅ Closing the issue.
I've added just a
List<int> likes
into thePost
model. Then added some dummy data in postgres SQL. But it seems that stormberry isn't parsing the list correctly.The rest of the models are working fine, only with
List
in them are throwing this exception. I'm using0.11.0
latest versionModel class and its schema file code is below:
post.dart
post.schema.dart