// GENERATED CODE - DO NOT MODIFY BY HAND part of 'twonly_database.dart'; // ignore_for_file: type=lint class $ContactsTable extends Contacts with TableInfo<$ContactsTable, Contact> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ContactsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( 'user_id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false); static const VerificationMeta _usernameMeta = const VerificationMeta('username'); @override late final GeneratedColumn username = GeneratedColumn( 'username', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE')); static const VerificationMeta _displayNameMeta = const VerificationMeta('displayName'); @override late final GeneratedColumn displayName = GeneratedColumn( 'display_name', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false); static const VerificationMeta _nickNameMeta = const VerificationMeta('nickName'); @override late final GeneratedColumn nickName = GeneratedColumn( 'nick_name', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false); static const VerificationMeta _acceptedMeta = const VerificationMeta('accepted'); @override late final GeneratedColumn accepted = GeneratedColumn( 'accepted', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("accepted" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _requestedMeta = const VerificationMeta('requested'); @override late final GeneratedColumn requested = GeneratedColumn( 'requested', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("requested" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _blockedMeta = const VerificationMeta('blocked'); @override late final GeneratedColumn blocked = GeneratedColumn( 'blocked', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("blocked" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _verifiedMeta = const VerificationMeta('verified'); @override late final GeneratedColumn verified = GeneratedColumn( 'verified', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("verified" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); static const VerificationMeta _totalMediaCounterMeta = const VerificationMeta('totalMediaCounter'); @override late final GeneratedColumn totalMediaCounter = GeneratedColumn( 'total_media_counter', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: Constant(0)); static const VerificationMeta _lastMessageSendMeta = const VerificationMeta('lastMessageSend'); @override late final GeneratedColumn lastMessageSend = GeneratedColumn('last_message_send', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _lastMessageReceivedMeta = const VerificationMeta('lastMessageReceived'); @override late final GeneratedColumn lastMessageReceived = GeneratedColumn('last_message_received', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _lastMessageMeta = const VerificationMeta('lastMessage'); @override late final GeneratedColumn lastMessage = GeneratedColumn( 'last_message', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _flameCounterMeta = const VerificationMeta('flameCounter'); @override late final GeneratedColumn flameCounter = GeneratedColumn( 'flame_counter', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: Constant(0)); @override List get $columns => [ userId, username, displayName, nickName, accepted, requested, blocked, verified, createdAt, totalMediaCounter, lastMessageSend, lastMessageReceived, lastMessage, flameCounter ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'contacts'; @override VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('user_id')) { context.handle(_userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta)); } if (data.containsKey('username')) { context.handle(_usernameMeta, username.isAcceptableOrUnknown(data['username']!, _usernameMeta)); } else if (isInserting) { context.missing(_usernameMeta); } if (data.containsKey('display_name')) { context.handle( _displayNameMeta, displayName.isAcceptableOrUnknown( data['display_name']!, _displayNameMeta)); } if (data.containsKey('nick_name')) { context.handle(_nickNameMeta, nickName.isAcceptableOrUnknown(data['nick_name']!, _nickNameMeta)); } if (data.containsKey('accepted')) { context.handle(_acceptedMeta, accepted.isAcceptableOrUnknown(data['accepted']!, _acceptedMeta)); } if (data.containsKey('requested')) { context.handle(_requestedMeta, requested.isAcceptableOrUnknown(data['requested']!, _requestedMeta)); } if (data.containsKey('blocked')) { context.handle(_blockedMeta, blocked.isAcceptableOrUnknown(data['blocked']!, _blockedMeta)); } if (data.containsKey('verified')) { context.handle(_verifiedMeta, verified.isAcceptableOrUnknown(data['verified']!, _verifiedMeta)); } if (data.containsKey('created_at')) { context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); } if (data.containsKey('total_media_counter')) { context.handle( _totalMediaCounterMeta, totalMediaCounter.isAcceptableOrUnknown( data['total_media_counter']!, _totalMediaCounterMeta)); } if (data.containsKey('last_message_send')) { context.handle( _lastMessageSendMeta, lastMessageSend.isAcceptableOrUnknown( data['last_message_send']!, _lastMessageSendMeta)); } if (data.containsKey('last_message_received')) { context.handle( _lastMessageReceivedMeta, lastMessageReceived.isAcceptableOrUnknown( data['last_message_received']!, _lastMessageReceivedMeta)); } if (data.containsKey('last_message')) { context.handle( _lastMessageMeta, lastMessage.isAcceptableOrUnknown( data['last_message']!, _lastMessageMeta)); } if (data.containsKey('flame_counter')) { context.handle( _flameCounterMeta, flameCounter.isAcceptableOrUnknown( data['flame_counter']!, _flameCounterMeta)); } return context; } @override Set get $primaryKey => {userId}; @override Contact map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Contact( userId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}user_id'])!, username: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}username'])!, displayName: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}display_name']), nickName: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}nick_name']), accepted: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}accepted'])!, requested: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}requested'])!, blocked: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}blocked'])!, verified: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}verified'])!, createdAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, totalMediaCounter: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}total_media_counter'])!, lastMessageSend: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_message_send']), lastMessageReceived: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_message_received']), lastMessage: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}last_message']), flameCounter: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}flame_counter'])!, ); } @override $ContactsTable createAlias(String alias) { return $ContactsTable(attachedDatabase, alias); } } class Contact extends DataClass implements Insertable { final int userId; final String username; final String? displayName; final String? nickName; final bool accepted; final bool requested; final bool blocked; final bool verified; final DateTime createdAt; final int totalMediaCounter; final DateTime? lastMessageSend; final DateTime? lastMessageReceived; final DateTime? lastMessage; final int flameCounter; const Contact( {required this.userId, required this.username, this.displayName, this.nickName, required this.accepted, required this.requested, required this.blocked, required this.verified, required this.createdAt, required this.totalMediaCounter, this.lastMessageSend, this.lastMessageReceived, this.lastMessage, required this.flameCounter}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['user_id'] = Variable(userId); map['username'] = Variable(username); if (!nullToAbsent || displayName != null) { map['display_name'] = Variable(displayName); } if (!nullToAbsent || nickName != null) { map['nick_name'] = Variable(nickName); } map['accepted'] = Variable(accepted); map['requested'] = Variable(requested); map['blocked'] = Variable(blocked); map['verified'] = Variable(verified); map['created_at'] = Variable(createdAt); map['total_media_counter'] = Variable(totalMediaCounter); if (!nullToAbsent || lastMessageSend != null) { map['last_message_send'] = Variable(lastMessageSend); } if (!nullToAbsent || lastMessageReceived != null) { map['last_message_received'] = Variable(lastMessageReceived); } if (!nullToAbsent || lastMessage != null) { map['last_message'] = Variable(lastMessage); } map['flame_counter'] = Variable(flameCounter); return map; } ContactsCompanion toCompanion(bool nullToAbsent) { return ContactsCompanion( userId: Value(userId), username: Value(username), displayName: displayName == null && nullToAbsent ? const Value.absent() : Value(displayName), nickName: nickName == null && nullToAbsent ? const Value.absent() : Value(nickName), accepted: Value(accepted), requested: Value(requested), blocked: Value(blocked), verified: Value(verified), createdAt: Value(createdAt), totalMediaCounter: Value(totalMediaCounter), lastMessageSend: lastMessageSend == null && nullToAbsent ? const Value.absent() : Value(lastMessageSend), lastMessageReceived: lastMessageReceived == null && nullToAbsent ? const Value.absent() : Value(lastMessageReceived), lastMessage: lastMessage == null && nullToAbsent ? const Value.absent() : Value(lastMessage), flameCounter: Value(flameCounter), ); } factory Contact.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return Contact( userId: serializer.fromJson(json['userId']), username: serializer.fromJson(json['username']), displayName: serializer.fromJson(json['displayName']), nickName: serializer.fromJson(json['nickName']), accepted: serializer.fromJson(json['accepted']), requested: serializer.fromJson(json['requested']), blocked: serializer.fromJson(json['blocked']), verified: serializer.fromJson(json['verified']), createdAt: serializer.fromJson(json['createdAt']), totalMediaCounter: serializer.fromJson(json['totalMediaCounter']), lastMessageSend: serializer.fromJson(json['lastMessageSend']), lastMessageReceived: serializer.fromJson(json['lastMessageReceived']), lastMessage: serializer.fromJson(json['lastMessage']), flameCounter: serializer.fromJson(json['flameCounter']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'userId': serializer.toJson(userId), 'username': serializer.toJson(username), 'displayName': serializer.toJson(displayName), 'nickName': serializer.toJson(nickName), 'accepted': serializer.toJson(accepted), 'requested': serializer.toJson(requested), 'blocked': serializer.toJson(blocked), 'verified': serializer.toJson(verified), 'createdAt': serializer.toJson(createdAt), 'totalMediaCounter': serializer.toJson(totalMediaCounter), 'lastMessageSend': serializer.toJson(lastMessageSend), 'lastMessageReceived': serializer.toJson(lastMessageReceived), 'lastMessage': serializer.toJson(lastMessage), 'flameCounter': serializer.toJson(flameCounter), }; } Contact copyWith( {int? userId, String? username, Value displayName = const Value.absent(), Value nickName = const Value.absent(), bool? accepted, bool? requested, bool? blocked, bool? verified, DateTime? createdAt, int? totalMediaCounter, Value lastMessageSend = const Value.absent(), Value lastMessageReceived = const Value.absent(), Value lastMessage = const Value.absent(), int? flameCounter}) => Contact( userId: userId ?? this.userId, username: username ?? this.username, displayName: displayName.present ? displayName.value : this.displayName, nickName: nickName.present ? nickName.value : this.nickName, accepted: accepted ?? this.accepted, requested: requested ?? this.requested, blocked: blocked ?? this.blocked, verified: verified ?? this.verified, createdAt: createdAt ?? this.createdAt, totalMediaCounter: totalMediaCounter ?? this.totalMediaCounter, lastMessageSend: lastMessageSend.present ? lastMessageSend.value : this.lastMessageSend, lastMessageReceived: lastMessageReceived.present ? lastMessageReceived.value : this.lastMessageReceived, lastMessage: lastMessage.present ? lastMessage.value : this.lastMessage, flameCounter: flameCounter ?? this.flameCounter, ); Contact copyWithCompanion(ContactsCompanion data) { return Contact( userId: data.userId.present ? data.userId.value : this.userId, username: data.username.present ? data.username.value : this.username, displayName: data.displayName.present ? data.displayName.value : this.displayName, nickName: data.nickName.present ? data.nickName.value : this.nickName, accepted: data.accepted.present ? data.accepted.value : this.accepted, requested: data.requested.present ? data.requested.value : this.requested, blocked: data.blocked.present ? data.blocked.value : this.blocked, verified: data.verified.present ? data.verified.value : this.verified, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, totalMediaCounter: data.totalMediaCounter.present ? data.totalMediaCounter.value : this.totalMediaCounter, lastMessageSend: data.lastMessageSend.present ? data.lastMessageSend.value : this.lastMessageSend, lastMessageReceived: data.lastMessageReceived.present ? data.lastMessageReceived.value : this.lastMessageReceived, lastMessage: data.lastMessage.present ? data.lastMessage.value : this.lastMessage, flameCounter: data.flameCounter.present ? data.flameCounter.value : this.flameCounter, ); } @override String toString() { return (StringBuffer('Contact(') ..write('userId: $userId, ') ..write('username: $username, ') ..write('displayName: $displayName, ') ..write('nickName: $nickName, ') ..write('accepted: $accepted, ') ..write('requested: $requested, ') ..write('blocked: $blocked, ') ..write('verified: $verified, ') ..write('createdAt: $createdAt, ') ..write('totalMediaCounter: $totalMediaCounter, ') ..write('lastMessageSend: $lastMessageSend, ') ..write('lastMessageReceived: $lastMessageReceived, ') ..write('lastMessage: $lastMessage, ') ..write('flameCounter: $flameCounter') ..write(')')) .toString(); } @override int get hashCode => Object.hash( userId, username, displayName, nickName, accepted, requested, blocked, verified, createdAt, totalMediaCounter, lastMessageSend, lastMessageReceived, lastMessage, flameCounter); @override bool operator ==(Object other) => identical(this, other) || (other is Contact && other.userId == this.userId && other.username == this.username && other.displayName == this.displayName && other.nickName == this.nickName && other.accepted == this.accepted && other.requested == this.requested && other.blocked == this.blocked && other.verified == this.verified && other.createdAt == this.createdAt && other.totalMediaCounter == this.totalMediaCounter && other.lastMessageSend == this.lastMessageSend && other.lastMessageReceived == this.lastMessageReceived && other.lastMessage == this.lastMessage && other.flameCounter == this.flameCounter); } class ContactsCompanion extends UpdateCompanion { final Value userId; final Value username; final Value displayName; final Value nickName; final Value accepted; final Value requested; final Value blocked; final Value verified; final Value createdAt; final Value totalMediaCounter; final Value lastMessageSend; final Value lastMessageReceived; final Value lastMessage; final Value flameCounter; const ContactsCompanion({ this.userId = const Value.absent(), this.username = const Value.absent(), this.displayName = const Value.absent(), this.nickName = const Value.absent(), this.accepted = const Value.absent(), this.requested = const Value.absent(), this.blocked = const Value.absent(), this.verified = const Value.absent(), this.createdAt = const Value.absent(), this.totalMediaCounter = const Value.absent(), this.lastMessageSend = const Value.absent(), this.lastMessageReceived = const Value.absent(), this.lastMessage = const Value.absent(), this.flameCounter = const Value.absent(), }); ContactsCompanion.insert({ this.userId = const Value.absent(), required String username, this.displayName = const Value.absent(), this.nickName = const Value.absent(), this.accepted = const Value.absent(), this.requested = const Value.absent(), this.blocked = const Value.absent(), this.verified = const Value.absent(), this.createdAt = const Value.absent(), this.totalMediaCounter = const Value.absent(), this.lastMessageSend = const Value.absent(), this.lastMessageReceived = const Value.absent(), this.lastMessage = const Value.absent(), this.flameCounter = const Value.absent(), }) : username = Value(username); static Insertable custom({ Expression? userId, Expression? username, Expression? displayName, Expression? nickName, Expression? accepted, Expression? requested, Expression? blocked, Expression? verified, Expression? createdAt, Expression? totalMediaCounter, Expression? lastMessageSend, Expression? lastMessageReceived, Expression? lastMessage, Expression? flameCounter, }) { return RawValuesInsertable({ if (userId != null) 'user_id': userId, if (username != null) 'username': username, if (displayName != null) 'display_name': displayName, if (nickName != null) 'nick_name': nickName, if (accepted != null) 'accepted': accepted, if (requested != null) 'requested': requested, if (blocked != null) 'blocked': blocked, if (verified != null) 'verified': verified, if (createdAt != null) 'created_at': createdAt, if (totalMediaCounter != null) 'total_media_counter': totalMediaCounter, if (lastMessageSend != null) 'last_message_send': lastMessageSend, if (lastMessageReceived != null) 'last_message_received': lastMessageReceived, if (lastMessage != null) 'last_message': lastMessage, if (flameCounter != null) 'flame_counter': flameCounter, }); } ContactsCompanion copyWith( {Value? userId, Value? username, Value? displayName, Value? nickName, Value? accepted, Value? requested, Value? blocked, Value? verified, Value? createdAt, Value? totalMediaCounter, Value? lastMessageSend, Value? lastMessageReceived, Value? lastMessage, Value? flameCounter}) { return ContactsCompanion( userId: userId ?? this.userId, username: username ?? this.username, displayName: displayName ?? this.displayName, nickName: nickName ?? this.nickName, accepted: accepted ?? this.accepted, requested: requested ?? this.requested, blocked: blocked ?? this.blocked, verified: verified ?? this.verified, createdAt: createdAt ?? this.createdAt, totalMediaCounter: totalMediaCounter ?? this.totalMediaCounter, lastMessageSend: lastMessageSend ?? this.lastMessageSend, lastMessageReceived: lastMessageReceived ?? this.lastMessageReceived, lastMessage: lastMessage ?? this.lastMessage, flameCounter: flameCounter ?? this.flameCounter, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (userId.present) { map['user_id'] = Variable(userId.value); } if (username.present) { map['username'] = Variable(username.value); } if (displayName.present) { map['display_name'] = Variable(displayName.value); } if (nickName.present) { map['nick_name'] = Variable(nickName.value); } if (accepted.present) { map['accepted'] = Variable(accepted.value); } if (requested.present) { map['requested'] = Variable(requested.value); } if (blocked.present) { map['blocked'] = Variable(blocked.value); } if (verified.present) { map['verified'] = Variable(verified.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (totalMediaCounter.present) { map['total_media_counter'] = Variable(totalMediaCounter.value); } if (lastMessageSend.present) { map['last_message_send'] = Variable(lastMessageSend.value); } if (lastMessageReceived.present) { map['last_message_received'] = Variable(lastMessageReceived.value); } if (lastMessage.present) { map['last_message'] = Variable(lastMessage.value); } if (flameCounter.present) { map['flame_counter'] = Variable(flameCounter.value); } return map; } @override String toString() { return (StringBuffer('ContactsCompanion(') ..write('userId: $userId, ') ..write('username: $username, ') ..write('displayName: $displayName, ') ..write('nickName: $nickName, ') ..write('accepted: $accepted, ') ..write('requested: $requested, ') ..write('blocked: $blocked, ') ..write('verified: $verified, ') ..write('createdAt: $createdAt, ') ..write('totalMediaCounter: $totalMediaCounter, ') ..write('lastMessageSend: $lastMessageSend, ') ..write('lastMessageReceived: $lastMessageReceived, ') ..write('lastMessage: $lastMessage, ') ..write('flameCounter: $flameCounter') ..write(')')) .toString(); } } class $MessagesTable extends Messages with TableInfo<$MessagesTable, Message> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $MessagesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _contactIdMeta = const VerificationMeta('contactId'); @override late final GeneratedColumn contactId = GeneratedColumn( 'contact_id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways('REFERENCES contacts (user_id)')); static const VerificationMeta _messageIdMeta = const VerificationMeta('messageId'); @override late final GeneratedColumn messageId = GeneratedColumn( 'message_id', aliasedName, false, hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); static const VerificationMeta _messageOtherIdMeta = const VerificationMeta('messageOtherId'); @override late final GeneratedColumn messageOtherId = GeneratedColumn( 'message_other_id', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false); static const VerificationMeta _responseToMessageIdMeta = const VerificationMeta('responseToMessageId'); @override late final GeneratedColumn responseToMessageId = GeneratedColumn( 'response_to_message_id', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false); static const VerificationMeta _responseToOtherMessageIdMeta = const VerificationMeta('responseToOtherMessageId'); @override late final GeneratedColumn responseToOtherMessageId = GeneratedColumn('response_to_other_message_id', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false); static const VerificationMeta _acknowledgeByUserMeta = const VerificationMeta('acknowledgeByUser'); @override late final GeneratedColumn acknowledgeByUser = GeneratedColumn( 'acknowledge_by_user', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("acknowledge_by_user" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _downloadStateMeta = const VerificationMeta('downloadState'); @override late final GeneratedColumnWithTypeConverter downloadState = GeneratedColumn('download_state', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: Constant(DownloadState.downloaded.index)) .withConverter($MessagesTable.$converterdownloadState); static const VerificationMeta _acknowledgeByServerMeta = const VerificationMeta('acknowledgeByServer'); @override late final GeneratedColumn acknowledgeByServer = GeneratedColumn( 'acknowledge_by_server', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("acknowledge_by_server" IN (0, 1))'), defaultValue: Constant(false)); static const VerificationMeta _kindMeta = const VerificationMeta('kind'); @override late final GeneratedColumnWithTypeConverter kind = GeneratedColumn('kind', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true) .withConverter($MessagesTable.$converterkind); static const VerificationMeta _contentJsonMeta = const VerificationMeta('contentJson'); @override late final GeneratedColumn contentJson = GeneratedColumn( 'content_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false); static const VerificationMeta _openedAtMeta = const VerificationMeta('openedAt'); @override late final GeneratedColumn openedAt = GeneratedColumn( 'opened_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _sendAtMeta = const VerificationMeta('sendAt'); @override late final GeneratedColumn sendAt = GeneratedColumn( 'send_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); @override late final GeneratedColumn updatedAt = GeneratedColumn( 'updated_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); @override List get $columns => [ contactId, messageId, messageOtherId, responseToMessageId, responseToOtherMessageId, acknowledgeByUser, downloadState, acknowledgeByServer, kind, contentJson, openedAt, sendAt, updatedAt ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'messages'; @override VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('contact_id')) { context.handle(_contactIdMeta, contactId.isAcceptableOrUnknown(data['contact_id']!, _contactIdMeta)); } else if (isInserting) { context.missing(_contactIdMeta); } if (data.containsKey('message_id')) { context.handle(_messageIdMeta, messageId.isAcceptableOrUnknown(data['message_id']!, _messageIdMeta)); } if (data.containsKey('message_other_id')) { context.handle( _messageOtherIdMeta, messageOtherId.isAcceptableOrUnknown( data['message_other_id']!, _messageOtherIdMeta)); } if (data.containsKey('response_to_message_id')) { context.handle( _responseToMessageIdMeta, responseToMessageId.isAcceptableOrUnknown( data['response_to_message_id']!, _responseToMessageIdMeta)); } if (data.containsKey('response_to_other_message_id')) { context.handle( _responseToOtherMessageIdMeta, responseToOtherMessageId.isAcceptableOrUnknown( data['response_to_other_message_id']!, _responseToOtherMessageIdMeta)); } if (data.containsKey('acknowledge_by_user')) { context.handle( _acknowledgeByUserMeta, acknowledgeByUser.isAcceptableOrUnknown( data['acknowledge_by_user']!, _acknowledgeByUserMeta)); } context.handle(_downloadStateMeta, const VerificationResult.success()); if (data.containsKey('acknowledge_by_server')) { context.handle( _acknowledgeByServerMeta, acknowledgeByServer.isAcceptableOrUnknown( data['acknowledge_by_server']!, _acknowledgeByServerMeta)); } context.handle(_kindMeta, const VerificationResult.success()); if (data.containsKey('content_json')) { context.handle( _contentJsonMeta, contentJson.isAcceptableOrUnknown( data['content_json']!, _contentJsonMeta)); } if (data.containsKey('opened_at')) { context.handle(_openedAtMeta, openedAt.isAcceptableOrUnknown(data['opened_at']!, _openedAtMeta)); } if (data.containsKey('send_at')) { context.handle(_sendAtMeta, sendAt.isAcceptableOrUnknown(data['send_at']!, _sendAtMeta)); } if (data.containsKey('updated_at')) { context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); } return context; } @override Set get $primaryKey => {messageId}; @override Message map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Message( contactId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}contact_id'])!, messageId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}message_id'])!, messageOtherId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}message_other_id']), responseToMessageId: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}response_to_message_id']), responseToOtherMessageId: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}response_to_other_message_id']), acknowledgeByUser: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}acknowledge_by_user'])!, downloadState: $MessagesTable.$converterdownloadState.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}download_state'])!), acknowledgeByServer: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}acknowledge_by_server'])!, kind: $MessagesTable.$converterkind.fromSql(attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}kind'])!), contentJson: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}content_json']), openedAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}opened_at']), sendAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}send_at'])!, updatedAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!, ); } @override $MessagesTable createAlias(String alias) { return $MessagesTable(attachedDatabase, alias); } static JsonTypeConverter2 $converterdownloadState = const EnumIndexConverter(DownloadState.values); static JsonTypeConverter2 $converterkind = const EnumNameConverter(MessageKind.values); } class Message extends DataClass implements Insertable { final int contactId; final int messageId; final int? messageOtherId; final int? responseToMessageId; final int? responseToOtherMessageId; final bool acknowledgeByUser; final DownloadState downloadState; final bool acknowledgeByServer; final MessageKind kind; final String? contentJson; final DateTime? openedAt; final DateTime sendAt; final DateTime updatedAt; const Message( {required this.contactId, required this.messageId, this.messageOtherId, this.responseToMessageId, this.responseToOtherMessageId, required this.acknowledgeByUser, required this.downloadState, required this.acknowledgeByServer, required this.kind, this.contentJson, this.openedAt, required this.sendAt, required this.updatedAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['contact_id'] = Variable(contactId); map['message_id'] = Variable(messageId); if (!nullToAbsent || messageOtherId != null) { map['message_other_id'] = Variable(messageOtherId); } if (!nullToAbsent || responseToMessageId != null) { map['response_to_message_id'] = Variable(responseToMessageId); } if (!nullToAbsent || responseToOtherMessageId != null) { map['response_to_other_message_id'] = Variable(responseToOtherMessageId); } map['acknowledge_by_user'] = Variable(acknowledgeByUser); { map['download_state'] = Variable( $MessagesTable.$converterdownloadState.toSql(downloadState)); } map['acknowledge_by_server'] = Variable(acknowledgeByServer); { map['kind'] = Variable($MessagesTable.$converterkind.toSql(kind)); } if (!nullToAbsent || contentJson != null) { map['content_json'] = Variable(contentJson); } if (!nullToAbsent || openedAt != null) { map['opened_at'] = Variable(openedAt); } map['send_at'] = Variable(sendAt); map['updated_at'] = Variable(updatedAt); return map; } MessagesCompanion toCompanion(bool nullToAbsent) { return MessagesCompanion( contactId: Value(contactId), messageId: Value(messageId), messageOtherId: messageOtherId == null && nullToAbsent ? const Value.absent() : Value(messageOtherId), responseToMessageId: responseToMessageId == null && nullToAbsent ? const Value.absent() : Value(responseToMessageId), responseToOtherMessageId: responseToOtherMessageId == null && nullToAbsent ? const Value.absent() : Value(responseToOtherMessageId), acknowledgeByUser: Value(acknowledgeByUser), downloadState: Value(downloadState), acknowledgeByServer: Value(acknowledgeByServer), kind: Value(kind), contentJson: contentJson == null && nullToAbsent ? const Value.absent() : Value(contentJson), openedAt: openedAt == null && nullToAbsent ? const Value.absent() : Value(openedAt), sendAt: Value(sendAt), updatedAt: Value(updatedAt), ); } factory Message.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return Message( contactId: serializer.fromJson(json['contactId']), messageId: serializer.fromJson(json['messageId']), messageOtherId: serializer.fromJson(json['messageOtherId']), responseToMessageId: serializer.fromJson(json['responseToMessageId']), responseToOtherMessageId: serializer.fromJson(json['responseToOtherMessageId']), acknowledgeByUser: serializer.fromJson(json['acknowledgeByUser']), downloadState: $MessagesTable.$converterdownloadState .fromJson(serializer.fromJson(json['downloadState'])), acknowledgeByServer: serializer.fromJson(json['acknowledgeByServer']), kind: $MessagesTable.$converterkind .fromJson(serializer.fromJson(json['kind'])), contentJson: serializer.fromJson(json['contentJson']), openedAt: serializer.fromJson(json['openedAt']), sendAt: serializer.fromJson(json['sendAt']), updatedAt: serializer.fromJson(json['updatedAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'contactId': serializer.toJson(contactId), 'messageId': serializer.toJson(messageId), 'messageOtherId': serializer.toJson(messageOtherId), 'responseToMessageId': serializer.toJson(responseToMessageId), 'responseToOtherMessageId': serializer.toJson(responseToOtherMessageId), 'acknowledgeByUser': serializer.toJson(acknowledgeByUser), 'downloadState': serializer.toJson( $MessagesTable.$converterdownloadState.toJson(downloadState)), 'acknowledgeByServer': serializer.toJson(acknowledgeByServer), 'kind': serializer.toJson($MessagesTable.$converterkind.toJson(kind)), 'contentJson': serializer.toJson(contentJson), 'openedAt': serializer.toJson(openedAt), 'sendAt': serializer.toJson(sendAt), 'updatedAt': serializer.toJson(updatedAt), }; } Message copyWith( {int? contactId, int? messageId, Value messageOtherId = const Value.absent(), Value responseToMessageId = const Value.absent(), Value responseToOtherMessageId = const Value.absent(), bool? acknowledgeByUser, DownloadState? downloadState, bool? acknowledgeByServer, MessageKind? kind, Value contentJson = const Value.absent(), Value openedAt = const Value.absent(), DateTime? sendAt, DateTime? updatedAt}) => Message( contactId: contactId ?? this.contactId, messageId: messageId ?? this.messageId, messageOtherId: messageOtherId.present ? messageOtherId.value : this.messageOtherId, responseToMessageId: responseToMessageId.present ? responseToMessageId.value : this.responseToMessageId, responseToOtherMessageId: responseToOtherMessageId.present ? responseToOtherMessageId.value : this.responseToOtherMessageId, acknowledgeByUser: acknowledgeByUser ?? this.acknowledgeByUser, downloadState: downloadState ?? this.downloadState, acknowledgeByServer: acknowledgeByServer ?? this.acknowledgeByServer, kind: kind ?? this.kind, contentJson: contentJson.present ? contentJson.value : this.contentJson, openedAt: openedAt.present ? openedAt.value : this.openedAt, sendAt: sendAt ?? this.sendAt, updatedAt: updatedAt ?? this.updatedAt, ); Message copyWithCompanion(MessagesCompanion data) { return Message( contactId: data.contactId.present ? data.contactId.value : this.contactId, messageId: data.messageId.present ? data.messageId.value : this.messageId, messageOtherId: data.messageOtherId.present ? data.messageOtherId.value : this.messageOtherId, responseToMessageId: data.responseToMessageId.present ? data.responseToMessageId.value : this.responseToMessageId, responseToOtherMessageId: data.responseToOtherMessageId.present ? data.responseToOtherMessageId.value : this.responseToOtherMessageId, acknowledgeByUser: data.acknowledgeByUser.present ? data.acknowledgeByUser.value : this.acknowledgeByUser, downloadState: data.downloadState.present ? data.downloadState.value : this.downloadState, acknowledgeByServer: data.acknowledgeByServer.present ? data.acknowledgeByServer.value : this.acknowledgeByServer, kind: data.kind.present ? data.kind.value : this.kind, contentJson: data.contentJson.present ? data.contentJson.value : this.contentJson, openedAt: data.openedAt.present ? data.openedAt.value : this.openedAt, sendAt: data.sendAt.present ? data.sendAt.value : this.sendAt, updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, ); } @override String toString() { return (StringBuffer('Message(') ..write('contactId: $contactId, ') ..write('messageId: $messageId, ') ..write('messageOtherId: $messageOtherId, ') ..write('responseToMessageId: $responseToMessageId, ') ..write('responseToOtherMessageId: $responseToOtherMessageId, ') ..write('acknowledgeByUser: $acknowledgeByUser, ') ..write('downloadState: $downloadState, ') ..write('acknowledgeByServer: $acknowledgeByServer, ') ..write('kind: $kind, ') ..write('contentJson: $contentJson, ') ..write('openedAt: $openedAt, ') ..write('sendAt: $sendAt, ') ..write('updatedAt: $updatedAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( contactId, messageId, messageOtherId, responseToMessageId, responseToOtherMessageId, acknowledgeByUser, downloadState, acknowledgeByServer, kind, contentJson, openedAt, sendAt, updatedAt); @override bool operator ==(Object other) => identical(this, other) || (other is Message && other.contactId == this.contactId && other.messageId == this.messageId && other.messageOtherId == this.messageOtherId && other.responseToMessageId == this.responseToMessageId && other.responseToOtherMessageId == this.responseToOtherMessageId && other.acknowledgeByUser == this.acknowledgeByUser && other.downloadState == this.downloadState && other.acknowledgeByServer == this.acknowledgeByServer && other.kind == this.kind && other.contentJson == this.contentJson && other.openedAt == this.openedAt && other.sendAt == this.sendAt && other.updatedAt == this.updatedAt); } class MessagesCompanion extends UpdateCompanion { final Value contactId; final Value messageId; final Value messageOtherId; final Value responseToMessageId; final Value responseToOtherMessageId; final Value acknowledgeByUser; final Value downloadState; final Value acknowledgeByServer; final Value kind; final Value contentJson; final Value openedAt; final Value sendAt; final Value updatedAt; const MessagesCompanion({ this.contactId = const Value.absent(), this.messageId = const Value.absent(), this.messageOtherId = const Value.absent(), this.responseToMessageId = const Value.absent(), this.responseToOtherMessageId = const Value.absent(), this.acknowledgeByUser = const Value.absent(), this.downloadState = const Value.absent(), this.acknowledgeByServer = const Value.absent(), this.kind = const Value.absent(), this.contentJson = const Value.absent(), this.openedAt = const Value.absent(), this.sendAt = const Value.absent(), this.updatedAt = const Value.absent(), }); MessagesCompanion.insert({ required int contactId, this.messageId = const Value.absent(), this.messageOtherId = const Value.absent(), this.responseToMessageId = const Value.absent(), this.responseToOtherMessageId = const Value.absent(), this.acknowledgeByUser = const Value.absent(), this.downloadState = const Value.absent(), this.acknowledgeByServer = const Value.absent(), required MessageKind kind, this.contentJson = const Value.absent(), this.openedAt = const Value.absent(), this.sendAt = const Value.absent(), this.updatedAt = const Value.absent(), }) : contactId = Value(contactId), kind = Value(kind); static Insertable custom({ Expression? contactId, Expression? messageId, Expression? messageOtherId, Expression? responseToMessageId, Expression? responseToOtherMessageId, Expression? acknowledgeByUser, Expression? downloadState, Expression? acknowledgeByServer, Expression? kind, Expression? contentJson, Expression? openedAt, Expression? sendAt, Expression? updatedAt, }) { return RawValuesInsertable({ if (contactId != null) 'contact_id': contactId, if (messageId != null) 'message_id': messageId, if (messageOtherId != null) 'message_other_id': messageOtherId, if (responseToMessageId != null) 'response_to_message_id': responseToMessageId, if (responseToOtherMessageId != null) 'response_to_other_message_id': responseToOtherMessageId, if (acknowledgeByUser != null) 'acknowledge_by_user': acknowledgeByUser, if (downloadState != null) 'download_state': downloadState, if (acknowledgeByServer != null) 'acknowledge_by_server': acknowledgeByServer, if (kind != null) 'kind': kind, if (contentJson != null) 'content_json': contentJson, if (openedAt != null) 'opened_at': openedAt, if (sendAt != null) 'send_at': sendAt, if (updatedAt != null) 'updated_at': updatedAt, }); } MessagesCompanion copyWith( {Value? contactId, Value? messageId, Value? messageOtherId, Value? responseToMessageId, Value? responseToOtherMessageId, Value? acknowledgeByUser, Value? downloadState, Value? acknowledgeByServer, Value? kind, Value? contentJson, Value? openedAt, Value? sendAt, Value? updatedAt}) { return MessagesCompanion( contactId: contactId ?? this.contactId, messageId: messageId ?? this.messageId, messageOtherId: messageOtherId ?? this.messageOtherId, responseToMessageId: responseToMessageId ?? this.responseToMessageId, responseToOtherMessageId: responseToOtherMessageId ?? this.responseToOtherMessageId, acknowledgeByUser: acknowledgeByUser ?? this.acknowledgeByUser, downloadState: downloadState ?? this.downloadState, acknowledgeByServer: acknowledgeByServer ?? this.acknowledgeByServer, kind: kind ?? this.kind, contentJson: contentJson ?? this.contentJson, openedAt: openedAt ?? this.openedAt, sendAt: sendAt ?? this.sendAt, updatedAt: updatedAt ?? this.updatedAt, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (contactId.present) { map['contact_id'] = Variable(contactId.value); } if (messageId.present) { map['message_id'] = Variable(messageId.value); } if (messageOtherId.present) { map['message_other_id'] = Variable(messageOtherId.value); } if (responseToMessageId.present) { map['response_to_message_id'] = Variable(responseToMessageId.value); } if (responseToOtherMessageId.present) { map['response_to_other_message_id'] = Variable(responseToOtherMessageId.value); } if (acknowledgeByUser.present) { map['acknowledge_by_user'] = Variable(acknowledgeByUser.value); } if (downloadState.present) { map['download_state'] = Variable( $MessagesTable.$converterdownloadState.toSql(downloadState.value)); } if (acknowledgeByServer.present) { map['acknowledge_by_server'] = Variable(acknowledgeByServer.value); } if (kind.present) { map['kind'] = Variable($MessagesTable.$converterkind.toSql(kind.value)); } if (contentJson.present) { map['content_json'] = Variable(contentJson.value); } if (openedAt.present) { map['opened_at'] = Variable(openedAt.value); } if (sendAt.present) { map['send_at'] = Variable(sendAt.value); } if (updatedAt.present) { map['updated_at'] = Variable(updatedAt.value); } return map; } @override String toString() { return (StringBuffer('MessagesCompanion(') ..write('contactId: $contactId, ') ..write('messageId: $messageId, ') ..write('messageOtherId: $messageOtherId, ') ..write('responseToMessageId: $responseToMessageId, ') ..write('responseToOtherMessageId: $responseToOtherMessageId, ') ..write('acknowledgeByUser: $acknowledgeByUser, ') ..write('downloadState: $downloadState, ') ..write('acknowledgeByServer: $acknowledgeByServer, ') ..write('kind: $kind, ') ..write('contentJson: $contentJson, ') ..write('openedAt: $openedAt, ') ..write('sendAt: $sendAt, ') ..write('updatedAt: $updatedAt') ..write(')')) .toString(); } } class $SignalIdentityKeyStoresTable extends SignalIdentityKeyStores with TableInfo<$SignalIdentityKeyStoresTable, SignalIdentityKeyStore> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $SignalIdentityKeyStoresTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _deviceIdMeta = const VerificationMeta('deviceId'); @override late final GeneratedColumn deviceId = GeneratedColumn( 'device_id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _identityKeyMeta = const VerificationMeta('identityKey'); @override late final GeneratedColumn identityKey = GeneratedColumn('identity_key', aliasedName, false, type: DriftSqlType.blob, requiredDuringInsert: true); static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); @override List get $columns => [deviceId, name, identityKey, createdAt]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'signal_identity_key_stores'; @override VerificationContext validateIntegrity( Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('device_id')) { context.handle(_deviceIdMeta, deviceId.isAcceptableOrUnknown(data['device_id']!, _deviceIdMeta)); } else if (isInserting) { context.missing(_deviceIdMeta); } if (data.containsKey('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('identity_key')) { context.handle( _identityKeyMeta, identityKey.isAcceptableOrUnknown( data['identity_key']!, _identityKeyMeta)); } else if (isInserting) { context.missing(_identityKeyMeta); } if (data.containsKey('created_at')) { context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); } return context; } @override Set get $primaryKey => {deviceId, name}; @override SignalIdentityKeyStore map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SignalIdentityKeyStore( deviceId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}device_id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, identityKey: attachedDatabase.typeMapping .read(DriftSqlType.blob, data['${effectivePrefix}identity_key'])!, createdAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, ); } @override $SignalIdentityKeyStoresTable createAlias(String alias) { return $SignalIdentityKeyStoresTable(attachedDatabase, alias); } } class SignalIdentityKeyStore extends DataClass implements Insertable { final int deviceId; final String name; final Uint8List identityKey; final DateTime createdAt; const SignalIdentityKeyStore( {required this.deviceId, required this.name, required this.identityKey, required this.createdAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['device_id'] = Variable(deviceId); map['name'] = Variable(name); map['identity_key'] = Variable(identityKey); map['created_at'] = Variable(createdAt); return map; } SignalIdentityKeyStoresCompanion toCompanion(bool nullToAbsent) { return SignalIdentityKeyStoresCompanion( deviceId: Value(deviceId), name: Value(name), identityKey: Value(identityKey), createdAt: Value(createdAt), ); } factory SignalIdentityKeyStore.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return SignalIdentityKeyStore( deviceId: serializer.fromJson(json['deviceId']), name: serializer.fromJson(json['name']), identityKey: serializer.fromJson(json['identityKey']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'deviceId': serializer.toJson(deviceId), 'name': serializer.toJson(name), 'identityKey': serializer.toJson(identityKey), 'createdAt': serializer.toJson(createdAt), }; } SignalIdentityKeyStore copyWith( {int? deviceId, String? name, Uint8List? identityKey, DateTime? createdAt}) => SignalIdentityKeyStore( deviceId: deviceId ?? this.deviceId, name: name ?? this.name, identityKey: identityKey ?? this.identityKey, createdAt: createdAt ?? this.createdAt, ); SignalIdentityKeyStore copyWithCompanion( SignalIdentityKeyStoresCompanion data) { return SignalIdentityKeyStore( deviceId: data.deviceId.present ? data.deviceId.value : this.deviceId, name: data.name.present ? data.name.value : this.name, identityKey: data.identityKey.present ? data.identityKey.value : this.identityKey, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('SignalIdentityKeyStore(') ..write('deviceId: $deviceId, ') ..write('name: $name, ') ..write('identityKey: $identityKey, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( deviceId, name, $driftBlobEquality.hash(identityKey), createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is SignalIdentityKeyStore && other.deviceId == this.deviceId && other.name == this.name && $driftBlobEquality.equals(other.identityKey, this.identityKey) && other.createdAt == this.createdAt); } class SignalIdentityKeyStoresCompanion extends UpdateCompanion { final Value deviceId; final Value name; final Value identityKey; final Value createdAt; final Value rowid; const SignalIdentityKeyStoresCompanion({ this.deviceId = const Value.absent(), this.name = const Value.absent(), this.identityKey = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); SignalIdentityKeyStoresCompanion.insert({ required int deviceId, required String name, required Uint8List identityKey, this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }) : deviceId = Value(deviceId), name = Value(name), identityKey = Value(identityKey); static Insertable custom({ Expression? deviceId, Expression? name, Expression? identityKey, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (deviceId != null) 'device_id': deviceId, if (name != null) 'name': name, if (identityKey != null) 'identity_key': identityKey, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } SignalIdentityKeyStoresCompanion copyWith( {Value? deviceId, Value? name, Value? identityKey, Value? createdAt, Value? rowid}) { return SignalIdentityKeyStoresCompanion( deviceId: deviceId ?? this.deviceId, name: name ?? this.name, identityKey: identityKey ?? this.identityKey, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (deviceId.present) { map['device_id'] = Variable(deviceId.value); } if (name.present) { map['name'] = Variable(name.value); } if (identityKey.present) { map['identity_key'] = Variable(identityKey.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('SignalIdentityKeyStoresCompanion(') ..write('deviceId: $deviceId, ') ..write('name: $name, ') ..write('identityKey: $identityKey, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $SignalPreKeyStoresTable extends SignalPreKeyStores with TableInfo<$SignalPreKeyStoresTable, SignalPreKeyStore> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $SignalPreKeyStoresTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _preKeyIdMeta = const VerificationMeta('preKeyId'); @override late final GeneratedColumn preKeyId = GeneratedColumn( 'pre_key_id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false); static const VerificationMeta _preKeyMeta = const VerificationMeta('preKey'); @override late final GeneratedColumn preKey = GeneratedColumn( 'pre_key', aliasedName, false, type: DriftSqlType.blob, requiredDuringInsert: true); static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); @override List get $columns => [preKeyId, preKey, createdAt]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'signal_pre_key_stores'; @override VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('pre_key_id')) { context.handle(_preKeyIdMeta, preKeyId.isAcceptableOrUnknown(data['pre_key_id']!, _preKeyIdMeta)); } if (data.containsKey('pre_key')) { context.handle(_preKeyMeta, preKey.isAcceptableOrUnknown(data['pre_key']!, _preKeyMeta)); } else if (isInserting) { context.missing(_preKeyMeta); } if (data.containsKey('created_at')) { context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); } return context; } @override Set get $primaryKey => {preKeyId}; @override SignalPreKeyStore map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SignalPreKeyStore( preKeyId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}pre_key_id'])!, preKey: attachedDatabase.typeMapping .read(DriftSqlType.blob, data['${effectivePrefix}pre_key'])!, createdAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, ); } @override $SignalPreKeyStoresTable createAlias(String alias) { return $SignalPreKeyStoresTable(attachedDatabase, alias); } } class SignalPreKeyStore extends DataClass implements Insertable { final int preKeyId; final Uint8List preKey; final DateTime createdAt; const SignalPreKeyStore( {required this.preKeyId, required this.preKey, required this.createdAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['pre_key_id'] = Variable(preKeyId); map['pre_key'] = Variable(preKey); map['created_at'] = Variable(createdAt); return map; } SignalPreKeyStoresCompanion toCompanion(bool nullToAbsent) { return SignalPreKeyStoresCompanion( preKeyId: Value(preKeyId), preKey: Value(preKey), createdAt: Value(createdAt), ); } factory SignalPreKeyStore.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return SignalPreKeyStore( preKeyId: serializer.fromJson(json['preKeyId']), preKey: serializer.fromJson(json['preKey']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'preKeyId': serializer.toJson(preKeyId), 'preKey': serializer.toJson(preKey), 'createdAt': serializer.toJson(createdAt), }; } SignalPreKeyStore copyWith( {int? preKeyId, Uint8List? preKey, DateTime? createdAt}) => SignalPreKeyStore( preKeyId: preKeyId ?? this.preKeyId, preKey: preKey ?? this.preKey, createdAt: createdAt ?? this.createdAt, ); SignalPreKeyStore copyWithCompanion(SignalPreKeyStoresCompanion data) { return SignalPreKeyStore( preKeyId: data.preKeyId.present ? data.preKeyId.value : this.preKeyId, preKey: data.preKey.present ? data.preKey.value : this.preKey, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('SignalPreKeyStore(') ..write('preKeyId: $preKeyId, ') ..write('preKey: $preKey, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash(preKeyId, $driftBlobEquality.hash(preKey), createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is SignalPreKeyStore && other.preKeyId == this.preKeyId && $driftBlobEquality.equals(other.preKey, this.preKey) && other.createdAt == this.createdAt); } class SignalPreKeyStoresCompanion extends UpdateCompanion { final Value preKeyId; final Value preKey; final Value createdAt; const SignalPreKeyStoresCompanion({ this.preKeyId = const Value.absent(), this.preKey = const Value.absent(), this.createdAt = const Value.absent(), }); SignalPreKeyStoresCompanion.insert({ this.preKeyId = const Value.absent(), required Uint8List preKey, this.createdAt = const Value.absent(), }) : preKey = Value(preKey); static Insertable custom({ Expression? preKeyId, Expression? preKey, Expression? createdAt, }) { return RawValuesInsertable({ if (preKeyId != null) 'pre_key_id': preKeyId, if (preKey != null) 'pre_key': preKey, if (createdAt != null) 'created_at': createdAt, }); } SignalPreKeyStoresCompanion copyWith( {Value? preKeyId, Value? preKey, Value? createdAt}) { return SignalPreKeyStoresCompanion( preKeyId: preKeyId ?? this.preKeyId, preKey: preKey ?? this.preKey, createdAt: createdAt ?? this.createdAt, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (preKeyId.present) { map['pre_key_id'] = Variable(preKeyId.value); } if (preKey.present) { map['pre_key'] = Variable(preKey.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } return map; } @override String toString() { return (StringBuffer('SignalPreKeyStoresCompanion(') ..write('preKeyId: $preKeyId, ') ..write('preKey: $preKey, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } } class $SignalSenderKeyStoresTable extends SignalSenderKeyStores with TableInfo<$SignalSenderKeyStoresTable, SignalSenderKeyStore> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $SignalSenderKeyStoresTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _senderKeyNameMeta = const VerificationMeta('senderKeyName'); @override late final GeneratedColumn senderKeyName = GeneratedColumn( 'sender_key_name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _senderKeyMeta = const VerificationMeta('senderKey'); @override late final GeneratedColumn senderKey = GeneratedColumn( 'sender_key', aliasedName, false, type: DriftSqlType.blob, requiredDuringInsert: true); @override List get $columns => [senderKeyName, senderKey]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'signal_sender_key_stores'; @override VerificationContext validateIntegrity( Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('sender_key_name')) { context.handle( _senderKeyNameMeta, senderKeyName.isAcceptableOrUnknown( data['sender_key_name']!, _senderKeyNameMeta)); } else if (isInserting) { context.missing(_senderKeyNameMeta); } if (data.containsKey('sender_key')) { context.handle(_senderKeyMeta, senderKey.isAcceptableOrUnknown(data['sender_key']!, _senderKeyMeta)); } else if (isInserting) { context.missing(_senderKeyMeta); } return context; } @override Set get $primaryKey => {senderKeyName}; @override SignalSenderKeyStore map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SignalSenderKeyStore( senderKeyName: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}sender_key_name'])!, senderKey: attachedDatabase.typeMapping .read(DriftSqlType.blob, data['${effectivePrefix}sender_key'])!, ); } @override $SignalSenderKeyStoresTable createAlias(String alias) { return $SignalSenderKeyStoresTable(attachedDatabase, alias); } } class SignalSenderKeyStore extends DataClass implements Insertable { final String senderKeyName; final Uint8List senderKey; const SignalSenderKeyStore( {required this.senderKeyName, required this.senderKey}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['sender_key_name'] = Variable(senderKeyName); map['sender_key'] = Variable(senderKey); return map; } SignalSenderKeyStoresCompanion toCompanion(bool nullToAbsent) { return SignalSenderKeyStoresCompanion( senderKeyName: Value(senderKeyName), senderKey: Value(senderKey), ); } factory SignalSenderKeyStore.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return SignalSenderKeyStore( senderKeyName: serializer.fromJson(json['senderKeyName']), senderKey: serializer.fromJson(json['senderKey']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'senderKeyName': serializer.toJson(senderKeyName), 'senderKey': serializer.toJson(senderKey), }; } SignalSenderKeyStore copyWith( {String? senderKeyName, Uint8List? senderKey}) => SignalSenderKeyStore( senderKeyName: senderKeyName ?? this.senderKeyName, senderKey: senderKey ?? this.senderKey, ); SignalSenderKeyStore copyWithCompanion(SignalSenderKeyStoresCompanion data) { return SignalSenderKeyStore( senderKeyName: data.senderKeyName.present ? data.senderKeyName.value : this.senderKeyName, senderKey: data.senderKey.present ? data.senderKey.value : this.senderKey, ); } @override String toString() { return (StringBuffer('SignalSenderKeyStore(') ..write('senderKeyName: $senderKeyName, ') ..write('senderKey: $senderKey') ..write(')')) .toString(); } @override int get hashCode => Object.hash(senderKeyName, $driftBlobEquality.hash(senderKey)); @override bool operator ==(Object other) => identical(this, other) || (other is SignalSenderKeyStore && other.senderKeyName == this.senderKeyName && $driftBlobEquality.equals(other.senderKey, this.senderKey)); } class SignalSenderKeyStoresCompanion extends UpdateCompanion { final Value senderKeyName; final Value senderKey; final Value rowid; const SignalSenderKeyStoresCompanion({ this.senderKeyName = const Value.absent(), this.senderKey = const Value.absent(), this.rowid = const Value.absent(), }); SignalSenderKeyStoresCompanion.insert({ required String senderKeyName, required Uint8List senderKey, this.rowid = const Value.absent(), }) : senderKeyName = Value(senderKeyName), senderKey = Value(senderKey); static Insertable custom({ Expression? senderKeyName, Expression? senderKey, Expression? rowid, }) { return RawValuesInsertable({ if (senderKeyName != null) 'sender_key_name': senderKeyName, if (senderKey != null) 'sender_key': senderKey, if (rowid != null) 'rowid': rowid, }); } SignalSenderKeyStoresCompanion copyWith( {Value? senderKeyName, Value? senderKey, Value? rowid}) { return SignalSenderKeyStoresCompanion( senderKeyName: senderKeyName ?? this.senderKeyName, senderKey: senderKey ?? this.senderKey, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (senderKeyName.present) { map['sender_key_name'] = Variable(senderKeyName.value); } if (senderKey.present) { map['sender_key'] = Variable(senderKey.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('SignalSenderKeyStoresCompanion(') ..write('senderKeyName: $senderKeyName, ') ..write('senderKey: $senderKey, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $SignalSessionStoresTable extends SignalSessionStores with TableInfo<$SignalSessionStoresTable, SignalSessionStore> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $SignalSessionStoresTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _deviceIdMeta = const VerificationMeta('deviceId'); @override late final GeneratedColumn deviceId = GeneratedColumn( 'device_id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _sessionRecordMeta = const VerificationMeta('sessionRecord'); @override late final GeneratedColumn sessionRecord = GeneratedColumn('session_record', aliasedName, false, type: DriftSqlType.blob, requiredDuringInsert: true); static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); @override List get $columns => [deviceId, name, sessionRecord, createdAt]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'signal_session_stores'; @override VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('device_id')) { context.handle(_deviceIdMeta, deviceId.isAcceptableOrUnknown(data['device_id']!, _deviceIdMeta)); } else if (isInserting) { context.missing(_deviceIdMeta); } if (data.containsKey('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('session_record')) { context.handle( _sessionRecordMeta, sessionRecord.isAcceptableOrUnknown( data['session_record']!, _sessionRecordMeta)); } else if (isInserting) { context.missing(_sessionRecordMeta); } if (data.containsKey('created_at')) { context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); } return context; } @override Set get $primaryKey => {deviceId, name}; @override SignalSessionStore map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SignalSessionStore( deviceId: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}device_id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, sessionRecord: attachedDatabase.typeMapping .read(DriftSqlType.blob, data['${effectivePrefix}session_record'])!, createdAt: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, ); } @override $SignalSessionStoresTable createAlias(String alias) { return $SignalSessionStoresTable(attachedDatabase, alias); } } class SignalSessionStore extends DataClass implements Insertable { final int deviceId; final String name; final Uint8List sessionRecord; final DateTime createdAt; const SignalSessionStore( {required this.deviceId, required this.name, required this.sessionRecord, required this.createdAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['device_id'] = Variable(deviceId); map['name'] = Variable(name); map['session_record'] = Variable(sessionRecord); map['created_at'] = Variable(createdAt); return map; } SignalSessionStoresCompanion toCompanion(bool nullToAbsent) { return SignalSessionStoresCompanion( deviceId: Value(deviceId), name: Value(name), sessionRecord: Value(sessionRecord), createdAt: Value(createdAt), ); } factory SignalSessionStore.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return SignalSessionStore( deviceId: serializer.fromJson(json['deviceId']), name: serializer.fromJson(json['name']), sessionRecord: serializer.fromJson(json['sessionRecord']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'deviceId': serializer.toJson(deviceId), 'name': serializer.toJson(name), 'sessionRecord': serializer.toJson(sessionRecord), 'createdAt': serializer.toJson(createdAt), }; } SignalSessionStore copyWith( {int? deviceId, String? name, Uint8List? sessionRecord, DateTime? createdAt}) => SignalSessionStore( deviceId: deviceId ?? this.deviceId, name: name ?? this.name, sessionRecord: sessionRecord ?? this.sessionRecord, createdAt: createdAt ?? this.createdAt, ); SignalSessionStore copyWithCompanion(SignalSessionStoresCompanion data) { return SignalSessionStore( deviceId: data.deviceId.present ? data.deviceId.value : this.deviceId, name: data.name.present ? data.name.value : this.name, sessionRecord: data.sessionRecord.present ? data.sessionRecord.value : this.sessionRecord, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('SignalSessionStore(') ..write('deviceId: $deviceId, ') ..write('name: $name, ') ..write('sessionRecord: $sessionRecord, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( deviceId, name, $driftBlobEquality.hash(sessionRecord), createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is SignalSessionStore && other.deviceId == this.deviceId && other.name == this.name && $driftBlobEquality.equals(other.sessionRecord, this.sessionRecord) && other.createdAt == this.createdAt); } class SignalSessionStoresCompanion extends UpdateCompanion { final Value deviceId; final Value name; final Value sessionRecord; final Value createdAt; final Value rowid; const SignalSessionStoresCompanion({ this.deviceId = const Value.absent(), this.name = const Value.absent(), this.sessionRecord = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); SignalSessionStoresCompanion.insert({ required int deviceId, required String name, required Uint8List sessionRecord, this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }) : deviceId = Value(deviceId), name = Value(name), sessionRecord = Value(sessionRecord); static Insertable custom({ Expression? deviceId, Expression? name, Expression? sessionRecord, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (deviceId != null) 'device_id': deviceId, if (name != null) 'name': name, if (sessionRecord != null) 'session_record': sessionRecord, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } SignalSessionStoresCompanion copyWith( {Value? deviceId, Value? name, Value? sessionRecord, Value? createdAt, Value? rowid}) { return SignalSessionStoresCompanion( deviceId: deviceId ?? this.deviceId, name: name ?? this.name, sessionRecord: sessionRecord ?? this.sessionRecord, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (deviceId.present) { map['device_id'] = Variable(deviceId.value); } if (name.present) { map['name'] = Variable(name.value); } if (sessionRecord.present) { map['session_record'] = Variable(sessionRecord.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('SignalSessionStoresCompanion(') ..write('deviceId: $deviceId, ') ..write('name: $name, ') ..write('sessionRecord: $sessionRecord, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } abstract class _$TwonlyDatabase extends GeneratedDatabase { _$TwonlyDatabase(QueryExecutor e) : super(e); $TwonlyDatabaseManager get managers => $TwonlyDatabaseManager(this); late final $ContactsTable contacts = $ContactsTable(this); late final $MessagesTable messages = $MessagesTable(this); late final $SignalIdentityKeyStoresTable signalIdentityKeyStores = $SignalIdentityKeyStoresTable(this); late final $SignalPreKeyStoresTable signalPreKeyStores = $SignalPreKeyStoresTable(this); late final $SignalSenderKeyStoresTable signalSenderKeyStores = $SignalSenderKeyStoresTable(this); late final $SignalSessionStoresTable signalSessionStores = $SignalSessionStoresTable(this); late final MessagesDao messagesDao = MessagesDao(this as TwonlyDatabase); late final ContactsDao contactsDao = ContactsDao(this as TwonlyDatabase); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ contacts, messages, signalIdentityKeyStores, signalPreKeyStores, signalSenderKeyStores, signalSessionStores ]; } typedef $$ContactsTableCreateCompanionBuilder = ContactsCompanion Function({ Value userId, required String username, Value displayName, Value nickName, Value accepted, Value requested, Value blocked, Value verified, Value createdAt, Value totalMediaCounter, Value lastMessageSend, Value lastMessageReceived, Value lastMessage, Value flameCounter, }); typedef $$ContactsTableUpdateCompanionBuilder = ContactsCompanion Function({ Value userId, Value username, Value displayName, Value nickName, Value accepted, Value requested, Value blocked, Value verified, Value createdAt, Value totalMediaCounter, Value lastMessageSend, Value lastMessageReceived, Value lastMessage, Value flameCounter, }); final class $$ContactsTableReferences extends BaseReferences<_$TwonlyDatabase, $ContactsTable, Contact> { $$ContactsTableReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$MessagesTable, List> _messagesRefsTable( _$TwonlyDatabase db) => MultiTypedResultKey.fromTable(db.messages, aliasName: $_aliasNameGenerator(db.contacts.userId, db.messages.contactId)); $$MessagesTableProcessedTableManager get messagesRefs { final manager = $$MessagesTableTableManager($_db, $_db.messages).filter( (f) => f.contactId.userId.sqlEquals($_itemColumn('user_id')!)); final cache = $_typedResult.readTableOrNull(_messagesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } } class $$ContactsTableFilterComposer extends Composer<_$TwonlyDatabase, $ContactsTable> { $$ContactsTableFilterComposer({ 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 username => $composableBuilder( column: $table.username, builder: (column) => ColumnFilters(column)); ColumnFilters get displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnFilters(column)); ColumnFilters get nickName => $composableBuilder( column: $table.nickName, builder: (column) => ColumnFilters(column)); ColumnFilters get accepted => $composableBuilder( column: $table.accepted, builder: (column) => ColumnFilters(column)); ColumnFilters get requested => $composableBuilder( column: $table.requested, builder: (column) => ColumnFilters(column)); ColumnFilters get blocked => $composableBuilder( column: $table.blocked, builder: (column) => ColumnFilters(column)); ColumnFilters get verified => $composableBuilder( column: $table.verified, builder: (column) => ColumnFilters(column)); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column)); ColumnFilters get totalMediaCounter => $composableBuilder( column: $table.totalMediaCounter, builder: (column) => ColumnFilters(column)); ColumnFilters get lastMessageSend => $composableBuilder( column: $table.lastMessageSend, builder: (column) => ColumnFilters(column)); ColumnFilters get lastMessageReceived => $composableBuilder( column: $table.lastMessageReceived, builder: (column) => ColumnFilters(column)); ColumnFilters get lastMessage => $composableBuilder( column: $table.lastMessage, builder: (column) => ColumnFilters(column)); ColumnFilters get flameCounter => $composableBuilder( column: $table.flameCounter, builder: (column) => ColumnFilters(column)); Expression messagesRefs( Expression Function($$MessagesTableFilterComposer f) f) { final $$MessagesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.messages, getReferencedColumn: (t) => t.contactId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$MessagesTableFilterComposer( $db: $db, $table: $db.messages, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$ContactsTableOrderingComposer extends Composer<_$TwonlyDatabase, $ContactsTable> { $$ContactsTableOrderingComposer({ 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 username => $composableBuilder( column: $table.username, builder: (column) => ColumnOrderings(column)); ColumnOrderings get displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnOrderings(column)); ColumnOrderings get nickName => $composableBuilder( column: $table.nickName, builder: (column) => ColumnOrderings(column)); ColumnOrderings get accepted => $composableBuilder( column: $table.accepted, builder: (column) => ColumnOrderings(column)); ColumnOrderings get requested => $composableBuilder( column: $table.requested, builder: (column) => ColumnOrderings(column)); ColumnOrderings get blocked => $composableBuilder( column: $table.blocked, builder: (column) => ColumnOrderings(column)); ColumnOrderings get verified => $composableBuilder( column: $table.verified, builder: (column) => ColumnOrderings(column)); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column)); ColumnOrderings get totalMediaCounter => $composableBuilder( column: $table.totalMediaCounter, builder: (column) => ColumnOrderings(column)); ColumnOrderings get lastMessageSend => $composableBuilder( column: $table.lastMessageSend, builder: (column) => ColumnOrderings(column)); ColumnOrderings get lastMessageReceived => $composableBuilder( column: $table.lastMessageReceived, builder: (column) => ColumnOrderings(column)); ColumnOrderings get lastMessage => $composableBuilder( column: $table.lastMessage, builder: (column) => ColumnOrderings(column)); ColumnOrderings get flameCounter => $composableBuilder( column: $table.flameCounter, builder: (column) => ColumnOrderings(column)); } class $$ContactsTableAnnotationComposer extends Composer<_$TwonlyDatabase, $ContactsTable> { $$ContactsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get userId => $composableBuilder(column: $table.userId, builder: (column) => column); GeneratedColumn get username => $composableBuilder(column: $table.username, builder: (column) => column); GeneratedColumn get displayName => $composableBuilder( column: $table.displayName, builder: (column) => column); GeneratedColumn get nickName => $composableBuilder(column: $table.nickName, builder: (column) => column); GeneratedColumn get accepted => $composableBuilder(column: $table.accepted, builder: (column) => column); GeneratedColumn get requested => $composableBuilder(column: $table.requested, builder: (column) => column); GeneratedColumn get blocked => $composableBuilder(column: $table.blocked, builder: (column) => column); GeneratedColumn get verified => $composableBuilder(column: $table.verified, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); GeneratedColumn get totalMediaCounter => $composableBuilder( column: $table.totalMediaCounter, builder: (column) => column); GeneratedColumn get lastMessageSend => $composableBuilder( column: $table.lastMessageSend, builder: (column) => column); GeneratedColumn get lastMessageReceived => $composableBuilder( column: $table.lastMessageReceived, builder: (column) => column); GeneratedColumn get lastMessage => $composableBuilder( column: $table.lastMessage, builder: (column) => column); GeneratedColumn get flameCounter => $composableBuilder( column: $table.flameCounter, builder: (column) => column); Expression messagesRefs( Expression Function($$MessagesTableAnnotationComposer a) f) { final $$MessagesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.messages, getReferencedColumn: (t) => t.contactId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$MessagesTableAnnotationComposer( $db: $db, $table: $db.messages, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$ContactsTableTableManager extends RootTableManager< _$TwonlyDatabase, $ContactsTable, Contact, $$ContactsTableFilterComposer, $$ContactsTableOrderingComposer, $$ContactsTableAnnotationComposer, $$ContactsTableCreateCompanionBuilder, $$ContactsTableUpdateCompanionBuilder, (Contact, $$ContactsTableReferences), Contact, PrefetchHooks Function({bool messagesRefs})> { $$ContactsTableTableManager(_$TwonlyDatabase db, $ContactsTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$ContactsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ContactsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ContactsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value userId = const Value.absent(), Value username = const Value.absent(), Value displayName = const Value.absent(), Value nickName = const Value.absent(), Value accepted = const Value.absent(), Value requested = const Value.absent(), Value blocked = const Value.absent(), Value verified = const Value.absent(), Value createdAt = const Value.absent(), Value totalMediaCounter = const Value.absent(), Value lastMessageSend = const Value.absent(), Value lastMessageReceived = const Value.absent(), Value lastMessage = const Value.absent(), Value flameCounter = const Value.absent(), }) => ContactsCompanion( userId: userId, username: username, displayName: displayName, nickName: nickName, accepted: accepted, requested: requested, blocked: blocked, verified: verified, createdAt: createdAt, totalMediaCounter: totalMediaCounter, lastMessageSend: lastMessageSend, lastMessageReceived: lastMessageReceived, lastMessage: lastMessage, flameCounter: flameCounter, ), createCompanionCallback: ({ Value userId = const Value.absent(), required String username, Value displayName = const Value.absent(), Value nickName = const Value.absent(), Value accepted = const Value.absent(), Value requested = const Value.absent(), Value blocked = const Value.absent(), Value verified = const Value.absent(), Value createdAt = const Value.absent(), Value totalMediaCounter = const Value.absent(), Value lastMessageSend = const Value.absent(), Value lastMessageReceived = const Value.absent(), Value lastMessage = const Value.absent(), Value flameCounter = const Value.absent(), }) => ContactsCompanion.insert( userId: userId, username: username, displayName: displayName, nickName: nickName, accepted: accepted, requested: requested, blocked: blocked, verified: verified, createdAt: createdAt, totalMediaCounter: totalMediaCounter, lastMessageSend: lastMessageSend, lastMessageReceived: lastMessageReceived, lastMessage: lastMessage, flameCounter: flameCounter, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $$ContactsTableReferences(db, table, e))) .toList(), prefetchHooksCallback: ({messagesRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (messagesRefs) db.messages], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (messagesRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$ContactsTableReferences._messagesRefsTable(db), managerFromTypedResult: (p0) => $$ContactsTableReferences(db, table, p0) .messagesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems .where((e) => e.contactId == item.userId), typedResults: items) ]; }, ); }, )); } typedef $$ContactsTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $ContactsTable, Contact, $$ContactsTableFilterComposer, $$ContactsTableOrderingComposer, $$ContactsTableAnnotationComposer, $$ContactsTableCreateCompanionBuilder, $$ContactsTableUpdateCompanionBuilder, (Contact, $$ContactsTableReferences), Contact, PrefetchHooks Function({bool messagesRefs})>; typedef $$MessagesTableCreateCompanionBuilder = MessagesCompanion Function({ required int contactId, Value messageId, Value messageOtherId, Value responseToMessageId, Value responseToOtherMessageId, Value acknowledgeByUser, Value downloadState, Value acknowledgeByServer, required MessageKind kind, Value contentJson, Value openedAt, Value sendAt, Value updatedAt, }); typedef $$MessagesTableUpdateCompanionBuilder = MessagesCompanion Function({ Value contactId, Value messageId, Value messageOtherId, Value responseToMessageId, Value responseToOtherMessageId, Value acknowledgeByUser, Value downloadState, Value acknowledgeByServer, Value kind, Value contentJson, Value openedAt, Value sendAt, Value updatedAt, }); final class $$MessagesTableReferences extends BaseReferences<_$TwonlyDatabase, $MessagesTable, Message> { $$MessagesTableReferences(super.$_db, super.$_table, super.$_typedResult); static $ContactsTable _contactIdTable(_$TwonlyDatabase db) => db.contacts.createAlias( $_aliasNameGenerator(db.messages.contactId, db.contacts.userId)); $$ContactsTableProcessedTableManager get contactId { final $_column = $_itemColumn('contact_id')!; final manager = $$ContactsTableTableManager($_db, $_db.contacts) .filter((f) => f.userId.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_contactIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } } class $$MessagesTableFilterComposer extends Composer<_$TwonlyDatabase, $MessagesTable> { $$MessagesTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get messageId => $composableBuilder( column: $table.messageId, builder: (column) => ColumnFilters(column)); ColumnFilters get messageOtherId => $composableBuilder( column: $table.messageOtherId, builder: (column) => ColumnFilters(column)); ColumnFilters get responseToMessageId => $composableBuilder( column: $table.responseToMessageId, builder: (column) => ColumnFilters(column)); ColumnFilters get responseToOtherMessageId => $composableBuilder( column: $table.responseToOtherMessageId, builder: (column) => ColumnFilters(column)); ColumnFilters get acknowledgeByUser => $composableBuilder( column: $table.acknowledgeByUser, builder: (column) => ColumnFilters(column)); ColumnWithTypeConverterFilters get downloadState => $composableBuilder( column: $table.downloadState, builder: (column) => ColumnWithTypeConverterFilters(column)); ColumnFilters get acknowledgeByServer => $composableBuilder( column: $table.acknowledgeByServer, builder: (column) => ColumnFilters(column)); ColumnWithTypeConverterFilters get kind => $composableBuilder( column: $table.kind, builder: (column) => ColumnWithTypeConverterFilters(column)); ColumnFilters get contentJson => $composableBuilder( column: $table.contentJson, builder: (column) => ColumnFilters(column)); ColumnFilters get openedAt => $composableBuilder( column: $table.openedAt, builder: (column) => ColumnFilters(column)); ColumnFilters get sendAt => $composableBuilder( column: $table.sendAt, builder: (column) => ColumnFilters(column)); ColumnFilters get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnFilters(column)); $$ContactsTableFilterComposer get contactId { final $$ContactsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.contactId, referencedTable: $db.contacts, getReferencedColumn: (t) => t.userId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ContactsTableFilterComposer( $db: $db, $table: $db.contacts, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$MessagesTableOrderingComposer extends Composer<_$TwonlyDatabase, $MessagesTable> { $$MessagesTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get messageId => $composableBuilder( column: $table.messageId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get messageOtherId => $composableBuilder( column: $table.messageOtherId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get responseToMessageId => $composableBuilder( column: $table.responseToMessageId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get responseToOtherMessageId => $composableBuilder( column: $table.responseToOtherMessageId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get acknowledgeByUser => $composableBuilder( column: $table.acknowledgeByUser, builder: (column) => ColumnOrderings(column)); ColumnOrderings get downloadState => $composableBuilder( column: $table.downloadState, builder: (column) => ColumnOrderings(column)); ColumnOrderings get acknowledgeByServer => $composableBuilder( column: $table.acknowledgeByServer, builder: (column) => ColumnOrderings(column)); ColumnOrderings get kind => $composableBuilder( column: $table.kind, builder: (column) => ColumnOrderings(column)); ColumnOrderings get contentJson => $composableBuilder( column: $table.contentJson, builder: (column) => ColumnOrderings(column)); ColumnOrderings get openedAt => $composableBuilder( column: $table.openedAt, builder: (column) => ColumnOrderings(column)); ColumnOrderings get sendAt => $composableBuilder( column: $table.sendAt, builder: (column) => ColumnOrderings(column)); ColumnOrderings get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); $$ContactsTableOrderingComposer get contactId { final $$ContactsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.contactId, referencedTable: $db.contacts, getReferencedColumn: (t) => t.userId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ContactsTableOrderingComposer( $db: $db, $table: $db.contacts, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$MessagesTableAnnotationComposer extends Composer<_$TwonlyDatabase, $MessagesTable> { $$MessagesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get messageId => $composableBuilder(column: $table.messageId, builder: (column) => column); GeneratedColumn get messageOtherId => $composableBuilder( column: $table.messageOtherId, builder: (column) => column); GeneratedColumn get responseToMessageId => $composableBuilder( column: $table.responseToMessageId, builder: (column) => column); GeneratedColumn get responseToOtherMessageId => $composableBuilder( column: $table.responseToOtherMessageId, builder: (column) => column); GeneratedColumn get acknowledgeByUser => $composableBuilder( column: $table.acknowledgeByUser, builder: (column) => column); GeneratedColumnWithTypeConverter get downloadState => $composableBuilder( column: $table.downloadState, builder: (column) => column); GeneratedColumn get acknowledgeByServer => $composableBuilder( column: $table.acknowledgeByServer, builder: (column) => column); GeneratedColumnWithTypeConverter get kind => $composableBuilder(column: $table.kind, builder: (column) => column); GeneratedColumn get contentJson => $composableBuilder( column: $table.contentJson, builder: (column) => column); GeneratedColumn get openedAt => $composableBuilder(column: $table.openedAt, builder: (column) => column); GeneratedColumn get sendAt => $composableBuilder(column: $table.sendAt, builder: (column) => column); GeneratedColumn get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); $$ContactsTableAnnotationComposer get contactId { final $$ContactsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.contactId, referencedTable: $db.contacts, getReferencedColumn: (t) => t.userId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ContactsTableAnnotationComposer( $db: $db, $table: $db.contacts, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$MessagesTableTableManager extends RootTableManager< _$TwonlyDatabase, $MessagesTable, Message, $$MessagesTableFilterComposer, $$MessagesTableOrderingComposer, $$MessagesTableAnnotationComposer, $$MessagesTableCreateCompanionBuilder, $$MessagesTableUpdateCompanionBuilder, (Message, $$MessagesTableReferences), Message, PrefetchHooks Function({bool contactId})> { $$MessagesTableTableManager(_$TwonlyDatabase 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 contactId = const Value.absent(), Value messageId = const Value.absent(), Value messageOtherId = const Value.absent(), Value responseToMessageId = const Value.absent(), Value responseToOtherMessageId = const Value.absent(), Value acknowledgeByUser = const Value.absent(), Value downloadState = const Value.absent(), Value acknowledgeByServer = const Value.absent(), Value kind = const Value.absent(), Value contentJson = const Value.absent(), Value openedAt = const Value.absent(), Value sendAt = const Value.absent(), Value updatedAt = const Value.absent(), }) => MessagesCompanion( contactId: contactId, messageId: messageId, messageOtherId: messageOtherId, responseToMessageId: responseToMessageId, responseToOtherMessageId: responseToOtherMessageId, acknowledgeByUser: acknowledgeByUser, downloadState: downloadState, acknowledgeByServer: acknowledgeByServer, kind: kind, contentJson: contentJson, openedAt: openedAt, sendAt: sendAt, updatedAt: updatedAt, ), createCompanionCallback: ({ required int contactId, Value messageId = const Value.absent(), Value messageOtherId = const Value.absent(), Value responseToMessageId = const Value.absent(), Value responseToOtherMessageId = const Value.absent(), Value acknowledgeByUser = const Value.absent(), Value downloadState = const Value.absent(), Value acknowledgeByServer = const Value.absent(), required MessageKind kind, Value contentJson = const Value.absent(), Value openedAt = const Value.absent(), Value sendAt = const Value.absent(), Value updatedAt = const Value.absent(), }) => MessagesCompanion.insert( contactId: contactId, messageId: messageId, messageOtherId: messageOtherId, responseToMessageId: responseToMessageId, responseToOtherMessageId: responseToOtherMessageId, acknowledgeByUser: acknowledgeByUser, downloadState: downloadState, acknowledgeByServer: acknowledgeByServer, kind: kind, contentJson: contentJson, openedAt: openedAt, sendAt: sendAt, updatedAt: updatedAt, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $$MessagesTableReferences(db, table, e))) .toList(), prefetchHooksCallback: ({contactId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic>>(state) { if (contactId) { state = state.withJoin( currentTable: table, currentColumn: table.contactId, referencedTable: $$MessagesTableReferences._contactIdTable(db), referencedColumn: $$MessagesTableReferences._contactIdTable(db).userId, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, )); } typedef $$MessagesTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $MessagesTable, Message, $$MessagesTableFilterComposer, $$MessagesTableOrderingComposer, $$MessagesTableAnnotationComposer, $$MessagesTableCreateCompanionBuilder, $$MessagesTableUpdateCompanionBuilder, (Message, $$MessagesTableReferences), Message, PrefetchHooks Function({bool contactId})>; typedef $$SignalIdentityKeyStoresTableCreateCompanionBuilder = SignalIdentityKeyStoresCompanion Function({ required int deviceId, required String name, required Uint8List identityKey, Value createdAt, Value rowid, }); typedef $$SignalIdentityKeyStoresTableUpdateCompanionBuilder = SignalIdentityKeyStoresCompanion Function({ Value deviceId, Value name, Value identityKey, Value createdAt, Value rowid, }); class $$SignalIdentityKeyStoresTableFilterComposer extends Composer<_$TwonlyDatabase, $SignalIdentityKeyStoresTable> { $$SignalIdentityKeyStoresTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get deviceId => $composableBuilder( column: $table.deviceId, builder: (column) => ColumnFilters(column)); ColumnFilters get name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get identityKey => $composableBuilder( column: $table.identityKey, builder: (column) => ColumnFilters(column)); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column)); } class $$SignalIdentityKeyStoresTableOrderingComposer extends Composer<_$TwonlyDatabase, $SignalIdentityKeyStoresTable> { $$SignalIdentityKeyStoresTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get deviceId => $composableBuilder( column: $table.deviceId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get identityKey => $composableBuilder( column: $table.identityKey, builder: (column) => ColumnOrderings(column)); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column)); } class $$SignalIdentityKeyStoresTableAnnotationComposer extends Composer<_$TwonlyDatabase, $SignalIdentityKeyStoresTable> { $$SignalIdentityKeyStoresTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get deviceId => $composableBuilder(column: $table.deviceId, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get identityKey => $composableBuilder( column: $table.identityKey, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); } class $$SignalIdentityKeyStoresTableTableManager extends RootTableManager< _$TwonlyDatabase, $SignalIdentityKeyStoresTable, SignalIdentityKeyStore, $$SignalIdentityKeyStoresTableFilterComposer, $$SignalIdentityKeyStoresTableOrderingComposer, $$SignalIdentityKeyStoresTableAnnotationComposer, $$SignalIdentityKeyStoresTableCreateCompanionBuilder, $$SignalIdentityKeyStoresTableUpdateCompanionBuilder, ( SignalIdentityKeyStore, BaseReferences<_$TwonlyDatabase, $SignalIdentityKeyStoresTable, SignalIdentityKeyStore> ), SignalIdentityKeyStore, PrefetchHooks Function()> { $$SignalIdentityKeyStoresTableTableManager( _$TwonlyDatabase db, $SignalIdentityKeyStoresTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$SignalIdentityKeyStoresTableFilterComposer( $db: db, $table: table), createOrderingComposer: () => $$SignalIdentityKeyStoresTableOrderingComposer( $db: db, $table: table), createComputedFieldComposer: () => $$SignalIdentityKeyStoresTableAnnotationComposer( $db: db, $table: table), updateCompanionCallback: ({ Value deviceId = const Value.absent(), Value name = const Value.absent(), Value identityKey = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => SignalIdentityKeyStoresCompanion( deviceId: deviceId, name: name, identityKey: identityKey, createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required int deviceId, required String name, required Uint8List identityKey, Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => SignalIdentityKeyStoresCompanion.insert( deviceId: deviceId, name: name, identityKey: identityKey, createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $$SignalIdentityKeyStoresTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $SignalIdentityKeyStoresTable, SignalIdentityKeyStore, $$SignalIdentityKeyStoresTableFilterComposer, $$SignalIdentityKeyStoresTableOrderingComposer, $$SignalIdentityKeyStoresTableAnnotationComposer, $$SignalIdentityKeyStoresTableCreateCompanionBuilder, $$SignalIdentityKeyStoresTableUpdateCompanionBuilder, ( SignalIdentityKeyStore, BaseReferences<_$TwonlyDatabase, $SignalIdentityKeyStoresTable, SignalIdentityKeyStore> ), SignalIdentityKeyStore, PrefetchHooks Function()>; typedef $$SignalPreKeyStoresTableCreateCompanionBuilder = SignalPreKeyStoresCompanion Function({ Value preKeyId, required Uint8List preKey, Value createdAt, }); typedef $$SignalPreKeyStoresTableUpdateCompanionBuilder = SignalPreKeyStoresCompanion Function({ Value preKeyId, Value preKey, Value createdAt, }); class $$SignalPreKeyStoresTableFilterComposer extends Composer<_$TwonlyDatabase, $SignalPreKeyStoresTable> { $$SignalPreKeyStoresTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get preKeyId => $composableBuilder( column: $table.preKeyId, builder: (column) => ColumnFilters(column)); ColumnFilters get preKey => $composableBuilder( column: $table.preKey, builder: (column) => ColumnFilters(column)); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column)); } class $$SignalPreKeyStoresTableOrderingComposer extends Composer<_$TwonlyDatabase, $SignalPreKeyStoresTable> { $$SignalPreKeyStoresTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get preKeyId => $composableBuilder( column: $table.preKeyId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get preKey => $composableBuilder( column: $table.preKey, builder: (column) => ColumnOrderings(column)); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column)); } class $$SignalPreKeyStoresTableAnnotationComposer extends Composer<_$TwonlyDatabase, $SignalPreKeyStoresTable> { $$SignalPreKeyStoresTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get preKeyId => $composableBuilder(column: $table.preKeyId, builder: (column) => column); GeneratedColumn get preKey => $composableBuilder(column: $table.preKey, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); } class $$SignalPreKeyStoresTableTableManager extends RootTableManager< _$TwonlyDatabase, $SignalPreKeyStoresTable, SignalPreKeyStore, $$SignalPreKeyStoresTableFilterComposer, $$SignalPreKeyStoresTableOrderingComposer, $$SignalPreKeyStoresTableAnnotationComposer, $$SignalPreKeyStoresTableCreateCompanionBuilder, $$SignalPreKeyStoresTableUpdateCompanionBuilder, ( SignalPreKeyStore, BaseReferences<_$TwonlyDatabase, $SignalPreKeyStoresTable, SignalPreKeyStore> ), SignalPreKeyStore, PrefetchHooks Function()> { $$SignalPreKeyStoresTableTableManager( _$TwonlyDatabase db, $SignalPreKeyStoresTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$SignalPreKeyStoresTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$SignalPreKeyStoresTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$SignalPreKeyStoresTableAnnotationComposer( $db: db, $table: table), updateCompanionCallback: ({ Value preKeyId = const Value.absent(), Value preKey = const Value.absent(), Value createdAt = const Value.absent(), }) => SignalPreKeyStoresCompanion( preKeyId: preKeyId, preKey: preKey, createdAt: createdAt, ), createCompanionCallback: ({ Value preKeyId = const Value.absent(), required Uint8List preKey, Value createdAt = const Value.absent(), }) => SignalPreKeyStoresCompanion.insert( preKeyId: preKeyId, preKey: preKey, createdAt: createdAt, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $$SignalPreKeyStoresTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $SignalPreKeyStoresTable, SignalPreKeyStore, $$SignalPreKeyStoresTableFilterComposer, $$SignalPreKeyStoresTableOrderingComposer, $$SignalPreKeyStoresTableAnnotationComposer, $$SignalPreKeyStoresTableCreateCompanionBuilder, $$SignalPreKeyStoresTableUpdateCompanionBuilder, ( SignalPreKeyStore, BaseReferences<_$TwonlyDatabase, $SignalPreKeyStoresTable, SignalPreKeyStore> ), SignalPreKeyStore, PrefetchHooks Function()>; typedef $$SignalSenderKeyStoresTableCreateCompanionBuilder = SignalSenderKeyStoresCompanion Function({ required String senderKeyName, required Uint8List senderKey, Value rowid, }); typedef $$SignalSenderKeyStoresTableUpdateCompanionBuilder = SignalSenderKeyStoresCompanion Function({ Value senderKeyName, Value senderKey, Value rowid, }); class $$SignalSenderKeyStoresTableFilterComposer extends Composer<_$TwonlyDatabase, $SignalSenderKeyStoresTable> { $$SignalSenderKeyStoresTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get senderKeyName => $composableBuilder( column: $table.senderKeyName, builder: (column) => ColumnFilters(column)); ColumnFilters get senderKey => $composableBuilder( column: $table.senderKey, builder: (column) => ColumnFilters(column)); } class $$SignalSenderKeyStoresTableOrderingComposer extends Composer<_$TwonlyDatabase, $SignalSenderKeyStoresTable> { $$SignalSenderKeyStoresTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get senderKeyName => $composableBuilder( column: $table.senderKeyName, builder: (column) => ColumnOrderings(column)); ColumnOrderings get senderKey => $composableBuilder( column: $table.senderKey, builder: (column) => ColumnOrderings(column)); } class $$SignalSenderKeyStoresTableAnnotationComposer extends Composer<_$TwonlyDatabase, $SignalSenderKeyStoresTable> { $$SignalSenderKeyStoresTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get senderKeyName => $composableBuilder( column: $table.senderKeyName, builder: (column) => column); GeneratedColumn get senderKey => $composableBuilder(column: $table.senderKey, builder: (column) => column); } class $$SignalSenderKeyStoresTableTableManager extends RootTableManager< _$TwonlyDatabase, $SignalSenderKeyStoresTable, SignalSenderKeyStore, $$SignalSenderKeyStoresTableFilterComposer, $$SignalSenderKeyStoresTableOrderingComposer, $$SignalSenderKeyStoresTableAnnotationComposer, $$SignalSenderKeyStoresTableCreateCompanionBuilder, $$SignalSenderKeyStoresTableUpdateCompanionBuilder, ( SignalSenderKeyStore, BaseReferences<_$TwonlyDatabase, $SignalSenderKeyStoresTable, SignalSenderKeyStore> ), SignalSenderKeyStore, PrefetchHooks Function()> { $$SignalSenderKeyStoresTableTableManager( _$TwonlyDatabase db, $SignalSenderKeyStoresTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$SignalSenderKeyStoresTableFilterComposer( $db: db, $table: table), createOrderingComposer: () => $$SignalSenderKeyStoresTableOrderingComposer( $db: db, $table: table), createComputedFieldComposer: () => $$SignalSenderKeyStoresTableAnnotationComposer( $db: db, $table: table), updateCompanionCallback: ({ Value senderKeyName = const Value.absent(), Value senderKey = const Value.absent(), Value rowid = const Value.absent(), }) => SignalSenderKeyStoresCompanion( senderKeyName: senderKeyName, senderKey: senderKey, rowid: rowid, ), createCompanionCallback: ({ required String senderKeyName, required Uint8List senderKey, Value rowid = const Value.absent(), }) => SignalSenderKeyStoresCompanion.insert( senderKeyName: senderKeyName, senderKey: senderKey, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $$SignalSenderKeyStoresTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $SignalSenderKeyStoresTable, SignalSenderKeyStore, $$SignalSenderKeyStoresTableFilterComposer, $$SignalSenderKeyStoresTableOrderingComposer, $$SignalSenderKeyStoresTableAnnotationComposer, $$SignalSenderKeyStoresTableCreateCompanionBuilder, $$SignalSenderKeyStoresTableUpdateCompanionBuilder, ( SignalSenderKeyStore, BaseReferences<_$TwonlyDatabase, $SignalSenderKeyStoresTable, SignalSenderKeyStore> ), SignalSenderKeyStore, PrefetchHooks Function()>; typedef $$SignalSessionStoresTableCreateCompanionBuilder = SignalSessionStoresCompanion Function({ required int deviceId, required String name, required Uint8List sessionRecord, Value createdAt, Value rowid, }); typedef $$SignalSessionStoresTableUpdateCompanionBuilder = SignalSessionStoresCompanion Function({ Value deviceId, Value name, Value sessionRecord, Value createdAt, Value rowid, }); class $$SignalSessionStoresTableFilterComposer extends Composer<_$TwonlyDatabase, $SignalSessionStoresTable> { $$SignalSessionStoresTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get deviceId => $composableBuilder( column: $table.deviceId, builder: (column) => ColumnFilters(column)); ColumnFilters get name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get sessionRecord => $composableBuilder( column: $table.sessionRecord, builder: (column) => ColumnFilters(column)); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column)); } class $$SignalSessionStoresTableOrderingComposer extends Composer<_$TwonlyDatabase, $SignalSessionStoresTable> { $$SignalSessionStoresTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get deviceId => $composableBuilder( column: $table.deviceId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get sessionRecord => $composableBuilder( column: $table.sessionRecord, builder: (column) => ColumnOrderings(column)); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column)); } class $$SignalSessionStoresTableAnnotationComposer extends Composer<_$TwonlyDatabase, $SignalSessionStoresTable> { $$SignalSessionStoresTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get deviceId => $composableBuilder(column: $table.deviceId, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get sessionRecord => $composableBuilder( column: $table.sessionRecord, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); } class $$SignalSessionStoresTableTableManager extends RootTableManager< _$TwonlyDatabase, $SignalSessionStoresTable, SignalSessionStore, $$SignalSessionStoresTableFilterComposer, $$SignalSessionStoresTableOrderingComposer, $$SignalSessionStoresTableAnnotationComposer, $$SignalSessionStoresTableCreateCompanionBuilder, $$SignalSessionStoresTableUpdateCompanionBuilder, ( SignalSessionStore, BaseReferences<_$TwonlyDatabase, $SignalSessionStoresTable, SignalSessionStore> ), SignalSessionStore, PrefetchHooks Function()> { $$SignalSessionStoresTableTableManager( _$TwonlyDatabase db, $SignalSessionStoresTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$SignalSessionStoresTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$SignalSessionStoresTableOrderingComposer( $db: db, $table: table), createComputedFieldComposer: () => $$SignalSessionStoresTableAnnotationComposer( $db: db, $table: table), updateCompanionCallback: ({ Value deviceId = const Value.absent(), Value name = const Value.absent(), Value sessionRecord = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => SignalSessionStoresCompanion( deviceId: deviceId, name: name, sessionRecord: sessionRecord, createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required int deviceId, required String name, required Uint8List sessionRecord, Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => SignalSessionStoresCompanion.insert( deviceId: deviceId, name: name, sessionRecord: sessionRecord, createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $$SignalSessionStoresTableProcessedTableManager = ProcessedTableManager< _$TwonlyDatabase, $SignalSessionStoresTable, SignalSessionStore, $$SignalSessionStoresTableFilterComposer, $$SignalSessionStoresTableOrderingComposer, $$SignalSessionStoresTableAnnotationComposer, $$SignalSessionStoresTableCreateCompanionBuilder, $$SignalSessionStoresTableUpdateCompanionBuilder, ( SignalSessionStore, BaseReferences<_$TwonlyDatabase, $SignalSessionStoresTable, SignalSessionStore> ), SignalSessionStore, PrefetchHooks Function()>; class $TwonlyDatabaseManager { final _$TwonlyDatabase _db; $TwonlyDatabaseManager(this._db); $$ContactsTableTableManager get contacts => $$ContactsTableTableManager(_db, _db.contacts); $$MessagesTableTableManager get messages => $$MessagesTableTableManager(_db, _db.messages); $$SignalIdentityKeyStoresTableTableManager get signalIdentityKeyStores => $$SignalIdentityKeyStoresTableTableManager( _db, _db.signalIdentityKeyStores); $$SignalPreKeyStoresTableTableManager get signalPreKeyStores => $$SignalPreKeyStoresTableTableManager(_db, _db.signalPreKeyStores); $$SignalSenderKeyStoresTableTableManager get signalSenderKeyStores => $$SignalSenderKeyStoresTableTableManager(_db, _db.signalSenderKeyStores); $$SignalSessionStoresTableTableManager get signalSessionStores => $$SignalSessionStoresTableTableManager(_db, _db.signalSessionStores); }