-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(supabase-integration): Supabase query includes join even though there is no associationForeignKey defined #425
Comments
@devj3ns Can you provide the class definition for I'm interested in knowing how the adapter has interpreted this class. It should only make those associations if the builder recognizes the declared type to be a sibling to the model you're using (assuming the model where Good catch on the |
@tshedor, @ConnectOfflineFirstWithSupabase()
class WindowType extends OfflineFirstWithSupabaseModel {
WindowType({
required this.id,
required this.glazing,
required this.frameMaterial,
required this.manufacturingYear,
required this.locations,
});
@Sqlite(unique: true, index: true)
@Supabase(unique: true)
final UUID id;
@Sqlite(enumAsString: true, nullable: true)
@Supabase(enumAsString: true, nullable: true)
final WindowGlazing? glazing;
@Sqlite(enumAsString: true, nullable: true)
@Supabase(enumAsString: true, nullable: true)
final WindowFrameMaterial? frameMaterial;
final int? manufacturingYear;
final String? locations;
} |
If it's a model, shouldn't it have a database table equivalent? Otherwise it should be a serdes if it's only JSONB in Supabase |
Yes, you are totally right. I will change that. |
I have a
BuildingWindows
model which has the following field:Because this is stored as a JSONB field in the Supabase DB (to simplify the sync), it does not specify a
foreignKey
because there is no remoteWindowType
table.Even though the
foreignKey
is null, the REST Request includes a join inside the select clause, which should not be the case in my opinion. Because of the invalid join, the Postgrest API throws the following exception:Moreover, I noticed, that the
associationForeignKey
field inside the adapter isassociationForeignKey: 'null'
instead ofassociationForeignKey: null
when noassociationForeignKey
was provided in the model field@Supabase
annotation.The text was updated successfully, but these errors were encountered: