diff --git a/packages/stream_chat/lib/src/core/models/message.dart b/packages/stream_chat/lib/src/core/models/message.dart index 0d43bdaa5..04ec76fb6 100644 --- a/packages/stream_chat/lib/src/core/models/message.dart +++ b/packages/stream_chat/lib/src/core/models/message.dart @@ -44,6 +44,7 @@ class Message extends Equatable { this.localUpdatedAt, DateTime? deletedAt, this.localDeletedAt, + this.messageTextUpdatedAt, this.user, this.pinned = false, this.pinnedAt, @@ -192,6 +193,10 @@ class Message extends Equatable { @JsonKey(includeToJson: false) DateTime? get deletedAt => localDeletedAt ?? remoteDeletedAt; + /// Reserved field indicating when the message text was edited. + @JsonKey(includeToJson: false) + final DateTime? messageTextUpdatedAt; + /// Indicates when the message was deleted locally. @JsonKey(includeToJson: false, includeFromJson: false) final DateTime? localDeletedAt; @@ -265,6 +270,7 @@ class Message extends Equatable { 'created_at', 'updated_at', 'deleted_at', + 'message_text_updated_at', 'user', 'pinned', 'pinned_at', @@ -304,6 +310,7 @@ class Message extends Equatable { DateTime? localUpdatedAt, DateTime? deletedAt, DateTime? localDeletedAt, + DateTime? messageTextUpdatedAt, User? user, bool? pinned, DateTime? pinnedAt, @@ -373,6 +380,7 @@ class Message extends Equatable { localUpdatedAt: localUpdatedAt ?? this.localUpdatedAt, deletedAt: deletedAt ?? remoteDeletedAt, localDeletedAt: localDeletedAt ?? this.localDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt ?? this.messageTextUpdatedAt, user: user ?? this.user, pinned: pinned ?? this.pinned, pinnedAt: pinnedAt ?? this.pinnedAt, @@ -413,6 +421,7 @@ class Message extends Equatable { localUpdatedAt: other.localUpdatedAt, deletedAt: other.remoteDeletedAt, localDeletedAt: other.localDeletedAt, + messageTextUpdatedAt: other.messageTextUpdatedAt, user: other.user, pinned: other.pinned, pinnedAt: other.pinnedAt, @@ -472,6 +481,7 @@ class Message extends Equatable { remoteUpdatedAt, localDeletedAt, remoteDeletedAt, + messageTextUpdatedAt, user, pinned, pinnedAt, diff --git a/packages/stream_chat/lib/src/core/models/message.g.dart b/packages/stream_chat/lib/src/core/models/message.g.dart index 883408d0e..2b089a4d1 100644 --- a/packages/stream_chat/lib/src/core/models/message.g.dart +++ b/packages/stream_chat/lib/src/core/models/message.g.dart @@ -52,6 +52,9 @@ Message _$MessageFromJson(Map json) => Message( deletedAt: json['deleted_at'] == null ? null : DateTime.parse(json['deleted_at'] as String), + messageTextUpdatedAt: json['message_text_updated_at'] == null + ? null + : DateTime.parse(json['message_text_updated_at'] as String), user: json['user'] == null ? null : User.fromJson(json['user'] as Map), diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 9d8db351b..1fbb833e7 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,3 +1,9 @@ +## Upcoming + +✅ Added + +- Messages by default now show an "Edited" label if text is edited. Use `showEditedLabel` to disable this functionality. + ## 8.1.0 🐞 Fixed diff --git a/packages/stream_chat_flutter/example/ios/Runner/AppDelegate.swift b/packages/stream_chat_flutter/example/ios/Runner/AppDelegate.swift index 70693e4a8..b63630348 100644 --- a/packages/stream_chat_flutter/example/ios/Runner/AppDelegate.swift +++ b/packages/stream_chat_flutter/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/stream_chat_flutter/lib/src/localization/translations.dart b/packages/stream_chat_flutter/lib/src/localization/translations.dart index 2e8a97e92..3cf3fd42f 100644 --- a/packages/stream_chat_flutter/lib/src/localization/translations.dart +++ b/packages/stream_chat_flutter/lib/src/localization/translations.dart @@ -69,6 +69,9 @@ abstract class Translations { /// The label for message deleted String get messageDeletedLabel; + /// The label for showing the message is edited + String get editedMessageLabel; + /// The label for message reactions String get messageReactionsLabel; @@ -455,6 +458,9 @@ class DefaultTranslations implements Translations { @override String get messageDeletedLabel => 'Message deleted'; + @override + String get editedMessageLabel => 'Edited'; + @override String get messageReactionsLabel => 'Message Reactions'; diff --git a/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart b/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart index 826f90b0a..f05f08fe6 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart @@ -20,6 +20,7 @@ class BottomRow extends StatelessWidget { required this.showInChannel, required this.showTimeStamp, required this.showUsername, + required this.showEditedLabel, required this.reverse, required this.showSendingIndicator, required this.hasUrlAttachments, @@ -56,6 +57,9 @@ class BottomRow extends StatelessWidget { /// {@macro showUsername} final bool showUsername; + /// {@macro showEdited} + final bool showEditedLabel; + /// {@macro reverse} final bool reverse; @@ -104,6 +108,7 @@ class BottomRow extends StatelessWidget { bool? showInChannel, bool? showTimeStamp, bool? showUsername, + bool? showEditedLabel, bool? reverse, bool? showSendingIndicator, bool? hasUrlAttachments, @@ -127,6 +132,7 @@ class BottomRow extends StatelessWidget { showInChannel: showInChannel ?? this.showInChannel, showTimeStamp: showTimeStamp ?? this.showTimeStamp, showUsername: showUsername ?? this.showUsername, + showEditedLabel: showEditedLabel ?? this.showEditedLabel, reverse: reverse ?? this.reverse, showSendingIndicator: showSendingIndicator ?? this.showSendingIndicator, hasUrlAttachments: hasUrlAttachments ?? this.hasUrlAttachments, @@ -156,6 +162,7 @@ class BottomRow extends StatelessWidget { final threadParticipants = message.threadParticipants?.take(2); final showThreadParticipants = threadParticipants?.isNotEmpty == true; final replyCount = message.replyCount; + final isEdited = message.messageTextUpdatedAt != null; var msg = context.translations.threadReplyLabel; if (showThreadReplyIndicator && replyCount! > 1) { @@ -185,6 +192,11 @@ class BottomRow extends StatelessWidget { message: message, messageTheme: messageTheme, ), + if (showEditedLabel && isEdited) + Text( + context.translations.editedMessageLabel, + style: messageTheme.createdAtStyle, + ), if (showTimeStamp) Text( Jiffy.parseFromDateTime(message.createdAt.toLocal()).jm, diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart index 30b75717a..0ad1034e1 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart @@ -63,6 +63,7 @@ class StreamMessageWidget extends StatefulWidget { this.onConfirmDeleteTap, this.showUsername = true, this.showTimestamp = true, + this.showEditedLabel = true, this.showReactions = true, this.showDeleteMessage = true, this.showEditMessage = true, @@ -268,6 +269,11 @@ class StreamMessageWidget extends StatefulWidget { /// {@endtemplate} final bool showTimestamp; + /// {@template showTimestamp} + /// Show edited label if message is edited + /// {@endtemplate} + final bool showEditedLabel; + /// {@template showReplyMessage} /// Show reply action /// {@endtemplate} @@ -415,6 +421,7 @@ class StreamMessageWidget extends StatefulWidget { ShowMessageCallback? onShowMessage, bool? showUsername, bool? showTimestamp, + bool? showEditedLabel, bool? showReplyMessage, bool? showThreadReplyMessage, bool? showEditMessage, @@ -465,6 +472,7 @@ class StreamMessageWidget extends StatefulWidget { widthFactor: widthFactor ?? this.widthFactor, showUserAvatar: showUserAvatar ?? this.showUserAvatar, showSendingIndicator: showSendingIndicator ?? this.showSendingIndicator, + showEditedLabel: showEditedLabel ?? this.showEditedLabel, showReactions: showReactions ?? this.showReactions, showThreadReplyIndicator: showThreadReplyIndicator ?? this.showThreadReplyIndicator, @@ -525,6 +533,10 @@ class _StreamMessageWidgetState extends State bool get showTimeStamp => widget.showTimestamp; + bool get showEditedLabel => widget.showEditedLabel; + + bool get isTextEdited => widget.message.messageTextUpdatedAt != null; + bool get showInChannel => widget.showInChannelIndicator; /// {@template hasQuotedMessage} @@ -582,7 +594,8 @@ class _StreamMessageWidgetState extends State showUsername || showTimeStamp || showInChannel || - showSendingIndicator; + showSendingIndicator || + isTextEdited; /// {@template isPinned} /// Whether [StreamMessageWidget.message] is pinned or not. @@ -695,6 +708,7 @@ class _StreamMessageWidgetState extends State streamChatTheme: _streamChatTheme, showUsername: showUsername, showTimeStamp: showTimeStamp, + showEditedLabel: showEditedLabel, showThreadReplyIndicator: showThreadReplyIndicator, showSendingIndicator: showSendingIndicator, showInChannel: showInChannel, diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart index dd1a7b84e..42da724b5 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart @@ -61,6 +61,7 @@ class MessageWidgetContent extends StatelessWidget { required this.showThreadReplyIndicator, required this.showTimeStamp, required this.showUsername, + required this.showEditedLabel, required this.messageWidget, this.onUserAvatarTap, this.borderRadiusGeometry, @@ -210,6 +211,9 @@ class MessageWidgetContent extends StatelessWidget { /// {@macro showUsername} final bool showUsername; + /// {@macro showEdited} + final bool showEditedLabel; + /// {@macro messageWidget} final StreamMessageWidget messageWidget; @@ -437,6 +441,7 @@ class MessageWidgetContent extends StatelessWidget { showThreadReplyIndicator: showThreadReplyIndicator, showTimeStamp: showTimeStamp, showUsername: showUsername, + showEditedLabel: showEditedLabel, streamChatTheme: streamChatTheme, streamChat: streamChat, hasNonUrlAttachments: hasNonUrlAttachments, diff --git a/packages/stream_chat_flutter/test/src/message_list_view/bottom_row_test.dart b/packages/stream_chat_flutter/test/src/message_list_view/bottom_row_test.dart index 41e74e635..95008eab2 100644 --- a/packages/stream_chat_flutter/test/src/message_list_view/bottom_row_test.dart +++ b/packages/stream_chat_flutter/test/src/message_list_view/bottom_row_test.dart @@ -45,6 +45,7 @@ void main() { showUsername: false, showInChannel: true, showTimeStamp: false, + showEditedLabel: false, reverse: false, showSendingIndicator: false, hasUrlAttachments: false, diff --git a/packages/stream_chat_localizations/example/lib/add_new_lang.dart b/packages/stream_chat_localizations/example/lib/add_new_lang.dart index b0d47d8ed..83538e193 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -108,6 +108,9 @@ class NnStreamChatLocalizations extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Message deleted'; + @override + String get editedMessageLabel => 'Edited'; + @override String get messageReactionsLabel => 'Message Reactions'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart index 02344f6c5..8e0497805 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart @@ -85,6 +85,9 @@ class StreamChatLocalizationsCa extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Missatge esborrat'; + @override + String get editedMessageLabel => 'Editat'; + @override String get messageReactionsLabel => 'Reaccions dels missatges'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart index 6df9da7fe..79f443752 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart @@ -80,6 +80,9 @@ class StreamChatLocalizationsDe extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Nachricht gelöscht'; + @override + String get editedMessageLabel => 'Bearbeitet'; + @override String get messageReactionsLabel => 'Nachricht-Reaktionen'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart index 28d4a0b86..896c9ec99 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart @@ -84,6 +84,9 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Message deleted'; + @override + String get editedMessageLabel => 'Edited'; + @override String get messageReactionsLabel => 'Message Reactions'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart index 5febd851a..ae5af69cf 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart @@ -86,6 +86,9 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Mensaje borrado'; + @override + String get editedMessageLabel => 'Editado'; + @override String get messageReactionsLabel => 'Reacciones de los mensajes'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart index c20be9b43..65caa9da1 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart @@ -85,6 +85,9 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Message supprimé'; + @override + String get editedMessageLabel => 'Édité'; + @override String get messageReactionsLabel => 'Réactions aux messages'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart index 84d054ed4..8c3fe43bb 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart @@ -83,6 +83,9 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'संदेश हटाये'; + @override + String get editedMessageLabel => 'संपादित'; + @override String get messageReactionsLabel => 'संदेश प्रतिक्रियाएं'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart index 55505f146..3a907d58a 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart @@ -90,6 +90,9 @@ class StreamChatLocalizationsIt extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Messaggio cancellato'; + @override + String get editedMessageLabel => 'Modificato'; + @override String get messageReactionsLabel => 'Reazioni al messaggio'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart index d03842fb0..704c87946 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart @@ -83,6 +83,9 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'メッセージ削除'; + @override + String get editedMessageLabel => '編集済み'; + @override String get messageReactionsLabel => 'メッセージのリアクション'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart index 044dd1a29..e7b1f1951 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart @@ -83,6 +83,9 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => '메시지가 삭제되었습니다'; + @override + String get editedMessageLabel => '편집됨'; + @override String get messageReactionsLabel => '메시지에 대한 응답'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart index b9b8b2442..77fd8afaa 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart @@ -84,6 +84,9 @@ class StreamChatLocalizationsNo extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Melding slettet'; + @override + String get editedMessageLabel => 'Redigert'; + @override String get messageReactionsLabel => 'Reaksjoner på melding'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart index c796b7f9c..9ea9ef1dd 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart @@ -81,6 +81,9 @@ class StreamChatLocalizationsPt extends GlobalStreamChatLocalizations { @override String get messageDeletedLabel => 'Mensagem excluída'; + @override + String get editedMessageLabel => 'Editado'; + @override String get messageReactionsLabel => 'Reações às mensagens'; diff --git a/packages/stream_chat_localizations/test/translations_test.dart b/packages/stream_chat_localizations/test/translations_test.dart index 590165c25..d581da8fc 100644 --- a/packages/stream_chat_localizations/test/translations_test.dart +++ b/packages/stream_chat_localizations/test/translations_test.dart @@ -33,6 +33,7 @@ void main() { ); expect(localizations.threadReplyLabel, isNotNull); expect(localizations.onlyVisibleToYouText, isNotNull); + expect(localizations.editedMessageLabel, isNotNull); expect(localizations.threadReplyCountText(3), isNotNull); expect( localizations.attachmentsUploadProgressText(remaining: 3, total: 10), diff --git a/packages/stream_chat_persistence/lib/src/dao/pinned_message_dao.g.dart b/packages/stream_chat_persistence/lib/src/dao/pinned_message_dao.g.dart index 09c8df615..c07e998f6 100644 --- a/packages/stream_chat_persistence/lib/src/dao/pinned_message_dao.g.dart +++ b/packages/stream_chat_persistence/lib/src/dao/pinned_message_dao.g.dart @@ -4,7 +4,6 @@ part of 'pinned_message_dao.dart'; // ignore_for_file: type=lint mixin _$PinnedMessageDaoMixin on DatabaseAccessor { - $ChannelsTable get channels => attachedDatabase.channels; $PinnedMessagesTable get pinnedMessages => attachedDatabase.pinnedMessages; $UsersTable get users => attachedDatabase.users; } diff --git a/packages/stream_chat_persistence/lib/src/dao/pinned_message_reaction_dao.g.dart b/packages/stream_chat_persistence/lib/src/dao/pinned_message_reaction_dao.g.dart index 13bb195fe..d25c2f451 100644 --- a/packages/stream_chat_persistence/lib/src/dao/pinned_message_reaction_dao.g.dart +++ b/packages/stream_chat_persistence/lib/src/dao/pinned_message_reaction_dao.g.dart @@ -4,7 +4,6 @@ part of 'pinned_message_reaction_dao.dart'; // ignore_for_file: type=lint mixin _$PinnedMessageReactionDaoMixin on DatabaseAccessor { - $ChannelsTable get channels => attachedDatabase.channels; $PinnedMessagesTable get pinnedMessages => attachedDatabase.pinnedMessages; $PinnedMessageReactionsTable get pinnedMessageReactions => attachedDatabase.pinnedMessageReactions; diff --git a/packages/stream_chat_persistence/lib/src/db/drift_chat_database.dart b/packages/stream_chat_persistence/lib/src/db/drift_chat_database.dart index a6ab0bf8c..1198a26e2 100644 --- a/packages/stream_chat_persistence/lib/src/db/drift_chat_database.dart +++ b/packages/stream_chat_persistence/lib/src/db/drift_chat_database.dart @@ -48,7 +48,7 @@ class DriftChatDatabase extends _$DriftChatDatabase { // you should bump this number whenever you change or add a table definition. @override - int get schemaVersion => 14; + int get schemaVersion => 15; @override MigrationStrategy get migration => MigrationStrategy( diff --git a/packages/stream_chat_persistence/lib/src/db/drift_chat_database.g.dart b/packages/stream_chat_persistence/lib/src/db/drift_chat_database.g.dart index 07c19c5cd..b7d8612de 100644 --- a/packages/stream_chat_persistence/lib/src/db/drift_chat_database.g.dart +++ b/packages/stream_chat_persistence/lib/src/db/drift_chat_database.g.dart @@ -225,13 +225,13 @@ class $ChannelsTable extends Channels } static TypeConverter, String> $converterownCapabilities = - ListConverter(); + ListConverter(); static TypeConverter?, String?> $converterownCapabilitiesn = NullAwareTypeConverter.wrap($converterownCapabilities); static TypeConverter, String> $converterconfig = MapConverter(); static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterextraDatan = NullAwareTypeConverter.wrap($converterextraData); } @@ -296,13 +296,12 @@ class ChannelEntity extends DataClass implements Insertable { map['type'] = Variable(type); map['cid'] = Variable(cid); if (!nullToAbsent || ownCapabilities != null) { - final converter = $ChannelsTable.$converterownCapabilitiesn; - map['own_capabilities'] = - Variable(converter.toSql(ownCapabilities)); + map['own_capabilities'] = Variable( + $ChannelsTable.$converterownCapabilitiesn.toSql(ownCapabilities)); } { - final converter = $ChannelsTable.$converterconfig; - map['config'] = Variable(converter.toSql(config)); + map['config'] = + Variable($ChannelsTable.$converterconfig.toSql(config)); } map['frozen'] = Variable(frozen); if (!nullToAbsent || lastMessageAt != null) { @@ -318,8 +317,8 @@ class ChannelEntity extends DataClass implements Insertable { map['created_by_id'] = Variable(createdById); } if (!nullToAbsent || extraData != null) { - final converter = $ChannelsTable.$converterextraDatan; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = Variable( + $ChannelsTable.$converterextraDatan.toSql(extraData)); } return map; } @@ -396,6 +395,30 @@ class ChannelEntity extends DataClass implements Insertable { createdById: createdById.present ? createdById.value : this.createdById, extraData: extraData.present ? extraData.value : this.extraData, ); + ChannelEntity copyWithCompanion(ChannelsCompanion data) { + return ChannelEntity( + id: data.id.present ? data.id.value : this.id, + type: data.type.present ? data.type.value : this.type, + cid: data.cid.present ? data.cid.value : this.cid, + ownCapabilities: data.ownCapabilities.present + ? data.ownCapabilities.value + : this.ownCapabilities, + config: data.config.present ? data.config.value : this.config, + frozen: data.frozen.present ? data.frozen.value : this.frozen, + lastMessageAt: data.lastMessageAt.present + ? data.lastMessageAt.value + : this.lastMessageAt, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, + deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, + memberCount: + data.memberCount.present ? data.memberCount.value : this.memberCount, + createdById: + data.createdById.present ? data.createdById.value : this.createdById, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('ChannelEntity(') @@ -580,15 +603,13 @@ class ChannelsCompanion extends UpdateCompanion { map['cid'] = Variable(cid.value); } if (ownCapabilities.present) { - final converter = $ChannelsTable.$converterownCapabilitiesn; - - map['own_capabilities'] = - Variable(converter.toSql(ownCapabilities.value)); + map['own_capabilities'] = Variable($ChannelsTable + .$converterownCapabilitiesn + .toSql(ownCapabilities.value)); } if (config.present) { - final converter = $ChannelsTable.$converterconfig; - - map['config'] = Variable(converter.toSql(config.value)); + map['config'] = + Variable($ChannelsTable.$converterconfig.toSql(config.value)); } if (frozen.present) { map['frozen'] = Variable(frozen.value); @@ -612,9 +633,8 @@ class ChannelsCompanion extends UpdateCompanion { map['created_by_id'] = Variable(createdById.value); } if (extraData.present) { - final converter = $ChannelsTable.$converterextraDatan; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable( + $ChannelsTable.$converterextraDatan.toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -785,6 +805,12 @@ class $MessagesTable extends Messages late final GeneratedColumn remoteDeletedAt = GeneratedColumn('remote_deleted_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); + static const VerificationMeta _messageTextUpdatedAtMeta = + const VerificationMeta('messageTextUpdatedAt'); + @override + late final GeneratedColumn messageTextUpdatedAt = + GeneratedColumn('message_text_updated_at', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( @@ -862,6 +888,7 @@ class $MessagesTable extends Messages remoteUpdatedAt, localDeletedAt, remoteDeletedAt, + messageTextUpdatedAt, userId, pinned, pinnedAt, @@ -972,6 +999,12 @@ class $MessagesTable extends Messages remoteDeletedAt.isAcceptableOrUnknown( data['remote_deleted_at']!, _remoteDeletedAtMeta)); } + if (data.containsKey('message_text_updated_at')) { + context.handle( + _messageTextUpdatedAtMeta, + messageTextUpdatedAt.isAcceptableOrUnknown( + data['message_text_updated_at']!, _messageTextUpdatedAtMeta)); + } if (data.containsKey('user_id')) { context.handle(_userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta)); @@ -1059,6 +1092,9 @@ class $MessagesTable extends Messages DriftSqlType.dateTime, data['${effectivePrefix}local_deleted_at']), remoteDeletedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}remote_deleted_at']), + messageTextUpdatedAt: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}message_text_updated_at']), userId: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}user_id']), pinned: attachedDatabase.typeMapping @@ -1085,21 +1121,21 @@ class $MessagesTable extends Messages } static TypeConverter, String> $converterattachments = - ListConverter(); + ListConverter(); static TypeConverter, String> $convertermentionedUsers = - ListConverter(); + ListConverter(); static TypeConverter, String> $converterreactionCounts = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterreactionCountsn = NullAwareTypeConverter.wrap($converterreactionCounts); static TypeConverter, String> $converterreactionScores = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterreactionScoresn = NullAwareTypeConverter.wrap($converterreactionScores); static TypeConverter?, String?> $converteri18n = - NullableMapConverter(); + NullableMapConverter(); static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterextraDatan = NullAwareTypeConverter.wrap($converterextraData); } @@ -1166,6 +1202,9 @@ class MessageEntity extends DataClass implements Insertable { /// The DateTime on which the message was deleted on the server. final DateTime? remoteDeletedAt; + /// The DateTime at which the message text was edited + final DateTime? messageTextUpdatedAt; + /// Id of the User who sent the message final String? userId; @@ -1210,6 +1249,7 @@ class MessageEntity extends DataClass implements Insertable { this.remoteUpdatedAt, this.localDeletedAt, this.remoteDeletedAt, + this.messageTextUpdatedAt, this.userId, required this.pinned, this.pinnedAt, @@ -1226,25 +1266,22 @@ class MessageEntity extends DataClass implements Insertable { map['message_text'] = Variable(messageText); } { - final converter = $MessagesTable.$converterattachments; - map['attachments'] = Variable(converter.toSql(attachments)); + map['attachments'] = Variable( + $MessagesTable.$converterattachments.toSql(attachments)); } map['state'] = Variable(state); map['type'] = Variable(type); { - final converter = $MessagesTable.$convertermentionedUsers; - map['mentioned_users'] = - Variable(converter.toSql(mentionedUsers)); + map['mentioned_users'] = Variable( + $MessagesTable.$convertermentionedUsers.toSql(mentionedUsers)); } if (!nullToAbsent || reactionCounts != null) { - final converter = $MessagesTable.$converterreactionCountsn; - map['reaction_counts'] = - Variable(converter.toSql(reactionCounts)); + map['reaction_counts'] = Variable( + $MessagesTable.$converterreactionCountsn.toSql(reactionCounts)); } if (!nullToAbsent || reactionScores != null) { - final converter = $MessagesTable.$converterreactionScoresn; - map['reaction_scores'] = - Variable(converter.toSql(reactionScores)); + map['reaction_scores'] = Variable( + $MessagesTable.$converterreactionScoresn.toSql(reactionScores)); } if (!nullToAbsent || parentId != null) { map['parent_id'] = Variable(parentId); @@ -1280,6 +1317,9 @@ class MessageEntity extends DataClass implements Insertable { if (!nullToAbsent || remoteDeletedAt != null) { map['remote_deleted_at'] = Variable(remoteDeletedAt); } + if (!nullToAbsent || messageTextUpdatedAt != null) { + map['message_text_updated_at'] = Variable(messageTextUpdatedAt); + } if (!nullToAbsent || userId != null) { map['user_id'] = Variable(userId); } @@ -1295,12 +1335,11 @@ class MessageEntity extends DataClass implements Insertable { } map['channel_cid'] = Variable(channelCid); if (!nullToAbsent || i18n != null) { - final converter = $MessagesTable.$converteri18n; - map['i18n'] = Variable(converter.toSql(i18n)); + map['i18n'] = Variable($MessagesTable.$converteri18n.toSql(i18n)); } if (!nullToAbsent || extraData != null) { - final converter = $MessagesTable.$converterextraDatan; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = Variable( + $MessagesTable.$converterextraDatan.toSql(extraData)); } return map; } @@ -1331,6 +1370,8 @@ class MessageEntity extends DataClass implements Insertable { remoteUpdatedAt: serializer.fromJson(json['remoteUpdatedAt']), localDeletedAt: serializer.fromJson(json['localDeletedAt']), remoteDeletedAt: serializer.fromJson(json['remoteDeletedAt']), + messageTextUpdatedAt: + serializer.fromJson(json['messageTextUpdatedAt']), userId: serializer.fromJson(json['userId']), pinned: serializer.fromJson(json['pinned']), pinnedAt: serializer.fromJson(json['pinnedAt']), @@ -1365,6 +1406,8 @@ class MessageEntity extends DataClass implements Insertable { 'remoteUpdatedAt': serializer.toJson(remoteUpdatedAt), 'localDeletedAt': serializer.toJson(localDeletedAt), 'remoteDeletedAt': serializer.toJson(remoteDeletedAt), + 'messageTextUpdatedAt': + serializer.toJson(messageTextUpdatedAt), 'userId': serializer.toJson(userId), 'pinned': serializer.toJson(pinned), 'pinnedAt': serializer.toJson(pinnedAt), @@ -1397,6 +1440,7 @@ class MessageEntity extends DataClass implements Insertable { Value remoteUpdatedAt = const Value.absent(), Value localDeletedAt = const Value.absent(), Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), Value userId = const Value.absent(), bool? pinned, Value pinnedAt = const Value.absent(), @@ -1440,6 +1484,9 @@ class MessageEntity extends DataClass implements Insertable { remoteDeletedAt: remoteDeletedAt.present ? remoteDeletedAt.value : this.remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt.present + ? messageTextUpdatedAt.value + : this.messageTextUpdatedAt, userId: userId.present ? userId.value : this.userId, pinned: pinned ?? this.pinned, pinnedAt: pinnedAt.present ? pinnedAt.value : this.pinnedAt, @@ -1450,6 +1497,71 @@ class MessageEntity extends DataClass implements Insertable { i18n: i18n.present ? i18n.value : this.i18n, extraData: extraData.present ? extraData.value : this.extraData, ); + MessageEntity copyWithCompanion(MessagesCompanion data) { + return MessageEntity( + id: data.id.present ? data.id.value : this.id, + messageText: + data.messageText.present ? data.messageText.value : this.messageText, + attachments: + data.attachments.present ? data.attachments.value : this.attachments, + state: data.state.present ? data.state.value : this.state, + type: data.type.present ? data.type.value : this.type, + mentionedUsers: data.mentionedUsers.present + ? data.mentionedUsers.value + : this.mentionedUsers, + reactionCounts: data.reactionCounts.present + ? data.reactionCounts.value + : this.reactionCounts, + reactionScores: data.reactionScores.present + ? data.reactionScores.value + : this.reactionScores, + parentId: data.parentId.present ? data.parentId.value : this.parentId, + quotedMessageId: data.quotedMessageId.present + ? data.quotedMessageId.value + : this.quotedMessageId, + replyCount: + data.replyCount.present ? data.replyCount.value : this.replyCount, + showInChannel: data.showInChannel.present + ? data.showInChannel.value + : this.showInChannel, + shadowed: data.shadowed.present ? data.shadowed.value : this.shadowed, + command: data.command.present ? data.command.value : this.command, + localCreatedAt: data.localCreatedAt.present + ? data.localCreatedAt.value + : this.localCreatedAt, + remoteCreatedAt: data.remoteCreatedAt.present + ? data.remoteCreatedAt.value + : this.remoteCreatedAt, + localUpdatedAt: data.localUpdatedAt.present + ? data.localUpdatedAt.value + : this.localUpdatedAt, + remoteUpdatedAt: data.remoteUpdatedAt.present + ? data.remoteUpdatedAt.value + : this.remoteUpdatedAt, + localDeletedAt: data.localDeletedAt.present + ? data.localDeletedAt.value + : this.localDeletedAt, + remoteDeletedAt: data.remoteDeletedAt.present + ? data.remoteDeletedAt.value + : this.remoteDeletedAt, + messageTextUpdatedAt: data.messageTextUpdatedAt.present + ? data.messageTextUpdatedAt.value + : this.messageTextUpdatedAt, + userId: data.userId.present ? data.userId.value : this.userId, + pinned: data.pinned.present ? data.pinned.value : this.pinned, + pinnedAt: data.pinnedAt.present ? data.pinnedAt.value : this.pinnedAt, + pinExpires: + data.pinExpires.present ? data.pinExpires.value : this.pinExpires, + pinnedByUserId: data.pinnedByUserId.present + ? data.pinnedByUserId.value + : this.pinnedByUserId, + channelCid: + data.channelCid.present ? data.channelCid.value : this.channelCid, + i18n: data.i18n.present ? data.i18n.value : this.i18n, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('MessageEntity(') @@ -1473,6 +1585,7 @@ class MessageEntity extends DataClass implements Insertable { ..write('remoteUpdatedAt: $remoteUpdatedAt, ') ..write('localDeletedAt: $localDeletedAt, ') ..write('remoteDeletedAt: $remoteDeletedAt, ') + ..write('messageTextUpdatedAt: $messageTextUpdatedAt, ') ..write('userId: $userId, ') ..write('pinned: $pinned, ') ..write('pinnedAt: $pinnedAt, ') @@ -1507,6 +1620,7 @@ class MessageEntity extends DataClass implements Insertable { remoteUpdatedAt, localDeletedAt, remoteDeletedAt, + messageTextUpdatedAt, userId, pinned, pinnedAt, @@ -1540,6 +1654,7 @@ class MessageEntity extends DataClass implements Insertable { other.remoteUpdatedAt == this.remoteUpdatedAt && other.localDeletedAt == this.localDeletedAt && other.remoteDeletedAt == this.remoteDeletedAt && + other.messageTextUpdatedAt == this.messageTextUpdatedAt && other.userId == this.userId && other.pinned == this.pinned && other.pinnedAt == this.pinnedAt && @@ -1571,6 +1686,7 @@ class MessagesCompanion extends UpdateCompanion { final Value remoteUpdatedAt; final Value localDeletedAt; final Value remoteDeletedAt; + final Value messageTextUpdatedAt; final Value userId; final Value pinned; final Value pinnedAt; @@ -1601,6 +1717,7 @@ class MessagesCompanion extends UpdateCompanion { this.remoteUpdatedAt = const Value.absent(), this.localDeletedAt = const Value.absent(), this.remoteDeletedAt = const Value.absent(), + this.messageTextUpdatedAt = const Value.absent(), this.userId = const Value.absent(), this.pinned = const Value.absent(), this.pinnedAt = const Value.absent(), @@ -1632,6 +1749,7 @@ class MessagesCompanion extends UpdateCompanion { this.remoteUpdatedAt = const Value.absent(), this.localDeletedAt = const Value.absent(), this.remoteDeletedAt = const Value.absent(), + this.messageTextUpdatedAt = const Value.absent(), this.userId = const Value.absent(), this.pinned = const Value.absent(), this.pinnedAt = const Value.absent(), @@ -1667,6 +1785,7 @@ class MessagesCompanion extends UpdateCompanion { Expression? remoteUpdatedAt, Expression? localDeletedAt, Expression? remoteDeletedAt, + Expression? messageTextUpdatedAt, Expression? userId, Expression? pinned, Expression? pinnedAt, @@ -1698,6 +1817,8 @@ class MessagesCompanion extends UpdateCompanion { if (remoteUpdatedAt != null) 'remote_updated_at': remoteUpdatedAt, if (localDeletedAt != null) 'local_deleted_at': localDeletedAt, if (remoteDeletedAt != null) 'remote_deleted_at': remoteDeletedAt, + if (messageTextUpdatedAt != null) + 'message_text_updated_at': messageTextUpdatedAt, if (userId != null) 'user_id': userId, if (pinned != null) 'pinned': pinned, if (pinnedAt != null) 'pinned_at': pinnedAt, @@ -1731,6 +1852,7 @@ class MessagesCompanion extends UpdateCompanion { Value? remoteUpdatedAt, Value? localDeletedAt, Value? remoteDeletedAt, + Value? messageTextUpdatedAt, Value? userId, Value? pinned, Value? pinnedAt, @@ -1761,6 +1883,7 @@ class MessagesCompanion extends UpdateCompanion { remoteUpdatedAt: remoteUpdatedAt ?? this.remoteUpdatedAt, localDeletedAt: localDeletedAt ?? this.localDeletedAt, remoteDeletedAt: remoteDeletedAt ?? this.remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt ?? this.messageTextUpdatedAt, userId: userId ?? this.userId, pinned: pinned ?? this.pinned, pinnedAt: pinnedAt ?? this.pinnedAt, @@ -1783,9 +1906,8 @@ class MessagesCompanion extends UpdateCompanion { map['message_text'] = Variable(messageText.value); } if (attachments.present) { - final converter = $MessagesTable.$converterattachments; - - map['attachments'] = Variable(converter.toSql(attachments.value)); + map['attachments'] = Variable( + $MessagesTable.$converterattachments.toSql(attachments.value)); } if (state.present) { map['state'] = Variable(state.value); @@ -1794,22 +1916,16 @@ class MessagesCompanion extends UpdateCompanion { map['type'] = Variable(type.value); } if (mentionedUsers.present) { - final converter = $MessagesTable.$convertermentionedUsers; - - map['mentioned_users'] = - Variable(converter.toSql(mentionedUsers.value)); + map['mentioned_users'] = Variable( + $MessagesTable.$convertermentionedUsers.toSql(mentionedUsers.value)); } if (reactionCounts.present) { - final converter = $MessagesTable.$converterreactionCountsn; - - map['reaction_counts'] = - Variable(converter.toSql(reactionCounts.value)); + map['reaction_counts'] = Variable( + $MessagesTable.$converterreactionCountsn.toSql(reactionCounts.value)); } if (reactionScores.present) { - final converter = $MessagesTable.$converterreactionScoresn; - - map['reaction_scores'] = - Variable(converter.toSql(reactionScores.value)); + map['reaction_scores'] = Variable( + $MessagesTable.$converterreactionScoresn.toSql(reactionScores.value)); } if (parentId.present) { map['parent_id'] = Variable(parentId.value); @@ -1847,6 +1963,10 @@ class MessagesCompanion extends UpdateCompanion { if (remoteDeletedAt.present) { map['remote_deleted_at'] = Variable(remoteDeletedAt.value); } + if (messageTextUpdatedAt.present) { + map['message_text_updated_at'] = + Variable(messageTextUpdatedAt.value); + } if (userId.present) { map['user_id'] = Variable(userId.value); } @@ -1866,14 +1986,12 @@ class MessagesCompanion extends UpdateCompanion { map['channel_cid'] = Variable(channelCid.value); } if (i18n.present) { - final converter = $MessagesTable.$converteri18n; - - map['i18n'] = Variable(converter.toSql(i18n.value)); + map['i18n'] = + Variable($MessagesTable.$converteri18n.toSql(i18n.value)); } if (extraData.present) { - final converter = $MessagesTable.$converterextraDatan; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable( + $MessagesTable.$converterextraDatan.toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -1904,6 +2022,7 @@ class MessagesCompanion extends UpdateCompanion { ..write('remoteUpdatedAt: $remoteUpdatedAt, ') ..write('localDeletedAt: $localDeletedAt, ') ..write('remoteDeletedAt: $remoteDeletedAt, ') + ..write('messageTextUpdatedAt: $messageTextUpdatedAt, ') ..write('userId: $userId, ') ..write('pinned: $pinned, ') ..write('pinnedAt: $pinnedAt, ') @@ -2061,6 +2180,12 @@ class $PinnedMessagesTable extends PinnedMessages late final GeneratedColumn remoteDeletedAt = GeneratedColumn('remote_deleted_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); + static const VerificationMeta _messageTextUpdatedAtMeta = + const VerificationMeta('messageTextUpdatedAt'); + @override + late final GeneratedColumn messageTextUpdatedAt = + GeneratedColumn('message_text_updated_at', aliasedName, true, + type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( @@ -2136,6 +2261,7 @@ class $PinnedMessagesTable extends PinnedMessages remoteUpdatedAt, localDeletedAt, remoteDeletedAt, + messageTextUpdatedAt, userId, pinned, pinnedAt, @@ -2247,6 +2373,12 @@ class $PinnedMessagesTable extends PinnedMessages remoteDeletedAt.isAcceptableOrUnknown( data['remote_deleted_at']!, _remoteDeletedAtMeta)); } + if (data.containsKey('message_text_updated_at')) { + context.handle( + _messageTextUpdatedAtMeta, + messageTextUpdatedAt.isAcceptableOrUnknown( + data['message_text_updated_at']!, _messageTextUpdatedAtMeta)); + } if (data.containsKey('user_id')) { context.handle(_userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta)); @@ -2334,6 +2466,9 @@ class $PinnedMessagesTable extends PinnedMessages DriftSqlType.dateTime, data['${effectivePrefix}local_deleted_at']), remoteDeletedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}remote_deleted_at']), + messageTextUpdatedAt: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}message_text_updated_at']), userId: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}user_id']), pinned: attachedDatabase.typeMapping @@ -2361,21 +2496,21 @@ class $PinnedMessagesTable extends PinnedMessages } static TypeConverter, String> $converterattachments = - ListConverter(); + ListConverter(); static TypeConverter, String> $convertermentionedUsers = - ListConverter(); + ListConverter(); static TypeConverter, String> $converterreactionCounts = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterreactionCountsn = NullAwareTypeConverter.wrap($converterreactionCounts); static TypeConverter, String> $converterreactionScores = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterreactionScoresn = NullAwareTypeConverter.wrap($converterreactionScores); static TypeConverter?, String?> $converteri18n = - NullableMapConverter(); + NullableMapConverter(); static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterextraDatan = NullAwareTypeConverter.wrap($converterextraData); } @@ -2443,6 +2578,9 @@ class PinnedMessageEntity extends DataClass /// The DateTime on which the message was deleted on the server. final DateTime? remoteDeletedAt; + /// The DateTime at which the message text was edited + final DateTime? messageTextUpdatedAt; + /// Id of the User who sent the message final String? userId; @@ -2487,6 +2625,7 @@ class PinnedMessageEntity extends DataClass this.remoteUpdatedAt, this.localDeletedAt, this.remoteDeletedAt, + this.messageTextUpdatedAt, this.userId, required this.pinned, this.pinnedAt, @@ -2503,25 +2642,22 @@ class PinnedMessageEntity extends DataClass map['message_text'] = Variable(messageText); } { - final converter = $PinnedMessagesTable.$converterattachments; - map['attachments'] = Variable(converter.toSql(attachments)); + map['attachments'] = Variable( + $PinnedMessagesTable.$converterattachments.toSql(attachments)); } map['state'] = Variable(state); map['type'] = Variable(type); { - final converter = $PinnedMessagesTable.$convertermentionedUsers; - map['mentioned_users'] = - Variable(converter.toSql(mentionedUsers)); + map['mentioned_users'] = Variable( + $PinnedMessagesTable.$convertermentionedUsers.toSql(mentionedUsers)); } if (!nullToAbsent || reactionCounts != null) { - final converter = $PinnedMessagesTable.$converterreactionCountsn; - map['reaction_counts'] = - Variable(converter.toSql(reactionCounts)); + map['reaction_counts'] = Variable( + $PinnedMessagesTable.$converterreactionCountsn.toSql(reactionCounts)); } if (!nullToAbsent || reactionScores != null) { - final converter = $PinnedMessagesTable.$converterreactionScoresn; - map['reaction_scores'] = - Variable(converter.toSql(reactionScores)); + map['reaction_scores'] = Variable( + $PinnedMessagesTable.$converterreactionScoresn.toSql(reactionScores)); } if (!nullToAbsent || parentId != null) { map['parent_id'] = Variable(parentId); @@ -2557,6 +2693,9 @@ class PinnedMessageEntity extends DataClass if (!nullToAbsent || remoteDeletedAt != null) { map['remote_deleted_at'] = Variable(remoteDeletedAt); } + if (!nullToAbsent || messageTextUpdatedAt != null) { + map['message_text_updated_at'] = Variable(messageTextUpdatedAt); + } if (!nullToAbsent || userId != null) { map['user_id'] = Variable(userId); } @@ -2572,12 +2711,12 @@ class PinnedMessageEntity extends DataClass } map['channel_cid'] = Variable(channelCid); if (!nullToAbsent || i18n != null) { - final converter = $PinnedMessagesTable.$converteri18n; - map['i18n'] = Variable(converter.toSql(i18n)); + map['i18n'] = + Variable($PinnedMessagesTable.$converteri18n.toSql(i18n)); } if (!nullToAbsent || extraData != null) { - final converter = $PinnedMessagesTable.$converterextraDatan; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = Variable( + $PinnedMessagesTable.$converterextraDatan.toSql(extraData)); } return map; } @@ -2608,6 +2747,8 @@ class PinnedMessageEntity extends DataClass remoteUpdatedAt: serializer.fromJson(json['remoteUpdatedAt']), localDeletedAt: serializer.fromJson(json['localDeletedAt']), remoteDeletedAt: serializer.fromJson(json['remoteDeletedAt']), + messageTextUpdatedAt: + serializer.fromJson(json['messageTextUpdatedAt']), userId: serializer.fromJson(json['userId']), pinned: serializer.fromJson(json['pinned']), pinnedAt: serializer.fromJson(json['pinnedAt']), @@ -2642,6 +2783,8 @@ class PinnedMessageEntity extends DataClass 'remoteUpdatedAt': serializer.toJson(remoteUpdatedAt), 'localDeletedAt': serializer.toJson(localDeletedAt), 'remoteDeletedAt': serializer.toJson(remoteDeletedAt), + 'messageTextUpdatedAt': + serializer.toJson(messageTextUpdatedAt), 'userId': serializer.toJson(userId), 'pinned': serializer.toJson(pinned), 'pinnedAt': serializer.toJson(pinnedAt), @@ -2674,6 +2817,7 @@ class PinnedMessageEntity extends DataClass Value remoteUpdatedAt = const Value.absent(), Value localDeletedAt = const Value.absent(), Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), Value userId = const Value.absent(), bool? pinned, Value pinnedAt = const Value.absent(), @@ -2717,6 +2861,9 @@ class PinnedMessageEntity extends DataClass remoteDeletedAt: remoteDeletedAt.present ? remoteDeletedAt.value : this.remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt.present + ? messageTextUpdatedAt.value + : this.messageTextUpdatedAt, userId: userId.present ? userId.value : this.userId, pinned: pinned ?? this.pinned, pinnedAt: pinnedAt.present ? pinnedAt.value : this.pinnedAt, @@ -2727,6 +2874,71 @@ class PinnedMessageEntity extends DataClass i18n: i18n.present ? i18n.value : this.i18n, extraData: extraData.present ? extraData.value : this.extraData, ); + PinnedMessageEntity copyWithCompanion(PinnedMessagesCompanion data) { + return PinnedMessageEntity( + id: data.id.present ? data.id.value : this.id, + messageText: + data.messageText.present ? data.messageText.value : this.messageText, + attachments: + data.attachments.present ? data.attachments.value : this.attachments, + state: data.state.present ? data.state.value : this.state, + type: data.type.present ? data.type.value : this.type, + mentionedUsers: data.mentionedUsers.present + ? data.mentionedUsers.value + : this.mentionedUsers, + reactionCounts: data.reactionCounts.present + ? data.reactionCounts.value + : this.reactionCounts, + reactionScores: data.reactionScores.present + ? data.reactionScores.value + : this.reactionScores, + parentId: data.parentId.present ? data.parentId.value : this.parentId, + quotedMessageId: data.quotedMessageId.present + ? data.quotedMessageId.value + : this.quotedMessageId, + replyCount: + data.replyCount.present ? data.replyCount.value : this.replyCount, + showInChannel: data.showInChannel.present + ? data.showInChannel.value + : this.showInChannel, + shadowed: data.shadowed.present ? data.shadowed.value : this.shadowed, + command: data.command.present ? data.command.value : this.command, + localCreatedAt: data.localCreatedAt.present + ? data.localCreatedAt.value + : this.localCreatedAt, + remoteCreatedAt: data.remoteCreatedAt.present + ? data.remoteCreatedAt.value + : this.remoteCreatedAt, + localUpdatedAt: data.localUpdatedAt.present + ? data.localUpdatedAt.value + : this.localUpdatedAt, + remoteUpdatedAt: data.remoteUpdatedAt.present + ? data.remoteUpdatedAt.value + : this.remoteUpdatedAt, + localDeletedAt: data.localDeletedAt.present + ? data.localDeletedAt.value + : this.localDeletedAt, + remoteDeletedAt: data.remoteDeletedAt.present + ? data.remoteDeletedAt.value + : this.remoteDeletedAt, + messageTextUpdatedAt: data.messageTextUpdatedAt.present + ? data.messageTextUpdatedAt.value + : this.messageTextUpdatedAt, + userId: data.userId.present ? data.userId.value : this.userId, + pinned: data.pinned.present ? data.pinned.value : this.pinned, + pinnedAt: data.pinnedAt.present ? data.pinnedAt.value : this.pinnedAt, + pinExpires: + data.pinExpires.present ? data.pinExpires.value : this.pinExpires, + pinnedByUserId: data.pinnedByUserId.present + ? data.pinnedByUserId.value + : this.pinnedByUserId, + channelCid: + data.channelCid.present ? data.channelCid.value : this.channelCid, + i18n: data.i18n.present ? data.i18n.value : this.i18n, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('PinnedMessageEntity(') @@ -2750,6 +2962,7 @@ class PinnedMessageEntity extends DataClass ..write('remoteUpdatedAt: $remoteUpdatedAt, ') ..write('localDeletedAt: $localDeletedAt, ') ..write('remoteDeletedAt: $remoteDeletedAt, ') + ..write('messageTextUpdatedAt: $messageTextUpdatedAt, ') ..write('userId: $userId, ') ..write('pinned: $pinned, ') ..write('pinnedAt: $pinnedAt, ') @@ -2784,6 +2997,7 @@ class PinnedMessageEntity extends DataClass remoteUpdatedAt, localDeletedAt, remoteDeletedAt, + messageTextUpdatedAt, userId, pinned, pinnedAt, @@ -2817,6 +3031,7 @@ class PinnedMessageEntity extends DataClass other.remoteUpdatedAt == this.remoteUpdatedAt && other.localDeletedAt == this.localDeletedAt && other.remoteDeletedAt == this.remoteDeletedAt && + other.messageTextUpdatedAt == this.messageTextUpdatedAt && other.userId == this.userId && other.pinned == this.pinned && other.pinnedAt == this.pinnedAt && @@ -2848,6 +3063,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { final Value remoteUpdatedAt; final Value localDeletedAt; final Value remoteDeletedAt; + final Value messageTextUpdatedAt; final Value userId; final Value pinned; final Value pinnedAt; @@ -2878,6 +3094,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { this.remoteUpdatedAt = const Value.absent(), this.localDeletedAt = const Value.absent(), this.remoteDeletedAt = const Value.absent(), + this.messageTextUpdatedAt = const Value.absent(), this.userId = const Value.absent(), this.pinned = const Value.absent(), this.pinnedAt = const Value.absent(), @@ -2909,6 +3126,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { this.remoteUpdatedAt = const Value.absent(), this.localDeletedAt = const Value.absent(), this.remoteDeletedAt = const Value.absent(), + this.messageTextUpdatedAt = const Value.absent(), this.userId = const Value.absent(), this.pinned = const Value.absent(), this.pinnedAt = const Value.absent(), @@ -2944,6 +3162,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { Expression? remoteUpdatedAt, Expression? localDeletedAt, Expression? remoteDeletedAt, + Expression? messageTextUpdatedAt, Expression? userId, Expression? pinned, Expression? pinnedAt, @@ -2975,6 +3194,8 @@ class PinnedMessagesCompanion extends UpdateCompanion { if (remoteUpdatedAt != null) 'remote_updated_at': remoteUpdatedAt, if (localDeletedAt != null) 'local_deleted_at': localDeletedAt, if (remoteDeletedAt != null) 'remote_deleted_at': remoteDeletedAt, + if (messageTextUpdatedAt != null) + 'message_text_updated_at': messageTextUpdatedAt, if (userId != null) 'user_id': userId, if (pinned != null) 'pinned': pinned, if (pinnedAt != null) 'pinned_at': pinnedAt, @@ -3008,6 +3229,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { Value? remoteUpdatedAt, Value? localDeletedAt, Value? remoteDeletedAt, + Value? messageTextUpdatedAt, Value? userId, Value? pinned, Value? pinnedAt, @@ -3038,6 +3260,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { remoteUpdatedAt: remoteUpdatedAt ?? this.remoteUpdatedAt, localDeletedAt: localDeletedAt ?? this.localDeletedAt, remoteDeletedAt: remoteDeletedAt ?? this.remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt ?? this.messageTextUpdatedAt, userId: userId ?? this.userId, pinned: pinned ?? this.pinned, pinnedAt: pinnedAt ?? this.pinnedAt, @@ -3060,9 +3283,8 @@ class PinnedMessagesCompanion extends UpdateCompanion { map['message_text'] = Variable(messageText.value); } if (attachments.present) { - final converter = $PinnedMessagesTable.$converterattachments; - - map['attachments'] = Variable(converter.toSql(attachments.value)); + map['attachments'] = Variable( + $PinnedMessagesTable.$converterattachments.toSql(attachments.value)); } if (state.present) { map['state'] = Variable(state.value); @@ -3071,22 +3293,19 @@ class PinnedMessagesCompanion extends UpdateCompanion { map['type'] = Variable(type.value); } if (mentionedUsers.present) { - final converter = $PinnedMessagesTable.$convertermentionedUsers; - - map['mentioned_users'] = - Variable(converter.toSql(mentionedUsers.value)); + map['mentioned_users'] = Variable($PinnedMessagesTable + .$convertermentionedUsers + .toSql(mentionedUsers.value)); } if (reactionCounts.present) { - final converter = $PinnedMessagesTable.$converterreactionCountsn; - - map['reaction_counts'] = - Variable(converter.toSql(reactionCounts.value)); + map['reaction_counts'] = Variable($PinnedMessagesTable + .$converterreactionCountsn + .toSql(reactionCounts.value)); } if (reactionScores.present) { - final converter = $PinnedMessagesTable.$converterreactionScoresn; - - map['reaction_scores'] = - Variable(converter.toSql(reactionScores.value)); + map['reaction_scores'] = Variable($PinnedMessagesTable + .$converterreactionScoresn + .toSql(reactionScores.value)); } if (parentId.present) { map['parent_id'] = Variable(parentId.value); @@ -3124,6 +3343,10 @@ class PinnedMessagesCompanion extends UpdateCompanion { if (remoteDeletedAt.present) { map['remote_deleted_at'] = Variable(remoteDeletedAt.value); } + if (messageTextUpdatedAt.present) { + map['message_text_updated_at'] = + Variable(messageTextUpdatedAt.value); + } if (userId.present) { map['user_id'] = Variable(userId.value); } @@ -3143,14 +3366,12 @@ class PinnedMessagesCompanion extends UpdateCompanion { map['channel_cid'] = Variable(channelCid.value); } if (i18n.present) { - final converter = $PinnedMessagesTable.$converteri18n; - - map['i18n'] = Variable(converter.toSql(i18n.value)); + map['i18n'] = Variable( + $PinnedMessagesTable.$converteri18n.toSql(i18n.value)); } if (extraData.present) { - final converter = $PinnedMessagesTable.$converterextraDatan; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable( + $PinnedMessagesTable.$converterextraDatan.toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -3181,6 +3402,7 @@ class PinnedMessagesCompanion extends UpdateCompanion { ..write('remoteUpdatedAt: $remoteUpdatedAt, ') ..write('localDeletedAt: $localDeletedAt, ') ..write('remoteDeletedAt: $remoteDeletedAt, ') + ..write('messageTextUpdatedAt: $messageTextUpdatedAt, ') ..write('userId: $userId, ') ..write('pinned: $pinned, ') ..write('pinnedAt: $pinnedAt, ') @@ -3316,7 +3538,7 @@ class $PinnedMessageReactionsTable extends PinnedMessageReactions } static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterextraDatan = NullAwareTypeConverter.wrap($converterextraData); } @@ -3356,8 +3578,8 @@ class PinnedMessageReactionEntity extends DataClass map['created_at'] = Variable(createdAt); map['score'] = Variable(score); if (!nullToAbsent || extraData != null) { - final converter = $PinnedMessageReactionsTable.$converterextraDatan; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = Variable( + $PinnedMessageReactionsTable.$converterextraDatan.toSql(extraData)); } return map; } @@ -3402,6 +3624,18 @@ class PinnedMessageReactionEntity extends DataClass score: score ?? this.score, extraData: extraData.present ? extraData.value : this.extraData, ); + PinnedMessageReactionEntity copyWithCompanion( + PinnedMessageReactionsCompanion data) { + return PinnedMessageReactionEntity( + userId: data.userId.present ? data.userId.value : this.userId, + messageId: data.messageId.present ? data.messageId.value : this.messageId, + type: data.type.present ? data.type.value : this.type, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + score: data.score.present ? data.score.value : this.score, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('PinnedMessageReactionEntity(') @@ -3517,9 +3751,9 @@ class PinnedMessageReactionsCompanion map['score'] = Variable(score.value); } if (extraData.present) { - final converter = $PinnedMessageReactionsTable.$converterextraDatan; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable($PinnedMessageReactionsTable + .$converterextraDatan + .toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -3661,7 +3895,7 @@ class $ReactionsTable extends Reactions } static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); static TypeConverter?, String?> $converterextraDatan = NullAwareTypeConverter.wrap($converterextraData); } @@ -3700,8 +3934,8 @@ class ReactionEntity extends DataClass implements Insertable { map['created_at'] = Variable(createdAt); map['score'] = Variable(score); if (!nullToAbsent || extraData != null) { - final converter = $ReactionsTable.$converterextraDatan; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = Variable( + $ReactionsTable.$converterextraDatan.toSql(extraData)); } return map; } @@ -3746,6 +3980,17 @@ class ReactionEntity extends DataClass implements Insertable { score: score ?? this.score, extraData: extraData.present ? extraData.value : this.extraData, ); + ReactionEntity copyWithCompanion(ReactionsCompanion data) { + return ReactionEntity( + userId: data.userId.present ? data.userId.value : this.userId, + messageId: data.messageId.present ? data.messageId.value : this.messageId, + type: data.type.present ? data.type.value : this.type, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + score: data.score.present ? data.score.value : this.score, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('ReactionEntity(') @@ -3860,9 +4105,8 @@ class ReactionsCompanion extends UpdateCompanion { map['score'] = Variable(score.value); } if (extraData.present) { - final converter = $ReactionsTable.$converterextraDatan; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable( + $ReactionsTable.$converterextraDatan.toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -4044,7 +4288,7 @@ class $UsersTable extends Users with TableInfo<$UsersTable, UserEntity> { } static TypeConverter, String> $converterextraData = - MapConverter(); + MapConverter(); } class UserEntity extends DataClass implements Insertable { @@ -4106,8 +4350,8 @@ class UserEntity extends DataClass implements Insertable { map['online'] = Variable(online); map['banned'] = Variable(banned); { - final converter = $UsersTable.$converterextraData; - map['extra_data'] = Variable(converter.toSql(extraData)); + map['extra_data'] = + Variable($UsersTable.$converterextraData.toSql(extraData)); } return map; } @@ -4164,6 +4408,21 @@ class UserEntity extends DataClass implements Insertable { banned: banned ?? this.banned, extraData: extraData ?? this.extraData, ); + UserEntity copyWithCompanion(UsersCompanion data) { + return UserEntity( + id: data.id.present ? data.id.value : this.id, + role: data.role.present ? data.role.value : this.role, + language: data.language.present ? data.language.value : this.language, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, + lastActive: + data.lastActive.present ? data.lastActive.value : this.lastActive, + online: data.online.present ? data.online.value : this.online, + banned: data.banned.present ? data.banned.value : this.banned, + extraData: data.extraData.present ? data.extraData.value : this.extraData, + ); + } + @override String toString() { return (StringBuffer('UserEntity(') @@ -4313,9 +4572,8 @@ class UsersCompanion extends UpdateCompanion { map['banned'] = Variable(banned.value); } if (extraData.present) { - final converter = $UsersTable.$converterextraData; - - map['extra_data'] = Variable(converter.toSql(extraData.value)); + map['extra_data'] = Variable( + $UsersTable.$converterextraData.toSql(extraData.value)); } if (rowid.present) { map['rowid'] = Variable(rowid.value); @@ -4692,6 +4950,31 @@ class MemberEntity extends DataClass implements Insertable { createdAt: createdAt ?? this.createdAt, updatedAt: updatedAt ?? this.updatedAt, ); + MemberEntity copyWithCompanion(MembersCompanion data) { + return MemberEntity( + userId: data.userId.present ? data.userId.value : this.userId, + channelCid: + data.channelCid.present ? data.channelCid.value : this.channelCid, + channelRole: + data.channelRole.present ? data.channelRole.value : this.channelRole, + inviteAcceptedAt: data.inviteAcceptedAt.present + ? data.inviteAcceptedAt.value + : this.inviteAcceptedAt, + inviteRejectedAt: data.inviteRejectedAt.present + ? data.inviteRejectedAt.value + : this.inviteRejectedAt, + invited: data.invited.present ? data.invited.value : this.invited, + banned: data.banned.present ? data.banned.value : this.banned, + shadowBanned: data.shadowBanned.present + ? data.shadowBanned.value + : this.shadowBanned, + isModerator: + data.isModerator.present ? data.isModerator.value : this.isModerator, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, + ); + } + @override String toString() { return (StringBuffer('MemberEntity(') @@ -5088,6 +5371,21 @@ class ReadEntity extends DataClass implements Insertable { ? lastReadMessageId.value : this.lastReadMessageId, ); + ReadEntity copyWithCompanion(ReadsCompanion data) { + return ReadEntity( + lastRead: data.lastRead.present ? data.lastRead.value : this.lastRead, + userId: data.userId.present ? data.userId.value : this.userId, + channelCid: + data.channelCid.present ? data.channelCid.value : this.channelCid, + unreadMessages: data.unreadMessages.present + ? data.unreadMessages.value + : this.unreadMessages, + lastReadMessageId: data.lastReadMessageId.present + ? data.lastReadMessageId.value + : this.lastReadMessageId, + ); + } + @override String toString() { return (StringBuffer('ReadEntity(') @@ -5316,6 +5614,14 @@ class ChannelQueryEntity extends DataClass queryHash: queryHash ?? this.queryHash, channelCid: channelCid ?? this.channelCid, ); + ChannelQueryEntity copyWithCompanion(ChannelQueriesCompanion data) { + return ChannelQueryEntity( + queryHash: data.queryHash.present ? data.queryHash.value : this.queryHash, + channelCid: + data.channelCid.present ? data.channelCid.value : this.channelCid, + ); + } + @override String toString() { return (StringBuffer('ChannelQueryEntity(') @@ -5576,8 +5882,8 @@ class ConnectionEventEntity extends DataClass map['id'] = Variable(id); map['type'] = Variable(type); if (!nullToAbsent || ownUser != null) { - final converter = $ConnectionEventsTable.$converterownUsern; - map['own_user'] = Variable(converter.toSql(ownUser)); + map['own_user'] = Variable( + $ConnectionEventsTable.$converterownUsern.toSql(ownUser)); } if (!nullToAbsent || totalUnreadCount != null) { map['total_unread_count'] = Variable(totalUnreadCount); @@ -5641,6 +5947,24 @@ class ConnectionEventEntity extends DataClass lastEventAt: lastEventAt.present ? lastEventAt.value : this.lastEventAt, lastSyncAt: lastSyncAt.present ? lastSyncAt.value : this.lastSyncAt, ); + ConnectionEventEntity copyWithCompanion(ConnectionEventsCompanion data) { + return ConnectionEventEntity( + id: data.id.present ? data.id.value : this.id, + type: data.type.present ? data.type.value : this.type, + ownUser: data.ownUser.present ? data.ownUser.value : this.ownUser, + totalUnreadCount: data.totalUnreadCount.present + ? data.totalUnreadCount.value + : this.totalUnreadCount, + unreadChannels: data.unreadChannels.present + ? data.unreadChannels.value + : this.unreadChannels, + lastEventAt: + data.lastEventAt.present ? data.lastEventAt.value : this.lastEventAt, + lastSyncAt: + data.lastSyncAt.present ? data.lastSyncAt.value : this.lastSyncAt, + ); + } + @override String toString() { return (StringBuffer('ConnectionEventEntity(') @@ -5746,9 +6070,8 @@ class ConnectionEventsCompanion extends UpdateCompanion { map['type'] = Variable(type.value); } if (ownUser.present) { - final converter = $ConnectionEventsTable.$converterownUsern; - - map['own_user'] = Variable(converter.toSql(ownUser.value)); + map['own_user'] = Variable( + $ConnectionEventsTable.$converterownUsern.toSql(ownUser.value)); } if (totalUnreadCount.present) { map['total_unread_count'] = Variable(totalUnreadCount.value); @@ -5782,6 +6105,7 @@ class ConnectionEventsCompanion extends UpdateCompanion { abstract class _$DriftChatDatabase extends GeneratedDatabase { _$DriftChatDatabase(QueryExecutor e) : super(e); + $DriftChatDatabaseManager get managers => $DriftChatDatabaseManager(this); late final $ChannelsTable channels = $ChannelsTable(this); late final $MessagesTable messages = $MessagesTable(this); late final $PinnedMessagesTable pinnedMessages = $PinnedMessagesTable(this); @@ -5865,3 +6189,3762 @@ abstract class _$DriftChatDatabase extends GeneratedDatabase { ], ); } + +typedef $$ChannelsTableCreateCompanionBuilder = ChannelsCompanion Function({ + required String id, + required String type, + required String cid, + Value?> ownCapabilities, + required Map config, + Value frozen, + Value lastMessageAt, + Value createdAt, + Value updatedAt, + Value deletedAt, + Value memberCount, + Value createdById, + Value?> extraData, + Value rowid, +}); +typedef $$ChannelsTableUpdateCompanionBuilder = ChannelsCompanion Function({ + Value id, + Value type, + Value cid, + Value?> ownCapabilities, + Value> config, + Value frozen, + Value lastMessageAt, + Value createdAt, + Value updatedAt, + Value deletedAt, + Value memberCount, + Value createdById, + Value?> extraData, + Value rowid, +}); + +final class $$ChannelsTableReferences + extends BaseReferences<_$DriftChatDatabase, $ChannelsTable, ChannelEntity> { + $$ChannelsTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static MultiTypedResultKey<$MessagesTable, List> + _messagesRefsTable(_$DriftChatDatabase db) => + MultiTypedResultKey.fromTable(db.messages, + aliasName: $_aliasNameGenerator( + db.channels.cid, db.messages.channelCid)); + + $$MessagesTableProcessedTableManager get messagesRefs { + final manager = $$MessagesTableTableManager($_db, $_db.messages) + .filter((f) => f.channelCid.cid($_item.cid)); + + final cache = $_typedResult.readTableOrNull(_messagesRefsTable($_db)); + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache)); + } + + static MultiTypedResultKey<$MembersTable, List> + _membersRefsTable(_$DriftChatDatabase db) => + MultiTypedResultKey.fromTable(db.members, + aliasName: + $_aliasNameGenerator(db.channels.cid, db.members.channelCid)); + + $$MembersTableProcessedTableManager get membersRefs { + final manager = $$MembersTableTableManager($_db, $_db.members) + .filter((f) => f.channelCid.cid($_item.cid)); + + final cache = $_typedResult.readTableOrNull(_membersRefsTable($_db)); + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache)); + } + + static MultiTypedResultKey<$ReadsTable, List> _readsRefsTable( + _$DriftChatDatabase db) => + MultiTypedResultKey.fromTable(db.reads, + aliasName: + $_aliasNameGenerator(db.channels.cid, db.reads.channelCid)); + + $$ReadsTableProcessedTableManager get readsRefs { + final manager = $$ReadsTableTableManager($_db, $_db.reads) + .filter((f) => f.channelCid.cid($_item.cid)); + + final cache = $_typedResult.readTableOrNull(_readsRefsTable($_db)); + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache)); + } +} + +class $$ChannelsTableFilterComposer + extends Composer<_$DriftChatDatabase, $ChannelsTable> { + $$ChannelsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnFilters get cid => $composableBuilder( + column: $table.cid, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, List, String> + get ownCapabilities => $composableBuilder( + column: $table.ownCapabilities, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters, Map, + String> + get config => $composableBuilder( + column: $table.config, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get frozen => $composableBuilder( + column: $table.frozen, builder: (column) => ColumnFilters(column)); + + ColumnFilters get lastMessageAt => $composableBuilder( + column: $table.lastMessageAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get deletedAt => $composableBuilder( + column: $table.deletedAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get memberCount => $composableBuilder( + column: $table.memberCount, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdById => $composableBuilder( + column: $table.createdById, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map?, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + Expression messagesRefs( + Expression Function($$MessagesTableFilterComposer f) f) { + final $$MessagesTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.messages, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MessagesTableFilterComposer( + $db: $db, + $table: $db.messages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } + + Expression membersRefs( + Expression Function($$MembersTableFilterComposer f) f) { + final $$MembersTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.members, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MembersTableFilterComposer( + $db: $db, + $table: $db.members, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } + + Expression readsRefs( + Expression Function($$ReadsTableFilterComposer f) f) { + final $$ReadsTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.reads, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ReadsTableFilterComposer( + $db: $db, + $table: $db.reads, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$ChannelsTableOrderingComposer + extends Composer<_$DriftChatDatabase, $ChannelsTable> { + $$ChannelsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get cid => $composableBuilder( + column: $table.cid, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get ownCapabilities => $composableBuilder( + column: $table.ownCapabilities, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get config => $composableBuilder( + column: $table.config, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get frozen => $composableBuilder( + column: $table.frozen, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get lastMessageAt => $composableBuilder( + column: $table.lastMessageAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get deletedAt => $composableBuilder( + column: $table.deletedAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get memberCount => $composableBuilder( + column: $table.memberCount, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdById => $composableBuilder( + column: $table.createdById, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); +} + +class $$ChannelsTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $ChannelsTable> { + $$ChannelsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumn get cid => + $composableBuilder(column: $table.cid, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> get ownCapabilities => + $composableBuilder( + column: $table.ownCapabilities, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> get config => + $composableBuilder(column: $table.config, builder: (column) => column); + + GeneratedColumn get frozen => + $composableBuilder(column: $table.frozen, builder: (column) => column); + + GeneratedColumn get lastMessageAt => $composableBuilder( + column: $table.lastMessageAt, builder: (column) => column); + + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + + GeneratedColumn get updatedAt => + $composableBuilder(column: $table.updatedAt, builder: (column) => column); + + GeneratedColumn get deletedAt => + $composableBuilder(column: $table.deletedAt, builder: (column) => column); + + GeneratedColumn get memberCount => $composableBuilder( + column: $table.memberCount, builder: (column) => column); + + GeneratedColumn get createdById => $composableBuilder( + column: $table.createdById, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); + + Expression messagesRefs( + Expression Function($$MessagesTableAnnotationComposer a) f) { + final $$MessagesTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.messages, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MessagesTableAnnotationComposer( + $db: $db, + $table: $db.messages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } + + Expression membersRefs( + Expression Function($$MembersTableAnnotationComposer a) f) { + final $$MembersTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.members, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MembersTableAnnotationComposer( + $db: $db, + $table: $db.members, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } + + Expression readsRefs( + Expression Function($$ReadsTableAnnotationComposer a) f) { + final $$ReadsTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.cid, + referencedTable: $db.reads, + getReferencedColumn: (t) => t.channelCid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ReadsTableAnnotationComposer( + $db: $db, + $table: $db.reads, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$ChannelsTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $ChannelsTable, + ChannelEntity, + $$ChannelsTableFilterComposer, + $$ChannelsTableOrderingComposer, + $$ChannelsTableAnnotationComposer, + $$ChannelsTableCreateCompanionBuilder, + $$ChannelsTableUpdateCompanionBuilder, + (ChannelEntity, $$ChannelsTableReferences), + ChannelEntity, + PrefetchHooks Function( + {bool messagesRefs, bool membersRefs, bool readsRefs})> { + $$ChannelsTableTableManager(_$DriftChatDatabase db, $ChannelsTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$ChannelsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$ChannelsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$ChannelsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value type = const Value.absent(), + Value cid = const Value.absent(), + Value?> ownCapabilities = const Value.absent(), + Value> config = const Value.absent(), + Value frozen = const Value.absent(), + Value lastMessageAt = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value deletedAt = const Value.absent(), + Value memberCount = const Value.absent(), + Value createdById = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ChannelsCompanion( + id: id, + type: type, + cid: cid, + ownCapabilities: ownCapabilities, + config: config, + frozen: frozen, + lastMessageAt: lastMessageAt, + createdAt: createdAt, + updatedAt: updatedAt, + deletedAt: deletedAt, + memberCount: memberCount, + createdById: createdById, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String id, + required String type, + required String cid, + Value?> ownCapabilities = const Value.absent(), + required Map config, + Value frozen = const Value.absent(), + Value lastMessageAt = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value deletedAt = const Value.absent(), + Value memberCount = const Value.absent(), + Value createdById = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ChannelsCompanion.insert( + id: id, + type: type, + cid: cid, + ownCapabilities: ownCapabilities, + config: config, + frozen: frozen, + lastMessageAt: lastMessageAt, + createdAt: createdAt, + updatedAt: updatedAt, + deletedAt: deletedAt, + memberCount: memberCount, + createdById: createdById, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => + (e.readTable(table), $$ChannelsTableReferences(db, table, e))) + .toList(), + prefetchHooksCallback: ( + {messagesRefs = false, membersRefs = false, readsRefs = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [ + if (messagesRefs) db.messages, + if (membersRefs) db.members, + if (readsRefs) db.reads + ], + addJoins: null, + getPrefetchedDataCallback: (items) async { + return [ + if (messagesRefs) + await $_getPrefetchedData( + currentTable: table, + referencedTable: + $$ChannelsTableReferences._messagesRefsTable(db), + managerFromTypedResult: (p0) => + $$ChannelsTableReferences(db, table, p0) + .messagesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems + .where((e) => e.channelCid == item.cid), + typedResults: items), + if (membersRefs) + await $_getPrefetchedData( + currentTable: table, + referencedTable: + $$ChannelsTableReferences._membersRefsTable(db), + managerFromTypedResult: (p0) => + $$ChannelsTableReferences(db, table, p0) + .membersRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems + .where((e) => e.channelCid == item.cid), + typedResults: items), + if (readsRefs) + await $_getPrefetchedData( + currentTable: table, + referencedTable: + $$ChannelsTableReferences._readsRefsTable(db), + managerFromTypedResult: (p0) => + $$ChannelsTableReferences(db, table, p0).readsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems + .where((e) => e.channelCid == item.cid), + typedResults: items) + ]; + }, + ); + }, + )); +} + +typedef $$ChannelsTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $ChannelsTable, + ChannelEntity, + $$ChannelsTableFilterComposer, + $$ChannelsTableOrderingComposer, + $$ChannelsTableAnnotationComposer, + $$ChannelsTableCreateCompanionBuilder, + $$ChannelsTableUpdateCompanionBuilder, + (ChannelEntity, $$ChannelsTableReferences), + ChannelEntity, + PrefetchHooks Function( + {bool messagesRefs, bool membersRefs, bool readsRefs})>; +typedef $$MessagesTableCreateCompanionBuilder = MessagesCompanion Function({ + required String id, + Value messageText, + required List attachments, + required String state, + Value type, + required List mentionedUsers, + Value?> reactionCounts, + Value?> reactionScores, + Value parentId, + Value quotedMessageId, + Value replyCount, + Value showInChannel, + Value shadowed, + Value command, + Value localCreatedAt, + Value remoteCreatedAt, + Value localUpdatedAt, + Value remoteUpdatedAt, + Value localDeletedAt, + Value remoteDeletedAt, + Value messageTextUpdatedAt, + Value userId, + Value pinned, + Value pinnedAt, + Value pinExpires, + Value pinnedByUserId, + required String channelCid, + Value?> i18n, + Value?> extraData, + Value rowid, +}); +typedef $$MessagesTableUpdateCompanionBuilder = MessagesCompanion Function({ + Value id, + Value messageText, + Value> attachments, + Value state, + Value type, + Value> mentionedUsers, + Value?> reactionCounts, + Value?> reactionScores, + Value parentId, + Value quotedMessageId, + Value replyCount, + Value showInChannel, + Value shadowed, + Value command, + Value localCreatedAt, + Value remoteCreatedAt, + Value localUpdatedAt, + Value remoteUpdatedAt, + Value localDeletedAt, + Value remoteDeletedAt, + Value messageTextUpdatedAt, + Value userId, + Value pinned, + Value pinnedAt, + Value pinExpires, + Value pinnedByUserId, + Value channelCid, + Value?> i18n, + Value?> extraData, + Value rowid, +}); + +final class $$MessagesTableReferences + extends BaseReferences<_$DriftChatDatabase, $MessagesTable, MessageEntity> { + $$MessagesTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static $ChannelsTable _channelCidTable(_$DriftChatDatabase db) => + db.channels.createAlias( + $_aliasNameGenerator(db.messages.channelCid, db.channels.cid)); + + $$ChannelsTableProcessedTableManager? get channelCid { + if ($_item.channelCid == null) return null; + final manager = $$ChannelsTableTableManager($_db, $_db.channels) + .filter((f) => f.cid($_item.channelCid!)); + final item = $_typedResult.readTableOrNull(_channelCidTable($_db)); + if (item == null) return manager; + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item])); + } + + static MultiTypedResultKey<$ReactionsTable, List> + _reactionsRefsTable(_$DriftChatDatabase db) => + MultiTypedResultKey.fromTable(db.reactions, + aliasName: + $_aliasNameGenerator(db.messages.id, db.reactions.messageId)); + + $$ReactionsTableProcessedTableManager get reactionsRefs { + final manager = $$ReactionsTableTableManager($_db, $_db.reactions) + .filter((f) => f.messageId.id($_item.id)); + + final cache = $_typedResult.readTableOrNull(_reactionsRefsTable($_db)); + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache)); + } +} + +class $$MessagesTableFilterComposer + extends Composer<_$DriftChatDatabase, $MessagesTable> { + $$MessagesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters, List, String> + get attachments => $composableBuilder( + column: $table.attachments, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters, List, String> + get mentionedUsers => $composableBuilder( + column: $table.mentionedUsers, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map, String> + get reactionCounts => $composableBuilder( + column: $table.reactionCounts, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map, String> + get reactionScores => $composableBuilder( + column: $table.reactionScores, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get parentId => $composableBuilder( + column: $table.parentId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => ColumnFilters(column)); + + ColumnFilters get showInChannel => $composableBuilder( + column: $table.showInChannel, builder: (column) => ColumnFilters(column)); + + ColumnFilters get shadowed => $composableBuilder( + column: $table.shadowed, builder: (column) => ColumnFilters(column)); + + ColumnFilters get command => $composableBuilder( + column: $table.command, builder: (column) => ColumnFilters(column)); + + ColumnFilters get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinned => $composableBuilder( + column: $table.pinned, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinnedAt => $composableBuilder( + column: $table.pinnedAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, + builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map, + String> + get i18n => $composableBuilder( + column: $table.i18n, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map?, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + $$ChannelsTableFilterComposer get channelCid { + final $$ChannelsTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableFilterComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } + + Expression reactionsRefs( + Expression Function($$ReactionsTableFilterComposer f) f) { + final $$ReactionsTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.reactions, + getReferencedColumn: (t) => t.messageId, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ReactionsTableFilterComposer( + $db: $db, + $table: $db.reactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$MessagesTableOrderingComposer + extends Composer<_$DriftChatDatabase, $MessagesTable> { + $$MessagesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get attachments => $composableBuilder( + column: $table.attachments, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get mentionedUsers => $composableBuilder( + column: $table.mentionedUsers, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get reactionCounts => $composableBuilder( + column: $table.reactionCounts, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get reactionScores => $composableBuilder( + column: $table.reactionScores, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get parentId => $composableBuilder( + column: $table.parentId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get showInChannel => $composableBuilder( + column: $table.showInChannel, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get shadowed => $composableBuilder( + column: $table.shadowed, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get command => $composableBuilder( + column: $table.command, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinned => $composableBuilder( + column: $table.pinned, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinnedAt => $composableBuilder( + column: $table.pinnedAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get i18n => $composableBuilder( + column: $table.i18n, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); + + $$ChannelsTableOrderingComposer get channelCid { + final $$ChannelsTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableOrderingComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$MessagesTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $MessagesTable> { + $$MessagesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> get attachments => + $composableBuilder( + column: $table.attachments, builder: (column) => column); + + GeneratedColumn get state => + $composableBuilder(column: $table.state, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> get mentionedUsers => + $composableBuilder( + column: $table.mentionedUsers, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get reactionCounts => $composableBuilder( + column: $table.reactionCounts, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get reactionScores => $composableBuilder( + column: $table.reactionScores, builder: (column) => column); + + GeneratedColumn get parentId => + $composableBuilder(column: $table.parentId, builder: (column) => column); + + GeneratedColumn get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, builder: (column) => column); + + GeneratedColumn get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => column); + + GeneratedColumn get showInChannel => $composableBuilder( + column: $table.showInChannel, builder: (column) => column); + + GeneratedColumn get shadowed => + $composableBuilder(column: $table.shadowed, builder: (column) => column); + + GeneratedColumn get command => + $composableBuilder(column: $table.command, builder: (column) => column); + + GeneratedColumn get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, builder: (column) => column); + + GeneratedColumn get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, builder: (column) => column); + + GeneratedColumn get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, builder: (column) => column); + + GeneratedColumn get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, builder: (column) => column); + + GeneratedColumn get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, builder: (column) => column); + + GeneratedColumn get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, builder: (column) => column); + + GeneratedColumn get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, builder: (column) => column); + + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get pinned => + $composableBuilder(column: $table.pinned, builder: (column) => column); + + GeneratedColumn get pinnedAt => + $composableBuilder(column: $table.pinnedAt, builder: (column) => column); + + GeneratedColumn get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => column); + + GeneratedColumn get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> get i18n => + $composableBuilder(column: $table.i18n, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); + + $$ChannelsTableAnnotationComposer get channelCid { + final $$ChannelsTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableAnnotationComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } + + Expression reactionsRefs( + Expression Function($$ReactionsTableAnnotationComposer a) f) { + final $$ReactionsTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.reactions, + getReferencedColumn: (t) => t.messageId, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ReactionsTableAnnotationComposer( + $db: $db, + $table: $db.reactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$MessagesTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $MessagesTable, + MessageEntity, + $$MessagesTableFilterComposer, + $$MessagesTableOrderingComposer, + $$MessagesTableAnnotationComposer, + $$MessagesTableCreateCompanionBuilder, + $$MessagesTableUpdateCompanionBuilder, + (MessageEntity, $$MessagesTableReferences), + MessageEntity, + PrefetchHooks Function({bool channelCid, bool reactionsRefs})> { + $$MessagesTableTableManager(_$DriftChatDatabase db, $MessagesTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$MessagesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$MessagesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$MessagesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value messageText = const Value.absent(), + Value> attachments = const Value.absent(), + Value state = const Value.absent(), + Value type = const Value.absent(), + Value> mentionedUsers = const Value.absent(), + Value?> reactionCounts = const Value.absent(), + Value?> reactionScores = const Value.absent(), + Value parentId = const Value.absent(), + Value quotedMessageId = const Value.absent(), + Value replyCount = const Value.absent(), + Value showInChannel = const Value.absent(), + Value shadowed = const Value.absent(), + Value command = const Value.absent(), + Value localCreatedAt = const Value.absent(), + Value remoteCreatedAt = const Value.absent(), + Value localUpdatedAt = const Value.absent(), + Value remoteUpdatedAt = const Value.absent(), + Value localDeletedAt = const Value.absent(), + Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), + Value userId = const Value.absent(), + Value pinned = const Value.absent(), + Value pinnedAt = const Value.absent(), + Value pinExpires = const Value.absent(), + Value pinnedByUserId = const Value.absent(), + Value channelCid = const Value.absent(), + Value?> i18n = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + MessagesCompanion( + id: id, + messageText: messageText, + attachments: attachments, + state: state, + type: type, + mentionedUsers: mentionedUsers, + reactionCounts: reactionCounts, + reactionScores: reactionScores, + parentId: parentId, + quotedMessageId: quotedMessageId, + replyCount: replyCount, + showInChannel: showInChannel, + shadowed: shadowed, + command: command, + localCreatedAt: localCreatedAt, + remoteCreatedAt: remoteCreatedAt, + localUpdatedAt: localUpdatedAt, + remoteUpdatedAt: remoteUpdatedAt, + localDeletedAt: localDeletedAt, + remoteDeletedAt: remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, + userId: userId, + pinned: pinned, + pinnedAt: pinnedAt, + pinExpires: pinExpires, + pinnedByUserId: pinnedByUserId, + channelCid: channelCid, + i18n: i18n, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String id, + Value messageText = const Value.absent(), + required List attachments, + required String state, + Value type = const Value.absent(), + required List mentionedUsers, + Value?> reactionCounts = const Value.absent(), + Value?> reactionScores = const Value.absent(), + Value parentId = const Value.absent(), + Value quotedMessageId = const Value.absent(), + Value replyCount = const Value.absent(), + Value showInChannel = const Value.absent(), + Value shadowed = const Value.absent(), + Value command = const Value.absent(), + Value localCreatedAt = const Value.absent(), + Value remoteCreatedAt = const Value.absent(), + Value localUpdatedAt = const Value.absent(), + Value remoteUpdatedAt = const Value.absent(), + Value localDeletedAt = const Value.absent(), + Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), + Value userId = const Value.absent(), + Value pinned = const Value.absent(), + Value pinnedAt = const Value.absent(), + Value pinExpires = const Value.absent(), + Value pinnedByUserId = const Value.absent(), + required String channelCid, + Value?> i18n = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + MessagesCompanion.insert( + id: id, + messageText: messageText, + attachments: attachments, + state: state, + type: type, + mentionedUsers: mentionedUsers, + reactionCounts: reactionCounts, + reactionScores: reactionScores, + parentId: parentId, + quotedMessageId: quotedMessageId, + replyCount: replyCount, + showInChannel: showInChannel, + shadowed: shadowed, + command: command, + localCreatedAt: localCreatedAt, + remoteCreatedAt: remoteCreatedAt, + localUpdatedAt: localUpdatedAt, + remoteUpdatedAt: remoteUpdatedAt, + localDeletedAt: localDeletedAt, + remoteDeletedAt: remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, + userId: userId, + pinned: pinned, + pinnedAt: pinnedAt, + pinExpires: pinExpires, + pinnedByUserId: pinnedByUserId, + channelCid: channelCid, + i18n: i18n, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => + (e.readTable(table), $$MessagesTableReferences(db, table, e))) + .toList(), + prefetchHooksCallback: ({channelCid = false, reactionsRefs = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [if (reactionsRefs) db.reactions], + addJoins: < + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic>>(state) { + if (channelCid) { + state = state.withJoin( + currentTable: table, + currentColumn: table.channelCid, + referencedTable: + $$MessagesTableReferences._channelCidTable(db), + referencedColumn: + $$MessagesTableReferences._channelCidTable(db).cid, + ) as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return [ + if (reactionsRefs) + await $_getPrefetchedData( + currentTable: table, + referencedTable: + $$MessagesTableReferences._reactionsRefsTable(db), + managerFromTypedResult: (p0) => + $$MessagesTableReferences(db, table, p0) + .reactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems + .where((e) => e.messageId == item.id), + typedResults: items) + ]; + }, + ); + }, + )); +} + +typedef $$MessagesTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $MessagesTable, + MessageEntity, + $$MessagesTableFilterComposer, + $$MessagesTableOrderingComposer, + $$MessagesTableAnnotationComposer, + $$MessagesTableCreateCompanionBuilder, + $$MessagesTableUpdateCompanionBuilder, + (MessageEntity, $$MessagesTableReferences), + MessageEntity, + PrefetchHooks Function({bool channelCid, bool reactionsRefs})>; +typedef $$PinnedMessagesTableCreateCompanionBuilder = PinnedMessagesCompanion + Function({ + required String id, + Value messageText, + required List attachments, + required String state, + Value type, + required List mentionedUsers, + Value?> reactionCounts, + Value?> reactionScores, + Value parentId, + Value quotedMessageId, + Value replyCount, + Value showInChannel, + Value shadowed, + Value command, + Value localCreatedAt, + Value remoteCreatedAt, + Value localUpdatedAt, + Value remoteUpdatedAt, + Value localDeletedAt, + Value remoteDeletedAt, + Value messageTextUpdatedAt, + Value userId, + Value pinned, + Value pinnedAt, + Value pinExpires, + Value pinnedByUserId, + required String channelCid, + Value?> i18n, + Value?> extraData, + Value rowid, +}); +typedef $$PinnedMessagesTableUpdateCompanionBuilder = PinnedMessagesCompanion + Function({ + Value id, + Value messageText, + Value> attachments, + Value state, + Value type, + Value> mentionedUsers, + Value?> reactionCounts, + Value?> reactionScores, + Value parentId, + Value quotedMessageId, + Value replyCount, + Value showInChannel, + Value shadowed, + Value command, + Value localCreatedAt, + Value remoteCreatedAt, + Value localUpdatedAt, + Value remoteUpdatedAt, + Value localDeletedAt, + Value remoteDeletedAt, + Value messageTextUpdatedAt, + Value userId, + Value pinned, + Value pinnedAt, + Value pinExpires, + Value pinnedByUserId, + Value channelCid, + Value?> i18n, + Value?> extraData, + Value rowid, +}); + +final class $$PinnedMessagesTableReferences extends BaseReferences< + _$DriftChatDatabase, $PinnedMessagesTable, PinnedMessageEntity> { + $$PinnedMessagesTableReferences( + super.$_db, super.$_table, super.$_typedResult); + + static MultiTypedResultKey<$PinnedMessageReactionsTable, + List> _pinnedMessageReactionsRefsTable( + _$DriftChatDatabase db) => + MultiTypedResultKey.fromTable(db.pinnedMessageReactions, + aliasName: $_aliasNameGenerator( + db.pinnedMessages.id, db.pinnedMessageReactions.messageId)); + + $$PinnedMessageReactionsTableProcessedTableManager + get pinnedMessageReactionsRefs { + final manager = $$PinnedMessageReactionsTableTableManager( + $_db, $_db.pinnedMessageReactions) + .filter((f) => f.messageId.id($_item.id)); + + final cache = + $_typedResult.readTableOrNull(_pinnedMessageReactionsRefsTable($_db)); + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache)); + } +} + +class $$PinnedMessagesTableFilterComposer + extends Composer<_$DriftChatDatabase, $PinnedMessagesTable> { + $$PinnedMessagesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters, List, String> + get attachments => $composableBuilder( + column: $table.attachments, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters, List, String> + get mentionedUsers => $composableBuilder( + column: $table.mentionedUsers, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map, String> + get reactionCounts => $composableBuilder( + column: $table.reactionCounts, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map, String> + get reactionScores => $composableBuilder( + column: $table.reactionScores, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get parentId => $composableBuilder( + column: $table.parentId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => ColumnFilters(column)); + + ColumnFilters get showInChannel => $composableBuilder( + column: $table.showInChannel, builder: (column) => ColumnFilters(column)); + + ColumnFilters get shadowed => $composableBuilder( + column: $table.shadowed, builder: (column) => ColumnFilters(column)); + + ColumnFilters get command => $composableBuilder( + column: $table.command, builder: (column) => ColumnFilters(column)); + + ColumnFilters get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinned => $composableBuilder( + column: $table.pinned, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinnedAt => $composableBuilder( + column: $table.pinnedAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map, + String> + get i18n => $composableBuilder( + column: $table.i18n, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnWithTypeConverterFilters?, Map?, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + Expression pinnedMessageReactionsRefs( + Expression Function($$PinnedMessageReactionsTableFilterComposer f) + f) { + final $$PinnedMessageReactionsTableFilterComposer composer = + $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.pinnedMessageReactions, + getReferencedColumn: (t) => t.messageId, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$PinnedMessageReactionsTableFilterComposer( + $db: $db, + $table: $db.pinnedMessageReactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$PinnedMessagesTableOrderingComposer + extends Composer<_$DriftChatDatabase, $PinnedMessagesTable> { + $$PinnedMessagesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get attachments => $composableBuilder( + column: $table.attachments, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get state => $composableBuilder( + column: $table.state, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get mentionedUsers => $composableBuilder( + column: $table.mentionedUsers, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get reactionCounts => $composableBuilder( + column: $table.reactionCounts, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get reactionScores => $composableBuilder( + column: $table.reactionScores, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get parentId => $composableBuilder( + column: $table.parentId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get showInChannel => $composableBuilder( + column: $table.showInChannel, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get shadowed => $composableBuilder( + column: $table.shadowed, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get command => $composableBuilder( + column: $table.command, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinned => $composableBuilder( + column: $table.pinned, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinnedAt => $composableBuilder( + column: $table.pinnedAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get i18n => $composableBuilder( + column: $table.i18n, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); +} + +class $$PinnedMessagesTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $PinnedMessagesTable> { + $$PinnedMessagesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get messageText => $composableBuilder( + column: $table.messageText, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> get attachments => + $composableBuilder( + column: $table.attachments, builder: (column) => column); + + GeneratedColumn get state => + $composableBuilder(column: $table.state, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> get mentionedUsers => + $composableBuilder( + column: $table.mentionedUsers, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get reactionCounts => $composableBuilder( + column: $table.reactionCounts, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get reactionScores => $composableBuilder( + column: $table.reactionScores, builder: (column) => column); + + GeneratedColumn get parentId => + $composableBuilder(column: $table.parentId, builder: (column) => column); + + GeneratedColumn get quotedMessageId => $composableBuilder( + column: $table.quotedMessageId, builder: (column) => column); + + GeneratedColumn get replyCount => $composableBuilder( + column: $table.replyCount, builder: (column) => column); + + GeneratedColumn get showInChannel => $composableBuilder( + column: $table.showInChannel, builder: (column) => column); + + GeneratedColumn get shadowed => + $composableBuilder(column: $table.shadowed, builder: (column) => column); + + GeneratedColumn get command => + $composableBuilder(column: $table.command, builder: (column) => column); + + GeneratedColumn get localCreatedAt => $composableBuilder( + column: $table.localCreatedAt, builder: (column) => column); + + GeneratedColumn get remoteCreatedAt => $composableBuilder( + column: $table.remoteCreatedAt, builder: (column) => column); + + GeneratedColumn get localUpdatedAt => $composableBuilder( + column: $table.localUpdatedAt, builder: (column) => column); + + GeneratedColumn get remoteUpdatedAt => $composableBuilder( + column: $table.remoteUpdatedAt, builder: (column) => column); + + GeneratedColumn get localDeletedAt => $composableBuilder( + column: $table.localDeletedAt, builder: (column) => column); + + GeneratedColumn get remoteDeletedAt => $composableBuilder( + column: $table.remoteDeletedAt, builder: (column) => column); + + GeneratedColumn get messageTextUpdatedAt => $composableBuilder( + column: $table.messageTextUpdatedAt, builder: (column) => column); + + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get pinned => + $composableBuilder(column: $table.pinned, builder: (column) => column); + + GeneratedColumn get pinnedAt => + $composableBuilder(column: $table.pinnedAt, builder: (column) => column); + + GeneratedColumn get pinExpires => $composableBuilder( + column: $table.pinExpires, builder: (column) => column); + + GeneratedColumn get pinnedByUserId => $composableBuilder( + column: $table.pinnedByUserId, builder: (column) => column); + + GeneratedColumn get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> get i18n => + $composableBuilder(column: $table.i18n, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); + + Expression pinnedMessageReactionsRefs( + Expression Function($$PinnedMessageReactionsTableAnnotationComposer a) + f) { + final $$PinnedMessageReactionsTableAnnotationComposer composer = + $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.pinnedMessageReactions, + getReferencedColumn: (t) => t.messageId, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$PinnedMessageReactionsTableAnnotationComposer( + $db: $db, + $table: $db.pinnedMessageReactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return f(composer); + } +} + +class $$PinnedMessagesTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $PinnedMessagesTable, + PinnedMessageEntity, + $$PinnedMessagesTableFilterComposer, + $$PinnedMessagesTableOrderingComposer, + $$PinnedMessagesTableAnnotationComposer, + $$PinnedMessagesTableCreateCompanionBuilder, + $$PinnedMessagesTableUpdateCompanionBuilder, + (PinnedMessageEntity, $$PinnedMessagesTableReferences), + PinnedMessageEntity, + PrefetchHooks Function({bool pinnedMessageReactionsRefs})> { + $$PinnedMessagesTableTableManager( + _$DriftChatDatabase db, $PinnedMessagesTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$PinnedMessagesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$PinnedMessagesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$PinnedMessagesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value messageText = const Value.absent(), + Value> attachments = const Value.absent(), + Value state = const Value.absent(), + Value type = const Value.absent(), + Value> mentionedUsers = const Value.absent(), + Value?> reactionCounts = const Value.absent(), + Value?> reactionScores = const Value.absent(), + Value parentId = const Value.absent(), + Value quotedMessageId = const Value.absent(), + Value replyCount = const Value.absent(), + Value showInChannel = const Value.absent(), + Value shadowed = const Value.absent(), + Value command = const Value.absent(), + Value localCreatedAt = const Value.absent(), + Value remoteCreatedAt = const Value.absent(), + Value localUpdatedAt = const Value.absent(), + Value remoteUpdatedAt = const Value.absent(), + Value localDeletedAt = const Value.absent(), + Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), + Value userId = const Value.absent(), + Value pinned = const Value.absent(), + Value pinnedAt = const Value.absent(), + Value pinExpires = const Value.absent(), + Value pinnedByUserId = const Value.absent(), + Value channelCid = const Value.absent(), + Value?> i18n = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + PinnedMessagesCompanion( + id: id, + messageText: messageText, + attachments: attachments, + state: state, + type: type, + mentionedUsers: mentionedUsers, + reactionCounts: reactionCounts, + reactionScores: reactionScores, + parentId: parentId, + quotedMessageId: quotedMessageId, + replyCount: replyCount, + showInChannel: showInChannel, + shadowed: shadowed, + command: command, + localCreatedAt: localCreatedAt, + remoteCreatedAt: remoteCreatedAt, + localUpdatedAt: localUpdatedAt, + remoteUpdatedAt: remoteUpdatedAt, + localDeletedAt: localDeletedAt, + remoteDeletedAt: remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, + userId: userId, + pinned: pinned, + pinnedAt: pinnedAt, + pinExpires: pinExpires, + pinnedByUserId: pinnedByUserId, + channelCid: channelCid, + i18n: i18n, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String id, + Value messageText = const Value.absent(), + required List attachments, + required String state, + Value type = const Value.absent(), + required List mentionedUsers, + Value?> reactionCounts = const Value.absent(), + Value?> reactionScores = const Value.absent(), + Value parentId = const Value.absent(), + Value quotedMessageId = const Value.absent(), + Value replyCount = const Value.absent(), + Value showInChannel = const Value.absent(), + Value shadowed = const Value.absent(), + Value command = const Value.absent(), + Value localCreatedAt = const Value.absent(), + Value remoteCreatedAt = const Value.absent(), + Value localUpdatedAt = const Value.absent(), + Value remoteUpdatedAt = const Value.absent(), + Value localDeletedAt = const Value.absent(), + Value remoteDeletedAt = const Value.absent(), + Value messageTextUpdatedAt = const Value.absent(), + Value userId = const Value.absent(), + Value pinned = const Value.absent(), + Value pinnedAt = const Value.absent(), + Value pinExpires = const Value.absent(), + Value pinnedByUserId = const Value.absent(), + required String channelCid, + Value?> i18n = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + PinnedMessagesCompanion.insert( + id: id, + messageText: messageText, + attachments: attachments, + state: state, + type: type, + mentionedUsers: mentionedUsers, + reactionCounts: reactionCounts, + reactionScores: reactionScores, + parentId: parentId, + quotedMessageId: quotedMessageId, + replyCount: replyCount, + showInChannel: showInChannel, + shadowed: shadowed, + command: command, + localCreatedAt: localCreatedAt, + remoteCreatedAt: remoteCreatedAt, + localUpdatedAt: localUpdatedAt, + remoteUpdatedAt: remoteUpdatedAt, + localDeletedAt: localDeletedAt, + remoteDeletedAt: remoteDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, + userId: userId, + pinned: pinned, + pinnedAt: pinnedAt, + pinExpires: pinExpires, + pinnedByUserId: pinnedByUserId, + channelCid: channelCid, + i18n: i18n, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => ( + e.readTable(table), + $$PinnedMessagesTableReferences(db, table, e) + )) + .toList(), + prefetchHooksCallback: ({pinnedMessageReactionsRefs = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [ + if (pinnedMessageReactionsRefs) db.pinnedMessageReactions + ], + addJoins: null, + getPrefetchedDataCallback: (items) async { + return [ + if (pinnedMessageReactionsRefs) + await $_getPrefetchedData( + currentTable: table, + referencedTable: $$PinnedMessagesTableReferences + ._pinnedMessageReactionsRefsTable(db), + managerFromTypedResult: (p0) => + $$PinnedMessagesTableReferences(db, table, p0) + .pinnedMessageReactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems + .where((e) => e.messageId == item.id), + typedResults: items) + ]; + }, + ); + }, + )); +} + +typedef $$PinnedMessagesTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $PinnedMessagesTable, + PinnedMessageEntity, + $$PinnedMessagesTableFilterComposer, + $$PinnedMessagesTableOrderingComposer, + $$PinnedMessagesTableAnnotationComposer, + $$PinnedMessagesTableCreateCompanionBuilder, + $$PinnedMessagesTableUpdateCompanionBuilder, + (PinnedMessageEntity, $$PinnedMessagesTableReferences), + PinnedMessageEntity, + PrefetchHooks Function({bool pinnedMessageReactionsRefs})>; +typedef $$PinnedMessageReactionsTableCreateCompanionBuilder + = PinnedMessageReactionsCompanion Function({ + required String userId, + required String messageId, + required String type, + Value createdAt, + Value score, + Value?> extraData, + Value rowid, +}); +typedef $$PinnedMessageReactionsTableUpdateCompanionBuilder + = PinnedMessageReactionsCompanion Function({ + Value userId, + Value messageId, + Value type, + Value createdAt, + Value score, + Value?> extraData, + Value rowid, +}); + +final class $$PinnedMessageReactionsTableReferences extends BaseReferences< + _$DriftChatDatabase, + $PinnedMessageReactionsTable, + PinnedMessageReactionEntity> { + $$PinnedMessageReactionsTableReferences( + super.$_db, super.$_table, super.$_typedResult); + + static $PinnedMessagesTable _messageIdTable(_$DriftChatDatabase db) => + db.pinnedMessages.createAlias($_aliasNameGenerator( + db.pinnedMessageReactions.messageId, db.pinnedMessages.id)); + + $$PinnedMessagesTableProcessedTableManager? get messageId { + if ($_item.messageId == null) return null; + final manager = $$PinnedMessagesTableTableManager($_db, $_db.pinnedMessages) + .filter((f) => f.id($_item.messageId!)); + final item = $_typedResult.readTableOrNull(_messageIdTable($_db)); + if (item == null) return manager; + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item])); + } +} + +class $$PinnedMessageReactionsTableFilterComposer + extends Composer<_$DriftChatDatabase, $PinnedMessageReactionsTable> { + $$PinnedMessageReactionsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get score => $composableBuilder( + column: $table.score, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map?, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + $$PinnedMessagesTableFilterComposer get messageId { + final $$PinnedMessagesTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.pinnedMessages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$PinnedMessagesTableFilterComposer( + $db: $db, + $table: $db.pinnedMessages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$PinnedMessageReactionsTableOrderingComposer + extends Composer<_$DriftChatDatabase, $PinnedMessageReactionsTable> { + $$PinnedMessageReactionsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get score => $composableBuilder( + column: $table.score, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); + + $$PinnedMessagesTableOrderingComposer get messageId { + final $$PinnedMessagesTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.pinnedMessages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$PinnedMessagesTableOrderingComposer( + $db: $db, + $table: $db.pinnedMessages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$PinnedMessageReactionsTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $PinnedMessageReactionsTable> { + $$PinnedMessageReactionsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + + GeneratedColumn get score => + $composableBuilder(column: $table.score, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); + + $$PinnedMessagesTableAnnotationComposer get messageId { + final $$PinnedMessagesTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.pinnedMessages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$PinnedMessagesTableAnnotationComposer( + $db: $db, + $table: $db.pinnedMessages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$PinnedMessageReactionsTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $PinnedMessageReactionsTable, + PinnedMessageReactionEntity, + $$PinnedMessageReactionsTableFilterComposer, + $$PinnedMessageReactionsTableOrderingComposer, + $$PinnedMessageReactionsTableAnnotationComposer, + $$PinnedMessageReactionsTableCreateCompanionBuilder, + $$PinnedMessageReactionsTableUpdateCompanionBuilder, + (PinnedMessageReactionEntity, $$PinnedMessageReactionsTableReferences), + PinnedMessageReactionEntity, + PrefetchHooks Function({bool messageId})> { + $$PinnedMessageReactionsTableTableManager( + _$DriftChatDatabase db, $PinnedMessageReactionsTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$PinnedMessageReactionsTableFilterComposer( + $db: db, $table: table), + createOrderingComposer: () => + $$PinnedMessageReactionsTableOrderingComposer( + $db: db, $table: table), + createComputedFieldComposer: () => + $$PinnedMessageReactionsTableAnnotationComposer( + $db: db, $table: table), + updateCompanionCallback: ({ + Value userId = const Value.absent(), + Value messageId = const Value.absent(), + Value type = const Value.absent(), + Value createdAt = const Value.absent(), + Value score = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + PinnedMessageReactionsCompanion( + userId: userId, + messageId: messageId, + type: type, + createdAt: createdAt, + score: score, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String userId, + required String messageId, + required String type, + Value createdAt = const Value.absent(), + Value score = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + PinnedMessageReactionsCompanion.insert( + userId: userId, + messageId: messageId, + type: type, + createdAt: createdAt, + score: score, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => ( + e.readTable(table), + $$PinnedMessageReactionsTableReferences(db, table, e) + )) + .toList(), + prefetchHooksCallback: ({messageId = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: < + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic>>(state) { + if (messageId) { + state = state.withJoin( + currentTable: table, + currentColumn: table.messageId, + referencedTable: $$PinnedMessageReactionsTableReferences + ._messageIdTable(db), + referencedColumn: $$PinnedMessageReactionsTableReferences + ._messageIdTable(db) + .id, + ) as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + )); +} + +typedef $$PinnedMessageReactionsTableProcessedTableManager + = ProcessedTableManager< + _$DriftChatDatabase, + $PinnedMessageReactionsTable, + PinnedMessageReactionEntity, + $$PinnedMessageReactionsTableFilterComposer, + $$PinnedMessageReactionsTableOrderingComposer, + $$PinnedMessageReactionsTableAnnotationComposer, + $$PinnedMessageReactionsTableCreateCompanionBuilder, + $$PinnedMessageReactionsTableUpdateCompanionBuilder, + (PinnedMessageReactionEntity, $$PinnedMessageReactionsTableReferences), + PinnedMessageReactionEntity, + PrefetchHooks Function({bool messageId})>; +typedef $$ReactionsTableCreateCompanionBuilder = ReactionsCompanion Function({ + required String userId, + required String messageId, + required String type, + Value createdAt, + Value score, + Value?> extraData, + Value rowid, +}); +typedef $$ReactionsTableUpdateCompanionBuilder = ReactionsCompanion Function({ + Value userId, + Value messageId, + Value type, + Value createdAt, + Value score, + Value?> extraData, + Value rowid, +}); + +final class $$ReactionsTableReferences extends BaseReferences< + _$DriftChatDatabase, $ReactionsTable, ReactionEntity> { + $$ReactionsTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static $MessagesTable _messageIdTable(_$DriftChatDatabase db) => + db.messages.createAlias( + $_aliasNameGenerator(db.reactions.messageId, db.messages.id)); + + $$MessagesTableProcessedTableManager? get messageId { + if ($_item.messageId == null) return null; + final manager = $$MessagesTableTableManager($_db, $_db.messages) + .filter((f) => f.id($_item.messageId!)); + final item = $_typedResult.readTableOrNull(_messageIdTable($_db)); + if (item == null) return manager; + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item])); + } +} + +class $$ReactionsTableFilterComposer + extends Composer<_$DriftChatDatabase, $ReactionsTable> { + $$ReactionsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get score => $composableBuilder( + column: $table.score, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map?, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + $$MessagesTableFilterComposer get messageId { + final $$MessagesTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.messages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MessagesTableFilterComposer( + $db: $db, + $table: $db.messages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReactionsTableOrderingComposer + extends Composer<_$DriftChatDatabase, $ReactionsTable> { + $$ReactionsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get score => $composableBuilder( + column: $table.score, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); + + $$MessagesTableOrderingComposer get messageId { + final $$MessagesTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.messages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MessagesTableOrderingComposer( + $db: $db, + $table: $db.messages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReactionsTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $ReactionsTable> { + $$ReactionsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + + GeneratedColumn get score => + $composableBuilder(column: $table.score, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); + + $$MessagesTableAnnotationComposer get messageId { + final $$MessagesTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.messageId, + referencedTable: $db.messages, + getReferencedColumn: (t) => t.id, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$MessagesTableAnnotationComposer( + $db: $db, + $table: $db.messages, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReactionsTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $ReactionsTable, + ReactionEntity, + $$ReactionsTableFilterComposer, + $$ReactionsTableOrderingComposer, + $$ReactionsTableAnnotationComposer, + $$ReactionsTableCreateCompanionBuilder, + $$ReactionsTableUpdateCompanionBuilder, + (ReactionEntity, $$ReactionsTableReferences), + ReactionEntity, + PrefetchHooks Function({bool messageId})> { + $$ReactionsTableTableManager(_$DriftChatDatabase db, $ReactionsTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$ReactionsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$ReactionsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$ReactionsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value userId = const Value.absent(), + Value messageId = const Value.absent(), + Value type = const Value.absent(), + Value createdAt = const Value.absent(), + Value score = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ReactionsCompanion( + userId: userId, + messageId: messageId, + type: type, + createdAt: createdAt, + score: score, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String userId, + required String messageId, + required String type, + Value createdAt = const Value.absent(), + Value score = const Value.absent(), + Value?> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ReactionsCompanion.insert( + userId: userId, + messageId: messageId, + type: type, + createdAt: createdAt, + score: score, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => ( + e.readTable(table), + $$ReactionsTableReferences(db, table, e) + )) + .toList(), + prefetchHooksCallback: ({messageId = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: < + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic>>(state) { + if (messageId) { + state = state.withJoin( + currentTable: table, + currentColumn: table.messageId, + referencedTable: + $$ReactionsTableReferences._messageIdTable(db), + referencedColumn: + $$ReactionsTableReferences._messageIdTable(db).id, + ) as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + )); +} + +typedef $$ReactionsTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $ReactionsTable, + ReactionEntity, + $$ReactionsTableFilterComposer, + $$ReactionsTableOrderingComposer, + $$ReactionsTableAnnotationComposer, + $$ReactionsTableCreateCompanionBuilder, + $$ReactionsTableUpdateCompanionBuilder, + (ReactionEntity, $$ReactionsTableReferences), + ReactionEntity, + PrefetchHooks Function({bool messageId})>; +typedef $$UsersTableCreateCompanionBuilder = UsersCompanion Function({ + required String id, + Value role, + Value language, + Value createdAt, + Value updatedAt, + Value lastActive, + Value online, + Value banned, + required Map extraData, + Value rowid, +}); +typedef $$UsersTableUpdateCompanionBuilder = UsersCompanion Function({ + Value id, + Value role, + Value language, + Value createdAt, + Value updatedAt, + Value lastActive, + Value online, + Value banned, + Value> extraData, + Value rowid, +}); + +class $$UsersTableFilterComposer + extends Composer<_$DriftChatDatabase, $UsersTable> { + $$UsersTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get role => $composableBuilder( + column: $table.role, builder: (column) => ColumnFilters(column)); + + ColumnFilters get language => $composableBuilder( + column: $table.language, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get lastActive => $composableBuilder( + column: $table.lastActive, builder: (column) => ColumnFilters(column)); + + ColumnFilters get online => $composableBuilder( + column: $table.online, builder: (column) => ColumnFilters(column)); + + ColumnFilters get banned => $composableBuilder( + column: $table.banned, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters, Map, + String> + get extraData => $composableBuilder( + column: $table.extraData, + builder: (column) => ColumnWithTypeConverterFilters(column)); +} + +class $$UsersTableOrderingComposer + extends Composer<_$DriftChatDatabase, $UsersTable> { + $$UsersTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get role => $composableBuilder( + column: $table.role, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get language => $composableBuilder( + column: $table.language, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get lastActive => $composableBuilder( + column: $table.lastActive, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get online => $composableBuilder( + column: $table.online, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get banned => $composableBuilder( + column: $table.banned, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => ColumnOrderings(column)); +} + +class $$UsersTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $UsersTable> { + $$UsersTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get role => + $composableBuilder(column: $table.role, builder: (column) => column); + + GeneratedColumn get language => + $composableBuilder(column: $table.language, builder: (column) => column); + + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + + GeneratedColumn get updatedAt => + $composableBuilder(column: $table.updatedAt, builder: (column) => column); + + GeneratedColumn get lastActive => $composableBuilder( + column: $table.lastActive, builder: (column) => column); + + GeneratedColumn get online => + $composableBuilder(column: $table.online, builder: (column) => column); + + GeneratedColumn get banned => + $composableBuilder(column: $table.banned, builder: (column) => column); + + GeneratedColumnWithTypeConverter, String> + get extraData => $composableBuilder( + column: $table.extraData, builder: (column) => column); +} + +class $$UsersTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $UsersTable, + UserEntity, + $$UsersTableFilterComposer, + $$UsersTableOrderingComposer, + $$UsersTableAnnotationComposer, + $$UsersTableCreateCompanionBuilder, + $$UsersTableUpdateCompanionBuilder, + (UserEntity, BaseReferences<_$DriftChatDatabase, $UsersTable, UserEntity>), + UserEntity, + PrefetchHooks Function()> { + $$UsersTableTableManager(_$DriftChatDatabase db, $UsersTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$UsersTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$UsersTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$UsersTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value role = const Value.absent(), + Value language = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value lastActive = const Value.absent(), + Value online = const Value.absent(), + Value banned = const Value.absent(), + Value> extraData = const Value.absent(), + Value rowid = const Value.absent(), + }) => + UsersCompanion( + id: id, + role: role, + language: language, + createdAt: createdAt, + updatedAt: updatedAt, + lastActive: lastActive, + online: online, + banned: banned, + extraData: extraData, + rowid: rowid, + ), + createCompanionCallback: ({ + required String id, + Value role = const Value.absent(), + Value language = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value lastActive = const Value.absent(), + Value online = const Value.absent(), + Value banned = const Value.absent(), + required Map extraData, + Value rowid = const Value.absent(), + }) => + UsersCompanion.insert( + id: id, + role: role, + language: language, + createdAt: createdAt, + updatedAt: updatedAt, + lastActive: lastActive, + online: online, + banned: banned, + extraData: extraData, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$UsersTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $UsersTable, + UserEntity, + $$UsersTableFilterComposer, + $$UsersTableOrderingComposer, + $$UsersTableAnnotationComposer, + $$UsersTableCreateCompanionBuilder, + $$UsersTableUpdateCompanionBuilder, + (UserEntity, BaseReferences<_$DriftChatDatabase, $UsersTable, UserEntity>), + UserEntity, + PrefetchHooks Function()>; +typedef $$MembersTableCreateCompanionBuilder = MembersCompanion Function({ + required String userId, + required String channelCid, + Value channelRole, + Value inviteAcceptedAt, + Value inviteRejectedAt, + Value invited, + Value banned, + Value shadowBanned, + Value isModerator, + Value createdAt, + Value updatedAt, + Value rowid, +}); +typedef $$MembersTableUpdateCompanionBuilder = MembersCompanion Function({ + Value userId, + Value channelCid, + Value channelRole, + Value inviteAcceptedAt, + Value inviteRejectedAt, + Value invited, + Value banned, + Value shadowBanned, + Value isModerator, + Value createdAt, + Value updatedAt, + Value rowid, +}); + +final class $$MembersTableReferences + extends BaseReferences<_$DriftChatDatabase, $MembersTable, MemberEntity> { + $$MembersTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static $ChannelsTable _channelCidTable(_$DriftChatDatabase db) => + db.channels.createAlias( + $_aliasNameGenerator(db.members.channelCid, db.channels.cid)); + + $$ChannelsTableProcessedTableManager? get channelCid { + if ($_item.channelCid == null) return null; + final manager = $$ChannelsTableTableManager($_db, $_db.channels) + .filter((f) => f.cid($_item.channelCid!)); + final item = $_typedResult.readTableOrNull(_channelCidTable($_db)); + if (item == null) return manager; + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item])); + } +} + +class $$MembersTableFilterComposer + extends Composer<_$DriftChatDatabase, $MembersTable> { + $$MembersTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get channelRole => $composableBuilder( + column: $table.channelRole, builder: (column) => ColumnFilters(column)); + + ColumnFilters get inviteAcceptedAt => $composableBuilder( + column: $table.inviteAcceptedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get inviteRejectedAt => $composableBuilder( + column: $table.inviteRejectedAt, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get invited => $composableBuilder( + column: $table.invited, builder: (column) => ColumnFilters(column)); + + ColumnFilters get banned => $composableBuilder( + column: $table.banned, builder: (column) => ColumnFilters(column)); + + ColumnFilters get shadowBanned => $composableBuilder( + column: $table.shadowBanned, builder: (column) => ColumnFilters(column)); + + ColumnFilters get isModerator => $composableBuilder( + column: $table.isModerator, builder: (column) => ColumnFilters(column)); + + ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnFilters(column)); + + $$ChannelsTableFilterComposer get channelCid { + final $$ChannelsTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableFilterComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$MembersTableOrderingComposer + extends Composer<_$DriftChatDatabase, $MembersTable> { + $$MembersTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get channelRole => $composableBuilder( + column: $table.channelRole, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get inviteAcceptedAt => $composableBuilder( + column: $table.inviteAcceptedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get inviteRejectedAt => $composableBuilder( + column: $table.inviteRejectedAt, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get invited => $composableBuilder( + column: $table.invited, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get banned => $composableBuilder( + column: $table.banned, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get shadowBanned => $composableBuilder( + column: $table.shadowBanned, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get isModerator => $composableBuilder( + column: $table.isModerator, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get updatedAt => $composableBuilder( + column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); + + $$ChannelsTableOrderingComposer get channelCid { + final $$ChannelsTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableOrderingComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$MembersTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $MembersTable> { + $$MembersTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get channelRole => $composableBuilder( + column: $table.channelRole, builder: (column) => column); + + GeneratedColumn get inviteAcceptedAt => $composableBuilder( + column: $table.inviteAcceptedAt, builder: (column) => column); + + GeneratedColumn get inviteRejectedAt => $composableBuilder( + column: $table.inviteRejectedAt, builder: (column) => column); + + GeneratedColumn get invited => + $composableBuilder(column: $table.invited, builder: (column) => column); + + GeneratedColumn get banned => + $composableBuilder(column: $table.banned, builder: (column) => column); + + GeneratedColumn get shadowBanned => $composableBuilder( + column: $table.shadowBanned, builder: (column) => column); + + GeneratedColumn get isModerator => $composableBuilder( + column: $table.isModerator, builder: (column) => column); + + GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); + + GeneratedColumn get updatedAt => + $composableBuilder(column: $table.updatedAt, builder: (column) => column); + + $$ChannelsTableAnnotationComposer get channelCid { + final $$ChannelsTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableAnnotationComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$MembersTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $MembersTable, + MemberEntity, + $$MembersTableFilterComposer, + $$MembersTableOrderingComposer, + $$MembersTableAnnotationComposer, + $$MembersTableCreateCompanionBuilder, + $$MembersTableUpdateCompanionBuilder, + (MemberEntity, $$MembersTableReferences), + MemberEntity, + PrefetchHooks Function({bool channelCid})> { + $$MembersTableTableManager(_$DriftChatDatabase db, $MembersTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$MembersTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$MembersTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$MembersTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value userId = const Value.absent(), + Value channelCid = const Value.absent(), + Value channelRole = const Value.absent(), + Value inviteAcceptedAt = const Value.absent(), + Value inviteRejectedAt = const Value.absent(), + Value invited = const Value.absent(), + Value banned = const Value.absent(), + Value shadowBanned = const Value.absent(), + Value isModerator = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value rowid = const Value.absent(), + }) => + MembersCompanion( + userId: userId, + channelCid: channelCid, + channelRole: channelRole, + inviteAcceptedAt: inviteAcceptedAt, + inviteRejectedAt: inviteRejectedAt, + invited: invited, + banned: banned, + shadowBanned: shadowBanned, + isModerator: isModerator, + createdAt: createdAt, + updatedAt: updatedAt, + rowid: rowid, + ), + createCompanionCallback: ({ + required String userId, + required String channelCid, + Value channelRole = const Value.absent(), + Value inviteAcceptedAt = const Value.absent(), + Value inviteRejectedAt = const Value.absent(), + Value invited = const Value.absent(), + Value banned = const Value.absent(), + Value shadowBanned = const Value.absent(), + Value isModerator = const Value.absent(), + Value createdAt = const Value.absent(), + Value updatedAt = const Value.absent(), + Value rowid = const Value.absent(), + }) => + MembersCompanion.insert( + userId: userId, + channelCid: channelCid, + channelRole: channelRole, + inviteAcceptedAt: inviteAcceptedAt, + inviteRejectedAt: inviteRejectedAt, + invited: invited, + banned: banned, + shadowBanned: shadowBanned, + isModerator: isModerator, + createdAt: createdAt, + updatedAt: updatedAt, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => + (e.readTable(table), $$MembersTableReferences(db, table, e))) + .toList(), + prefetchHooksCallback: ({channelCid = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: < + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic>>(state) { + if (channelCid) { + state = state.withJoin( + currentTable: table, + currentColumn: table.channelCid, + referencedTable: + $$MembersTableReferences._channelCidTable(db), + referencedColumn: + $$MembersTableReferences._channelCidTable(db).cid, + ) as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + )); +} + +typedef $$MembersTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $MembersTable, + MemberEntity, + $$MembersTableFilterComposer, + $$MembersTableOrderingComposer, + $$MembersTableAnnotationComposer, + $$MembersTableCreateCompanionBuilder, + $$MembersTableUpdateCompanionBuilder, + (MemberEntity, $$MembersTableReferences), + MemberEntity, + PrefetchHooks Function({bool channelCid})>; +typedef $$ReadsTableCreateCompanionBuilder = ReadsCompanion Function({ + required DateTime lastRead, + required String userId, + required String channelCid, + Value unreadMessages, + Value lastReadMessageId, + Value rowid, +}); +typedef $$ReadsTableUpdateCompanionBuilder = ReadsCompanion Function({ + Value lastRead, + Value userId, + Value channelCid, + Value unreadMessages, + Value lastReadMessageId, + Value rowid, +}); + +final class $$ReadsTableReferences + extends BaseReferences<_$DriftChatDatabase, $ReadsTable, ReadEntity> { + $$ReadsTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static $ChannelsTable _channelCidTable(_$DriftChatDatabase db) => db.channels + .createAlias($_aliasNameGenerator(db.reads.channelCid, db.channels.cid)); + + $$ChannelsTableProcessedTableManager? get channelCid { + if ($_item.channelCid == null) return null; + final manager = $$ChannelsTableTableManager($_db, $_db.channels) + .filter((f) => f.cid($_item.channelCid!)); + final item = $_typedResult.readTableOrNull(_channelCidTable($_db)); + if (item == null) return manager; + return ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item])); + } +} + +class $$ReadsTableFilterComposer + extends Composer<_$DriftChatDatabase, $ReadsTable> { + $$ReadsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get lastRead => $composableBuilder( + column: $table.lastRead, builder: (column) => ColumnFilters(column)); + + ColumnFilters get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnFilters(column)); + + ColumnFilters get unreadMessages => $composableBuilder( + column: $table.unreadMessages, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get lastReadMessageId => $composableBuilder( + column: $table.lastReadMessageId, + builder: (column) => ColumnFilters(column)); + + $$ChannelsTableFilterComposer get channelCid { + final $$ChannelsTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableFilterComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReadsTableOrderingComposer + extends Composer<_$DriftChatDatabase, $ReadsTable> { + $$ReadsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get lastRead => $composableBuilder( + column: $table.lastRead, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get userId => $composableBuilder( + column: $table.userId, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get unreadMessages => $composableBuilder( + column: $table.unreadMessages, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get lastReadMessageId => $composableBuilder( + column: $table.lastReadMessageId, + builder: (column) => ColumnOrderings(column)); + + $$ChannelsTableOrderingComposer get channelCid { + final $$ChannelsTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableOrderingComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReadsTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $ReadsTable> { + $$ReadsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get lastRead => + $composableBuilder(column: $table.lastRead, builder: (column) => column); + + GeneratedColumn get userId => + $composableBuilder(column: $table.userId, builder: (column) => column); + + GeneratedColumn get unreadMessages => $composableBuilder( + column: $table.unreadMessages, builder: (column) => column); + + GeneratedColumn get lastReadMessageId => $composableBuilder( + column: $table.lastReadMessageId, builder: (column) => column); + + $$ChannelsTableAnnotationComposer get channelCid { + final $$ChannelsTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.channelCid, + referencedTable: $db.channels, + getReferencedColumn: (t) => t.cid, + builder: (joinBuilder, + {$addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer}) => + $$ChannelsTableAnnotationComposer( + $db: $db, + $table: $db.channels, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + )); + return composer; + } +} + +class $$ReadsTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $ReadsTable, + ReadEntity, + $$ReadsTableFilterComposer, + $$ReadsTableOrderingComposer, + $$ReadsTableAnnotationComposer, + $$ReadsTableCreateCompanionBuilder, + $$ReadsTableUpdateCompanionBuilder, + (ReadEntity, $$ReadsTableReferences), + ReadEntity, + PrefetchHooks Function({bool channelCid})> { + $$ReadsTableTableManager(_$DriftChatDatabase db, $ReadsTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$ReadsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$ReadsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$ReadsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value lastRead = const Value.absent(), + Value userId = const Value.absent(), + Value channelCid = const Value.absent(), + Value unreadMessages = const Value.absent(), + Value lastReadMessageId = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ReadsCompanion( + lastRead: lastRead, + userId: userId, + channelCid: channelCid, + unreadMessages: unreadMessages, + lastReadMessageId: lastReadMessageId, + rowid: rowid, + ), + createCompanionCallback: ({ + required DateTime lastRead, + required String userId, + required String channelCid, + Value unreadMessages = const Value.absent(), + Value lastReadMessageId = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ReadsCompanion.insert( + lastRead: lastRead, + userId: userId, + channelCid: channelCid, + unreadMessages: unreadMessages, + lastReadMessageId: lastReadMessageId, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => + (e.readTable(table), $$ReadsTableReferences(db, table, e))) + .toList(), + prefetchHooksCallback: ({channelCid = false}) { + return PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: < + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic>>(state) { + if (channelCid) { + state = state.withJoin( + currentTable: table, + currentColumn: table.channelCid, + referencedTable: + $$ReadsTableReferences._channelCidTable(db), + referencedColumn: + $$ReadsTableReferences._channelCidTable(db).cid, + ) as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + )); +} + +typedef $$ReadsTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $ReadsTable, + ReadEntity, + $$ReadsTableFilterComposer, + $$ReadsTableOrderingComposer, + $$ReadsTableAnnotationComposer, + $$ReadsTableCreateCompanionBuilder, + $$ReadsTableUpdateCompanionBuilder, + (ReadEntity, $$ReadsTableReferences), + ReadEntity, + PrefetchHooks Function({bool channelCid})>; +typedef $$ChannelQueriesTableCreateCompanionBuilder = ChannelQueriesCompanion + Function({ + required String queryHash, + required String channelCid, + Value rowid, +}); +typedef $$ChannelQueriesTableUpdateCompanionBuilder = ChannelQueriesCompanion + Function({ + Value queryHash, + Value channelCid, + Value rowid, +}); + +class $$ChannelQueriesTableFilterComposer + extends Composer<_$DriftChatDatabase, $ChannelQueriesTable> { + $$ChannelQueriesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get queryHash => $composableBuilder( + column: $table.queryHash, builder: (column) => ColumnFilters(column)); + + ColumnFilters get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => ColumnFilters(column)); +} + +class $$ChannelQueriesTableOrderingComposer + extends Composer<_$DriftChatDatabase, $ChannelQueriesTable> { + $$ChannelQueriesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get queryHash => $composableBuilder( + column: $table.queryHash, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => ColumnOrderings(column)); +} + +class $$ChannelQueriesTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $ChannelQueriesTable> { + $$ChannelQueriesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get queryHash => + $composableBuilder(column: $table.queryHash, builder: (column) => column); + + GeneratedColumn get channelCid => $composableBuilder( + column: $table.channelCid, builder: (column) => column); +} + +class $$ChannelQueriesTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $ChannelQueriesTable, + ChannelQueryEntity, + $$ChannelQueriesTableFilterComposer, + $$ChannelQueriesTableOrderingComposer, + $$ChannelQueriesTableAnnotationComposer, + $$ChannelQueriesTableCreateCompanionBuilder, + $$ChannelQueriesTableUpdateCompanionBuilder, + ( + ChannelQueryEntity, + BaseReferences<_$DriftChatDatabase, $ChannelQueriesTable, + ChannelQueryEntity> + ), + ChannelQueryEntity, + PrefetchHooks Function()> { + $$ChannelQueriesTableTableManager( + _$DriftChatDatabase db, $ChannelQueriesTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$ChannelQueriesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$ChannelQueriesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$ChannelQueriesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value queryHash = const Value.absent(), + Value channelCid = const Value.absent(), + Value rowid = const Value.absent(), + }) => + ChannelQueriesCompanion( + queryHash: queryHash, + channelCid: channelCid, + rowid: rowid, + ), + createCompanionCallback: ({ + required String queryHash, + required String channelCid, + Value rowid = const Value.absent(), + }) => + ChannelQueriesCompanion.insert( + queryHash: queryHash, + channelCid: channelCid, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$ChannelQueriesTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $ChannelQueriesTable, + ChannelQueryEntity, + $$ChannelQueriesTableFilterComposer, + $$ChannelQueriesTableOrderingComposer, + $$ChannelQueriesTableAnnotationComposer, + $$ChannelQueriesTableCreateCompanionBuilder, + $$ChannelQueriesTableUpdateCompanionBuilder, + ( + ChannelQueryEntity, + BaseReferences<_$DriftChatDatabase, $ChannelQueriesTable, + ChannelQueryEntity> + ), + ChannelQueryEntity, + PrefetchHooks Function()>; +typedef $$ConnectionEventsTableCreateCompanionBuilder + = ConnectionEventsCompanion Function({ + Value id, + required String type, + Value?> ownUser, + Value totalUnreadCount, + Value unreadChannels, + Value lastEventAt, + Value lastSyncAt, +}); +typedef $$ConnectionEventsTableUpdateCompanionBuilder + = ConnectionEventsCompanion Function({ + Value id, + Value type, + Value?> ownUser, + Value totalUnreadCount, + Value unreadChannels, + Value lastEventAt, + Value lastSyncAt, +}); + +class $$ConnectionEventsTableFilterComposer + extends Composer<_$DriftChatDatabase, $ConnectionEventsTable> { + $$ConnectionEventsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnFilters(column)); + + ColumnWithTypeConverterFilters?, Map, + String> + get ownUser => $composableBuilder( + column: $table.ownUser, + builder: (column) => ColumnWithTypeConverterFilters(column)); + + ColumnFilters get totalUnreadCount => $composableBuilder( + column: $table.totalUnreadCount, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get unreadChannels => $composableBuilder( + column: $table.unreadChannels, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get lastEventAt => $composableBuilder( + column: $table.lastEventAt, builder: (column) => ColumnFilters(column)); + + ColumnFilters get lastSyncAt => $composableBuilder( + column: $table.lastSyncAt, builder: (column) => ColumnFilters(column)); +} + +class $$ConnectionEventsTableOrderingComposer + extends Composer<_$DriftChatDatabase, $ConnectionEventsTable> { + $$ConnectionEventsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get type => $composableBuilder( + column: $table.type, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get ownUser => $composableBuilder( + column: $table.ownUser, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get totalUnreadCount => $composableBuilder( + column: $table.totalUnreadCount, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get unreadChannels => $composableBuilder( + column: $table.unreadChannels, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get lastEventAt => $composableBuilder( + column: $table.lastEventAt, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get lastSyncAt => $composableBuilder( + column: $table.lastSyncAt, builder: (column) => ColumnOrderings(column)); +} + +class $$ConnectionEventsTableAnnotationComposer + extends Composer<_$DriftChatDatabase, $ConnectionEventsTable> { + $$ConnectionEventsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get type => + $composableBuilder(column: $table.type, builder: (column) => column); + + GeneratedColumnWithTypeConverter?, String> get ownUser => + $composableBuilder(column: $table.ownUser, builder: (column) => column); + + GeneratedColumn get totalUnreadCount => $composableBuilder( + column: $table.totalUnreadCount, builder: (column) => column); + + GeneratedColumn get unreadChannels => $composableBuilder( + column: $table.unreadChannels, builder: (column) => column); + + GeneratedColumn get lastEventAt => $composableBuilder( + column: $table.lastEventAt, builder: (column) => column); + + GeneratedColumn get lastSyncAt => $composableBuilder( + column: $table.lastSyncAt, builder: (column) => column); +} + +class $$ConnectionEventsTableTableManager extends RootTableManager< + _$DriftChatDatabase, + $ConnectionEventsTable, + ConnectionEventEntity, + $$ConnectionEventsTableFilterComposer, + $$ConnectionEventsTableOrderingComposer, + $$ConnectionEventsTableAnnotationComposer, + $$ConnectionEventsTableCreateCompanionBuilder, + $$ConnectionEventsTableUpdateCompanionBuilder, + ( + ConnectionEventEntity, + BaseReferences<_$DriftChatDatabase, $ConnectionEventsTable, + ConnectionEventEntity> + ), + ConnectionEventEntity, + PrefetchHooks Function()> { + $$ConnectionEventsTableTableManager( + _$DriftChatDatabase db, $ConnectionEventsTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$ConnectionEventsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$ConnectionEventsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$ConnectionEventsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value type = const Value.absent(), + Value?> ownUser = const Value.absent(), + Value totalUnreadCount = const Value.absent(), + Value unreadChannels = const Value.absent(), + Value lastEventAt = const Value.absent(), + Value lastSyncAt = const Value.absent(), + }) => + ConnectionEventsCompanion( + id: id, + type: type, + ownUser: ownUser, + totalUnreadCount: totalUnreadCount, + unreadChannels: unreadChannels, + lastEventAt: lastEventAt, + lastSyncAt: lastSyncAt, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String type, + Value?> ownUser = const Value.absent(), + Value totalUnreadCount = const Value.absent(), + Value unreadChannels = const Value.absent(), + Value lastEventAt = const Value.absent(), + Value lastSyncAt = const Value.absent(), + }) => + ConnectionEventsCompanion.insert( + id: id, + type: type, + ownUser: ownUser, + totalUnreadCount: totalUnreadCount, + unreadChannels: unreadChannels, + lastEventAt: lastEventAt, + lastSyncAt: lastSyncAt, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$ConnectionEventsTableProcessedTableManager = ProcessedTableManager< + _$DriftChatDatabase, + $ConnectionEventsTable, + ConnectionEventEntity, + $$ConnectionEventsTableFilterComposer, + $$ConnectionEventsTableOrderingComposer, + $$ConnectionEventsTableAnnotationComposer, + $$ConnectionEventsTableCreateCompanionBuilder, + $$ConnectionEventsTableUpdateCompanionBuilder, + ( + ConnectionEventEntity, + BaseReferences<_$DriftChatDatabase, $ConnectionEventsTable, + ConnectionEventEntity> + ), + ConnectionEventEntity, + PrefetchHooks Function()>; + +class $DriftChatDatabaseManager { + final _$DriftChatDatabase _db; + $DriftChatDatabaseManager(this._db); + $$ChannelsTableTableManager get channels => + $$ChannelsTableTableManager(_db, _db.channels); + $$MessagesTableTableManager get messages => + $$MessagesTableTableManager(_db, _db.messages); + $$PinnedMessagesTableTableManager get pinnedMessages => + $$PinnedMessagesTableTableManager(_db, _db.pinnedMessages); + $$PinnedMessageReactionsTableTableManager get pinnedMessageReactions => + $$PinnedMessageReactionsTableTableManager( + _db, _db.pinnedMessageReactions); + $$ReactionsTableTableManager get reactions => + $$ReactionsTableTableManager(_db, _db.reactions); + $$UsersTableTableManager get users => + $$UsersTableTableManager(_db, _db.users); + $$MembersTableTableManager get members => + $$MembersTableTableManager(_db, _db.members); + $$ReadsTableTableManager get reads => + $$ReadsTableTableManager(_db, _db.reads); + $$ChannelQueriesTableTableManager get channelQueries => + $$ChannelQueriesTableTableManager(_db, _db.channelQueries); + $$ConnectionEventsTableTableManager get connectionEvents => + $$ConnectionEventsTableTableManager(_db, _db.connectionEvents); +} diff --git a/packages/stream_chat_persistence/lib/src/entity/messages.dart b/packages/stream_chat_persistence/lib/src/entity/messages.dart index e37d4de1d..834d5b3c5 100644 --- a/packages/stream_chat_persistence/lib/src/entity/messages.dart +++ b/packages/stream_chat_persistence/lib/src/entity/messages.dart @@ -97,6 +97,9 @@ class Messages extends Table { /// The DateTime on which the message was deleted on the server. DateTimeColumn get remoteDeletedAt => dateTime().nullable()(); + /// The DateTime at which the message text was edited + DateTimeColumn get messageTextUpdatedAt => dateTime().nullable()(); + /// Id of the User who sent the message TextColumn get userId => text().nullable()(); diff --git a/packages/stream_chat_persistence/lib/src/mapper/message_mapper.dart b/packages/stream_chat_persistence/lib/src/mapper/message_mapper.dart index 6e656b207..84804b880 100644 --- a/packages/stream_chat_persistence/lib/src/mapper/message_mapper.dart +++ b/packages/stream_chat_persistence/lib/src/mapper/message_mapper.dart @@ -28,6 +28,7 @@ extension MessageEntityX on MessageEntity { localUpdatedAt: localUpdatedAt, deletedAt: remoteDeletedAt, localDeletedAt: localDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, id: id, type: type, state: MessageState.fromJson(jsonDecode(state)), @@ -77,6 +78,7 @@ extension MessageX on Message { userId: user?.id, remoteDeletedAt: remoteDeletedAt, localDeletedAt: localDeletedAt, + messageTextUpdatedAt: messageTextUpdatedAt, messageText: text, pinned: pinned, pinnedAt: pinnedAt,