// dart format width=80 // GENERATED CODE, DO NOT EDIT BY HAND. // ignore_for_file: type=lint import 'package:drift/drift.dart'; class ChatMessages extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; ChatMessages(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); late final GeneratedColumn roomId = GeneratedColumn( 'room_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); late final GeneratedColumn senderId = GeneratedColumn( 'sender_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); late final GeneratedColumn content = GeneratedColumn( 'content', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn nonce = GeneratedColumn( 'nonce', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn data = GeneratedColumn( 'data', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); late final GeneratedColumn status = GeneratedColumn( 'status', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); late final GeneratedColumn isDeleted = GeneratedColumn( 'is_deleted', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_deleted" IN (0, 1))', ), defaultValue: const CustomExpression('0'), ); late final GeneratedColumn updatedAt = GeneratedColumn( 'updated_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); late final GeneratedColumn deletedAt = GeneratedColumn( 'deleted_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); late final GeneratedColumn type = GeneratedColumn( 'type', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const CustomExpression('\'text\''), ); late final GeneratedColumn meta = GeneratedColumn( 'meta', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const CustomExpression('\'{}\''), ); late final GeneratedColumn membersMentioned = GeneratedColumn( 'members_mentioned', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const CustomExpression('\'[]\''), ); late final GeneratedColumn editedAt = GeneratedColumn( 'edited_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); late final GeneratedColumn attachments = GeneratedColumn( 'attachments', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const CustomExpression('\'[]\''), ); late final GeneratedColumn reactions = GeneratedColumn( 'reactions', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const CustomExpression('\'[]\''), ); late final GeneratedColumn repliedMessageId = GeneratedColumn( 'replied_message_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn forwardedMessageId = GeneratedColumn( 'forwarded_message_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, roomId, senderId, content, nonce, data, createdAt, status, isDeleted, updatedAt, deletedAt, type, meta, membersMentioned, editedAt, attachments, reactions, repliedMessageId, forwardedMessageId, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'chat_messages'; @override Set get $primaryKey => {id}; @override ChatMessagesData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ChatMessagesData( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, roomId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}room_id'], )!, senderId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}sender_id'], )!, content: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}content'], ), nonce: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}nonce'], ), data: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}data'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}created_at'], )!, status: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}status'], )!, isDeleted: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}is_deleted'], )!, updatedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}updated_at'], )!, deletedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}deleted_at'], ), type: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}type'], )!, meta: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}meta'], )!, membersMentioned: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}members_mentioned'], )!, editedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}edited_at'], ), attachments: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}attachments'], )!, reactions: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reactions'], )!, repliedMessageId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}replied_message_id'], ), forwardedMessageId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}forwarded_message_id'], ), ); } @override ChatMessages createAlias(String alias) { return ChatMessages(attachedDatabase, alias); } } class ChatMessagesData extends DataClass implements Insertable { final String id; final String roomId; final String senderId; final String? content; final String? nonce; final String data; final DateTime createdAt; final int status; final bool isDeleted; final DateTime updatedAt; final DateTime? deletedAt; final String type; final String meta; final String membersMentioned; final DateTime? editedAt; final String attachments; final String reactions; final String? repliedMessageId; final String? forwardedMessageId; const ChatMessagesData({ required this.id, required this.roomId, required this.senderId, this.content, this.nonce, required this.data, required this.createdAt, required this.status, required this.isDeleted, required this.updatedAt, this.deletedAt, required this.type, required this.meta, required this.membersMentioned, this.editedAt, required this.attachments, required this.reactions, this.repliedMessageId, this.forwardedMessageId, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['room_id'] = Variable(roomId); map['sender_id'] = Variable(senderId); if (!nullToAbsent || content != null) { map['content'] = Variable(content); } if (!nullToAbsent || nonce != null) { map['nonce'] = Variable(nonce); } map['data'] = Variable(data); map['created_at'] = Variable(createdAt); map['status'] = Variable(status); map['is_deleted'] = Variable(isDeleted); map['updated_at'] = Variable(updatedAt); if (!nullToAbsent || deletedAt != null) { map['deleted_at'] = Variable(deletedAt); } map['type'] = Variable(type); map['meta'] = Variable(meta); map['members_mentioned'] = Variable(membersMentioned); if (!nullToAbsent || editedAt != null) { map['edited_at'] = Variable(editedAt); } map['attachments'] = Variable(attachments); map['reactions'] = Variable(reactions); if (!nullToAbsent || repliedMessageId != null) { map['replied_message_id'] = Variable(repliedMessageId); } if (!nullToAbsent || forwardedMessageId != null) { map['forwarded_message_id'] = Variable(forwardedMessageId); } return map; } ChatMessagesCompanion toCompanion(bool nullToAbsent) { return ChatMessagesCompanion( id: Value(id), roomId: Value(roomId), senderId: Value(senderId), content: content == null && nullToAbsent ? const Value.absent() : Value(content), nonce: nonce == null && nullToAbsent ? const Value.absent() : Value(nonce), data: Value(data), createdAt: Value(createdAt), status: Value(status), isDeleted: Value(isDeleted), updatedAt: Value(updatedAt), deletedAt: deletedAt == null && nullToAbsent ? const Value.absent() : Value(deletedAt), type: Value(type), meta: Value(meta), membersMentioned: Value(membersMentioned), editedAt: editedAt == null && nullToAbsent ? const Value.absent() : Value(editedAt), attachments: Value(attachments), reactions: Value(reactions), repliedMessageId: repliedMessageId == null && nullToAbsent ? const Value.absent() : Value(repliedMessageId), forwardedMessageId: forwardedMessageId == null && nullToAbsent ? const Value.absent() : Value(forwardedMessageId), ); } factory ChatMessagesData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ChatMessagesData( id: serializer.fromJson(json['id']), roomId: serializer.fromJson(json['roomId']), senderId: serializer.fromJson(json['senderId']), content: serializer.fromJson(json['content']), nonce: serializer.fromJson(json['nonce']), data: serializer.fromJson(json['data']), createdAt: serializer.fromJson(json['createdAt']), status: serializer.fromJson(json['status']), isDeleted: serializer.fromJson(json['isDeleted']), updatedAt: serializer.fromJson(json['updatedAt']), deletedAt: serializer.fromJson(json['deletedAt']), type: serializer.fromJson(json['type']), meta: serializer.fromJson(json['meta']), membersMentioned: serializer.fromJson(json['membersMentioned']), editedAt: serializer.fromJson(json['editedAt']), attachments: serializer.fromJson(json['attachments']), reactions: serializer.fromJson(json['reactions']), repliedMessageId: serializer.fromJson(json['repliedMessageId']), forwardedMessageId: serializer.fromJson( json['forwardedMessageId'], ), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'roomId': serializer.toJson(roomId), 'senderId': serializer.toJson(senderId), 'content': serializer.toJson(content), 'nonce': serializer.toJson(nonce), 'data': serializer.toJson(data), 'createdAt': serializer.toJson(createdAt), 'status': serializer.toJson(status), 'isDeleted': serializer.toJson(isDeleted), 'updatedAt': serializer.toJson(updatedAt), 'deletedAt': serializer.toJson(deletedAt), 'type': serializer.toJson(type), 'meta': serializer.toJson(meta), 'membersMentioned': serializer.toJson(membersMentioned), 'editedAt': serializer.toJson(editedAt), 'attachments': serializer.toJson(attachments), 'reactions': serializer.toJson(reactions), 'repliedMessageId': serializer.toJson(repliedMessageId), 'forwardedMessageId': serializer.toJson(forwardedMessageId), }; } ChatMessagesData copyWith({ String? id, String? roomId, String? senderId, Value content = const Value.absent(), Value nonce = const Value.absent(), String? data, DateTime? createdAt, int? status, bool? isDeleted, DateTime? updatedAt, Value deletedAt = const Value.absent(), String? type, String? meta, String? membersMentioned, Value editedAt = const Value.absent(), String? attachments, String? reactions, Value repliedMessageId = const Value.absent(), Value forwardedMessageId = const Value.absent(), }) => ChatMessagesData( id: id ?? this.id, roomId: roomId ?? this.roomId, senderId: senderId ?? this.senderId, content: content.present ? content.value : this.content, nonce: nonce.present ? nonce.value : this.nonce, data: data ?? this.data, createdAt: createdAt ?? this.createdAt, status: status ?? this.status, isDeleted: isDeleted ?? this.isDeleted, updatedAt: updatedAt ?? this.updatedAt, deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, type: type ?? this.type, meta: meta ?? this.meta, membersMentioned: membersMentioned ?? this.membersMentioned, editedAt: editedAt.present ? editedAt.value : this.editedAt, attachments: attachments ?? this.attachments, reactions: reactions ?? this.reactions, repliedMessageId: repliedMessageId.present ? repliedMessageId.value : this.repliedMessageId, forwardedMessageId: forwardedMessageId.present ? forwardedMessageId.value : this.forwardedMessageId, ); ChatMessagesData copyWithCompanion(ChatMessagesCompanion data) { return ChatMessagesData( id: data.id.present ? data.id.value : this.id, roomId: data.roomId.present ? data.roomId.value : this.roomId, senderId: data.senderId.present ? data.senderId.value : this.senderId, content: data.content.present ? data.content.value : this.content, nonce: data.nonce.present ? data.nonce.value : this.nonce, data: data.data.present ? data.data.value : this.data, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, status: data.status.present ? data.status.value : this.status, isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted, updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, type: data.type.present ? data.type.value : this.type, meta: data.meta.present ? data.meta.value : this.meta, membersMentioned: data.membersMentioned.present ? data.membersMentioned.value : this.membersMentioned, editedAt: data.editedAt.present ? data.editedAt.value : this.editedAt, attachments: data.attachments.present ? data.attachments.value : this.attachments, reactions: data.reactions.present ? data.reactions.value : this.reactions, repliedMessageId: data.repliedMessageId.present ? data.repliedMessageId.value : this.repliedMessageId, forwardedMessageId: data.forwardedMessageId.present ? data.forwardedMessageId.value : this.forwardedMessageId, ); } @override String toString() { return (StringBuffer('ChatMessagesData(') ..write('id: $id, ') ..write('roomId: $roomId, ') ..write('senderId: $senderId, ') ..write('content: $content, ') ..write('nonce: $nonce, ') ..write('data: $data, ') ..write('createdAt: $createdAt, ') ..write('status: $status, ') ..write('isDeleted: $isDeleted, ') ..write('updatedAt: $updatedAt, ') ..write('deletedAt: $deletedAt, ') ..write('type: $type, ') ..write('meta: $meta, ') ..write('membersMentioned: $membersMentioned, ') ..write('editedAt: $editedAt, ') ..write('attachments: $attachments, ') ..write('reactions: $reactions, ') ..write('repliedMessageId: $repliedMessageId, ') ..write('forwardedMessageId: $forwardedMessageId') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, roomId, senderId, content, nonce, data, createdAt, status, isDeleted, updatedAt, deletedAt, type, meta, membersMentioned, editedAt, attachments, reactions, repliedMessageId, forwardedMessageId, ); @override bool operator ==(Object other) => identical(this, other) || (other is ChatMessagesData && other.id == this.id && other.roomId == this.roomId && other.senderId == this.senderId && other.content == this.content && other.nonce == this.nonce && other.data == this.data && other.createdAt == this.createdAt && other.status == this.status && other.isDeleted == this.isDeleted && other.updatedAt == this.updatedAt && other.deletedAt == this.deletedAt && other.type == this.type && other.meta == this.meta && other.membersMentioned == this.membersMentioned && other.editedAt == this.editedAt && other.attachments == this.attachments && other.reactions == this.reactions && other.repliedMessageId == this.repliedMessageId && other.forwardedMessageId == this.forwardedMessageId); } class ChatMessagesCompanion extends UpdateCompanion { final Value id; final Value roomId; final Value senderId; final Value content; final Value nonce; final Value data; final Value createdAt; final Value status; final Value isDeleted; final Value updatedAt; final Value deletedAt; final Value type; final Value meta; final Value membersMentioned; final Value editedAt; final Value attachments; final Value reactions; final Value repliedMessageId; final Value forwardedMessageId; final Value rowid; const ChatMessagesCompanion({ this.id = const Value.absent(), this.roomId = const Value.absent(), this.senderId = const Value.absent(), this.content = const Value.absent(), this.nonce = const Value.absent(), this.data = const Value.absent(), this.createdAt = const Value.absent(), this.status = const Value.absent(), this.isDeleted = const Value.absent(), this.updatedAt = const Value.absent(), this.deletedAt = const Value.absent(), this.type = const Value.absent(), this.meta = const Value.absent(), this.membersMentioned = const Value.absent(), this.editedAt = const Value.absent(), this.attachments = const Value.absent(), this.reactions = const Value.absent(), this.repliedMessageId = const Value.absent(), this.forwardedMessageId = const Value.absent(), this.rowid = const Value.absent(), }); ChatMessagesCompanion.insert({ required String id, required String roomId, required String senderId, this.content = const Value.absent(), this.nonce = const Value.absent(), required String data, required DateTime createdAt, required int status, this.isDeleted = const Value.absent(), required DateTime updatedAt, this.deletedAt = const Value.absent(), this.type = const Value.absent(), this.meta = const Value.absent(), this.membersMentioned = const Value.absent(), this.editedAt = const Value.absent(), this.attachments = const Value.absent(), this.reactions = const Value.absent(), this.repliedMessageId = const Value.absent(), this.forwardedMessageId = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), roomId = Value(roomId), senderId = Value(senderId), data = Value(data), createdAt = Value(createdAt), status = Value(status), updatedAt = Value(updatedAt); static Insertable custom({ Expression? id, Expression? roomId, Expression? senderId, Expression? content, Expression? nonce, Expression? data, Expression? createdAt, Expression? status, Expression? isDeleted, Expression? updatedAt, Expression? deletedAt, Expression? type, Expression? meta, Expression? membersMentioned, Expression? editedAt, Expression? attachments, Expression? reactions, Expression? repliedMessageId, Expression? forwardedMessageId, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (roomId != null) 'room_id': roomId, if (senderId != null) 'sender_id': senderId, if (content != null) 'content': content, if (nonce != null) 'nonce': nonce, if (data != null) 'data': data, if (createdAt != null) 'created_at': createdAt, if (status != null) 'status': status, if (isDeleted != null) 'is_deleted': isDeleted, if (updatedAt != null) 'updated_at': updatedAt, if (deletedAt != null) 'deleted_at': deletedAt, if (type != null) 'type': type, if (meta != null) 'meta': meta, if (membersMentioned != null) 'members_mentioned': membersMentioned, if (editedAt != null) 'edited_at': editedAt, if (attachments != null) 'attachments': attachments, if (reactions != null) 'reactions': reactions, if (repliedMessageId != null) 'replied_message_id': repliedMessageId, if (forwardedMessageId != null) 'forwarded_message_id': forwardedMessageId, if (rowid != null) 'rowid': rowid, }); } ChatMessagesCompanion copyWith({ Value? id, Value? roomId, Value? senderId, Value? content, Value? nonce, Value? data, Value? createdAt, Value? status, Value? isDeleted, Value? updatedAt, Value? deletedAt, Value? type, Value? meta, Value? membersMentioned, Value? editedAt, Value? attachments, Value? reactions, Value? repliedMessageId, Value? forwardedMessageId, Value? rowid, }) { return ChatMessagesCompanion( id: id ?? this.id, roomId: roomId ?? this.roomId, senderId: senderId ?? this.senderId, content: content ?? this.content, nonce: nonce ?? this.nonce, data: data ?? this.data, createdAt: createdAt ?? this.createdAt, status: status ?? this.status, isDeleted: isDeleted ?? this.isDeleted, updatedAt: updatedAt ?? this.updatedAt, deletedAt: deletedAt ?? this.deletedAt, type: type ?? this.type, meta: meta ?? this.meta, membersMentioned: membersMentioned ?? this.membersMentioned, editedAt: editedAt ?? this.editedAt, attachments: attachments ?? this.attachments, reactions: reactions ?? this.reactions, repliedMessageId: repliedMessageId ?? this.repliedMessageId, forwardedMessageId: forwardedMessageId ?? this.forwardedMessageId, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (roomId.present) { map['room_id'] = Variable(roomId.value); } if (senderId.present) { map['sender_id'] = Variable(senderId.value); } if (content.present) { map['content'] = Variable(content.value); } if (nonce.present) { map['nonce'] = Variable(nonce.value); } if (data.present) { map['data'] = Variable(data.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (status.present) { map['status'] = Variable(status.value); } if (isDeleted.present) { map['is_deleted'] = Variable(isDeleted.value); } if (updatedAt.present) { map['updated_at'] = Variable(updatedAt.value); } if (deletedAt.present) { map['deleted_at'] = Variable(deletedAt.value); } if (type.present) { map['type'] = Variable(type.value); } if (meta.present) { map['meta'] = Variable(meta.value); } if (membersMentioned.present) { map['members_mentioned'] = Variable(membersMentioned.value); } if (editedAt.present) { map['edited_at'] = Variable(editedAt.value); } if (attachments.present) { map['attachments'] = Variable(attachments.value); } if (reactions.present) { map['reactions'] = Variable(reactions.value); } if (repliedMessageId.present) { map['replied_message_id'] = Variable(repliedMessageId.value); } if (forwardedMessageId.present) { map['forwarded_message_id'] = Variable(forwardedMessageId.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ChatMessagesCompanion(') ..write('id: $id, ') ..write('roomId: $roomId, ') ..write('senderId: $senderId, ') ..write('content: $content, ') ..write('nonce: $nonce, ') ..write('data: $data, ') ..write('createdAt: $createdAt, ') ..write('status: $status, ') ..write('isDeleted: $isDeleted, ') ..write('updatedAt: $updatedAt, ') ..write('deletedAt: $deletedAt, ') ..write('type: $type, ') ..write('meta: $meta, ') ..write('membersMentioned: $membersMentioned, ') ..write('editedAt: $editedAt, ') ..write('attachments: $attachments, ') ..write('reactions: $reactions, ') ..write('repliedMessageId: $repliedMessageId, ') ..write('forwardedMessageId: $forwardedMessageId, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class PostDrafts extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; PostDrafts(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn description = GeneratedColumn( 'description', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn content = GeneratedColumn( 'content', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); late final GeneratedColumn visibility = GeneratedColumn( 'visibility', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const CustomExpression('0'), ); late final GeneratedColumn type = GeneratedColumn( 'type', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const CustomExpression('0'), ); late final GeneratedColumn lastModified = GeneratedColumn( 'last_modified', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); late final GeneratedColumn postData = GeneratedColumn( 'post_data', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); @override List get $columns => [ id, title, description, content, visibility, type, lastModified, postData, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'post_drafts'; @override Set get $primaryKey => {id}; @override PostDraftsData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return PostDraftsData( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), description: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}description'], ), content: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}content'], ), visibility: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}visibility'], )!, type: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}type'], )!, lastModified: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_modified'], )!, postData: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}post_data'], )!, ); } @override PostDrafts createAlias(String alias) { return PostDrafts(attachedDatabase, alias); } } class PostDraftsData extends DataClass implements Insertable { final String id; final String? title; final String? description; final String? content; final int visibility; final int type; final DateTime lastModified; final String postData; const PostDraftsData({ required this.id, this.title, this.description, this.content, required this.visibility, required this.type, required this.lastModified, required this.postData, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || title != null) { map['title'] = Variable(title); } if (!nullToAbsent || description != null) { map['description'] = Variable(description); } if (!nullToAbsent || content != null) { map['content'] = Variable(content); } map['visibility'] = Variable(visibility); map['type'] = Variable(type); map['last_modified'] = Variable(lastModified); map['post_data'] = Variable(postData); return map; } PostDraftsCompanion toCompanion(bool nullToAbsent) { return PostDraftsCompanion( id: Value(id), title: title == null && nullToAbsent ? const Value.absent() : Value(title), description: description == null && nullToAbsent ? const Value.absent() : Value(description), content: content == null && nullToAbsent ? const Value.absent() : Value(content), visibility: Value(visibility), type: Value(type), lastModified: Value(lastModified), postData: Value(postData), ); } factory PostDraftsData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return PostDraftsData( id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), description: serializer.fromJson(json['description']), content: serializer.fromJson(json['content']), visibility: serializer.fromJson(json['visibility']), type: serializer.fromJson(json['type']), lastModified: serializer.fromJson(json['lastModified']), postData: serializer.fromJson(json['postData']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'description': serializer.toJson(description), 'content': serializer.toJson(content), 'visibility': serializer.toJson(visibility), 'type': serializer.toJson(type), 'lastModified': serializer.toJson(lastModified), 'postData': serializer.toJson(postData), }; } PostDraftsData copyWith({ String? id, Value title = const Value.absent(), Value description = const Value.absent(), Value content = const Value.absent(), int? visibility, int? type, DateTime? lastModified, String? postData, }) => PostDraftsData( id: id ?? this.id, title: title.present ? title.value : this.title, description: description.present ? description.value : this.description, content: content.present ? content.value : this.content, visibility: visibility ?? this.visibility, type: type ?? this.type, lastModified: lastModified ?? this.lastModified, postData: postData ?? this.postData, ); PostDraftsData copyWithCompanion(PostDraftsCompanion data) { return PostDraftsData( id: data.id.present ? data.id.value : this.id, title: data.title.present ? data.title.value : this.title, description: data.description.present ? data.description.value : this.description, content: data.content.present ? data.content.value : this.content, visibility: data.visibility.present ? data.visibility.value : this.visibility, type: data.type.present ? data.type.value : this.type, lastModified: data.lastModified.present ? data.lastModified.value : this.lastModified, postData: data.postData.present ? data.postData.value : this.postData, ); } @override String toString() { return (StringBuffer('PostDraftsData(') ..write('id: $id, ') ..write('title: $title, ') ..write('description: $description, ') ..write('content: $content, ') ..write('visibility: $visibility, ') ..write('type: $type, ') ..write('lastModified: $lastModified, ') ..write('postData: $postData') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, title, description, content, visibility, type, lastModified, postData, ); @override bool operator ==(Object other) => identical(this, other) || (other is PostDraftsData && other.id == this.id && other.title == this.title && other.description == this.description && other.content == this.content && other.visibility == this.visibility && other.type == this.type && other.lastModified == this.lastModified && other.postData == this.postData); } class PostDraftsCompanion extends UpdateCompanion { final Value id; final Value title; final Value description; final Value content; final Value visibility; final Value type; final Value lastModified; final Value postData; final Value rowid; const PostDraftsCompanion({ this.id = const Value.absent(), this.title = const Value.absent(), this.description = const Value.absent(), this.content = const Value.absent(), this.visibility = const Value.absent(), this.type = const Value.absent(), this.lastModified = const Value.absent(), this.postData = const Value.absent(), this.rowid = const Value.absent(), }); PostDraftsCompanion.insert({ required String id, this.title = const Value.absent(), this.description = const Value.absent(), this.content = const Value.absent(), this.visibility = const Value.absent(), this.type = const Value.absent(), required DateTime lastModified, required String postData, this.rowid = const Value.absent(), }) : id = Value(id), lastModified = Value(lastModified), postData = Value(postData); static Insertable custom({ Expression? id, Expression? title, Expression? description, Expression? content, Expression? visibility, Expression? type, Expression? lastModified, Expression? postData, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (title != null) 'title': title, if (description != null) 'description': description, if (content != null) 'content': content, if (visibility != null) 'visibility': visibility, if (type != null) 'type': type, if (lastModified != null) 'last_modified': lastModified, if (postData != null) 'post_data': postData, if (rowid != null) 'rowid': rowid, }); } PostDraftsCompanion copyWith({ Value? id, Value? title, Value? description, Value? content, Value? visibility, Value? type, Value? lastModified, Value? postData, Value? rowid, }) { return PostDraftsCompanion( id: id ?? this.id, title: title ?? this.title, description: description ?? this.description, content: content ?? this.content, visibility: visibility ?? this.visibility, type: type ?? this.type, lastModified: lastModified ?? this.lastModified, postData: postData ?? this.postData, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (title.present) { map['title'] = Variable(title.value); } if (description.present) { map['description'] = Variable(description.value); } if (content.present) { map['content'] = Variable(content.value); } if (visibility.present) { map['visibility'] = Variable(visibility.value); } if (type.present) { map['type'] = Variable(type.value); } if (lastModified.present) { map['last_modified'] = Variable(lastModified.value); } if (postData.present) { map['post_data'] = Variable(postData.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('PostDraftsCompanion(') ..write('id: $id, ') ..write('title: $title, ') ..write('description: $description, ') ..write('content: $content, ') ..write('visibility: $visibility, ') ..write('type: $type, ') ..write('lastModified: $lastModified, ') ..write('postData: $postData, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class DatabaseAtV6 extends GeneratedDatabase { DatabaseAtV6(QueryExecutor e) : super(e); late final ChatMessages chatMessages = ChatMessages(this); late final PostDrafts postDrafts = PostDrafts(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ chatMessages, postDrafts, ]; @override int get schemaVersion => 6; }