We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here is my class
@ConnectOfflineFirstWithSupabase( supabaseConfig: SupabaseSerializable(tableName: 'metric'), ) class Metric extends OfflineFirstWithSupabaseModel with { Metric( {required this.id, required this.shortName, required this.longName, required this.num, required this.type}); @override @Supabase(unique: true) @Sqlite(index: true, unique: true) final String id; final Map<String, dynamic> shortName; final Map<String, dynamic>? longName; @override final int num; @Supabase(enumAsString: true) @Sqlite(enumAsString: true) final MetricType type; }
The generated $toSqlite method looks like this.
Future<Map<String, dynamic>> _$MetricToSqlite(Metric instance, {required SqliteProvider provider, OfflineFirstWithSupabaseRepository? repository}) async { return { 'id': instance.id, 'short_name': jsonEncode(instance.shortName), 'long_name': jsonEncode(instance.longName ?? {}), 'num': instance.num, 'type': instance.type.name }; }
As a result a null is converted to an empty Map.
Is this is a bug or a feature 🤔
The text was updated successfully, but these errors were encountered:
fix(sqlite) : nullable maps are not cast to default values #531
8111c41
@TillJohanndeiter For sure a bug. Fixing in #532
Sorry, something went wrong.
@TillJohanndeiter fixed in brick_sqlite_generators 3.3.1
brick_sqlite_generators
3.3.1
fix(sqlite) : nullable maps are not cast to default values #531 (#532)
331ddef
No branches or pull requests
Here is my class
The generated $toSqlite method looks like this.
Future<Map<String, dynamic>> _$MetricToSqlite(Metric instance,
{required SqliteProvider provider,
OfflineFirstWithSupabaseRepository? repository}) async {
return {
'id': instance.id,
'short_name': jsonEncode(instance.shortName),
'long_name': jsonEncode(instance.longName ?? {}),
'num': instance.num,
'type': instance.type.name
};
}
As a result a null is converted to an empty Map.
Is this is a bug or a feature 🤔
The text was updated successfully, but these errors were encountered: