// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ignore_for_file: type=lint class Feed extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; Feed(this.attachedDatabase, [this._alias]); late final GeneratedColumnWithTypeConverter url = GeneratedColumn( 'url', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ).withConverter(Feed.$converterurl); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn description = GeneratedColumn( 'description', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumnWithTypeConverter icon = GeneratedColumn( 'icon', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter(Feed.$convertericon); late final GeneratedColumnWithTypeConverter siteLink = GeneratedColumn( 'site_link', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter(Feed.$convertersiteLink); late final GeneratedColumnWithTypeConverter?, String> authors = GeneratedColumn( 'authors', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter?>(Feed.$converterauthorsn); late final GeneratedColumnWithTypeConverter?, String> tags = GeneratedColumn( 'tags', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter?>(Feed.$convertertagsn); late final GeneratedColumn lastFetched = GeneratedColumn( 'last_fetched', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [ url, title, description, icon, siteLink, authors, tags, lastFetched, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'feed'; @override Set get $primaryKey => {url}; @override FeedData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return FeedData( url: Feed.$converterurl.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], )!, ), title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), description: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}description'], ), icon: Feed.$convertericon.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}icon'], ), ), siteLink: Feed.$convertersiteLink.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}site_link'], ), ), authors: Feed.$converterauthorsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}authors'], ), ), tags: Feed.$convertertagsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tags'], ), ), lastFetched: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_fetched'], ), ); } @override Feed createAlias(String alias) { return Feed(attachedDatabase, alias); } static TypeConverter $converterurl = const UriConverter(); static TypeConverter $convertericon = const UriConverterNullable(); static TypeConverter $convertersiteLink = const UriConverterNullable(); static TypeConverter, String> $converterauthors = const FeedAuthorsConverter(); static TypeConverter?, String?> $converterauthorsn = NullAwareTypeConverter.wrap($converterauthors); static TypeConverter, String> $convertertags = const FeedCategoriesConverter(); static TypeConverter?, String?> $convertertagsn = NullAwareTypeConverter.wrap($convertertags); @override bool get dontWriteConstraints => true; } class FeedData extends DataClass implements Insertable { final Uri url; final String? title; final String? description; final Uri? icon; final Uri? siteLink; final List? authors; final List? tags; final DateTime? lastFetched; const FeedData({ required this.url, this.title, this.description, this.icon, this.siteLink, this.authors, this.tags, this.lastFetched, }); @override Map toColumns(bool nullToAbsent) { final map = {}; { map['url'] = Variable(Feed.$converterurl.toSql(url)); } if (!nullToAbsent || title != null) { map['title'] = Variable(title); } if (!nullToAbsent || description != null) { map['description'] = Variable(description); } if (!nullToAbsent || icon != null) { map['icon'] = Variable(Feed.$convertericon.toSql(icon)); } if (!nullToAbsent || siteLink != null) { map['site_link'] = Variable( Feed.$convertersiteLink.toSql(siteLink), ); } if (!nullToAbsent || authors != null) { map['authors'] = Variable(Feed.$converterauthorsn.toSql(authors)); } if (!nullToAbsent || tags != null) { map['tags'] = Variable(Feed.$convertertagsn.toSql(tags)); } if (!nullToAbsent || lastFetched != null) { map['last_fetched'] = Variable(lastFetched); } return map; } factory FeedData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return FeedData( url: serializer.fromJson(json['url']), title: serializer.fromJson(json['title']), description: serializer.fromJson(json['description']), icon: serializer.fromJson(json['icon']), siteLink: serializer.fromJson(json['site_link']), authors: serializer.fromJson?>(json['authors']), tags: serializer.fromJson?>(json['tags']), lastFetched: serializer.fromJson(json['last_fetched']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'url': serializer.toJson(url), 'title': serializer.toJson(title), 'description': serializer.toJson(description), 'icon': serializer.toJson(icon), 'site_link': serializer.toJson(siteLink), 'authors': serializer.toJson?>(authors), 'tags': serializer.toJson?>(tags), 'last_fetched': serializer.toJson(lastFetched), }; } FeedData copyWith({ Uri? url, Value title = const Value.absent(), Value description = const Value.absent(), Value icon = const Value.absent(), Value siteLink = const Value.absent(), Value?> authors = const Value.absent(), Value?> tags = const Value.absent(), Value lastFetched = const Value.absent(), }) => FeedData( url: url ?? this.url, title: title.present ? title.value : this.title, description: description.present ? description.value : this.description, icon: icon.present ? icon.value : this.icon, siteLink: siteLink.present ? siteLink.value : this.siteLink, authors: authors.present ? authors.value : this.authors, tags: tags.present ? tags.value : this.tags, lastFetched: lastFetched.present ? lastFetched.value : this.lastFetched, ); FeedData copyWithCompanion(FeedCompanion data) { return FeedData( url: data.url.present ? data.url.value : this.url, title: data.title.present ? data.title.value : this.title, description: data.description.present ? data.description.value : this.description, icon: data.icon.present ? data.icon.value : this.icon, siteLink: data.siteLink.present ? data.siteLink.value : this.siteLink, authors: data.authors.present ? data.authors.value : this.authors, tags: data.tags.present ? data.tags.value : this.tags, lastFetched: data.lastFetched.present ? data.lastFetched.value : this.lastFetched, ); } @override String toString() { return (StringBuffer('FeedData(') ..write('url: $url, ') ..write('title: $title, ') ..write('description: $description, ') ..write('icon: $icon, ') ..write('siteLink: $siteLink, ') ..write('authors: $authors, ') ..write('tags: $tags, ') ..write('lastFetched: $lastFetched') ..write(')')) .toString(); } @override int get hashCode => Object.hash( url, title, description, icon, siteLink, authors, tags, lastFetched, ); @override bool operator ==(Object other) => identical(this, other) || (other is FeedData && other.url == this.url && other.title == this.title && other.description == this.description && other.icon == this.icon && other.siteLink == this.siteLink && other.authors == this.authors && other.tags == this.tags && other.lastFetched == this.lastFetched); } class FeedCompanion extends UpdateCompanion { final Value url; final Value title; final Value description; final Value icon; final Value siteLink; final Value?> authors; final Value?> tags; final Value lastFetched; final Value rowid; const FeedCompanion({ this.url = const Value.absent(), this.title = const Value.absent(), this.description = const Value.absent(), this.icon = const Value.absent(), this.siteLink = const Value.absent(), this.authors = const Value.absent(), this.tags = const Value.absent(), this.lastFetched = const Value.absent(), this.rowid = const Value.absent(), }); FeedCompanion.insert({ required Uri url, this.title = const Value.absent(), this.description = const Value.absent(), this.icon = const Value.absent(), this.siteLink = const Value.absent(), this.authors = const Value.absent(), this.tags = const Value.absent(), this.lastFetched = const Value.absent(), this.rowid = const Value.absent(), }) : url = Value(url); static Insertable custom({ Expression? url, Expression? title, Expression? description, Expression? icon, Expression? siteLink, Expression? authors, Expression? tags, Expression? lastFetched, Expression? rowid, }) { return RawValuesInsertable({ if (url != null) 'url': url, if (title != null) 'title': title, if (description != null) 'description': description, if (icon != null) 'icon': icon, if (siteLink != null) 'site_link': siteLink, if (authors != null) 'authors': authors, if (tags != null) 'tags': tags, if (lastFetched != null) 'last_fetched': lastFetched, if (rowid != null) 'rowid': rowid, }); } FeedCompanion copyWith({ Value? url, Value? title, Value? description, Value? icon, Value? siteLink, Value?>? authors, Value?>? tags, Value? lastFetched, Value? rowid, }) { return FeedCompanion( url: url ?? this.url, title: title ?? this.title, description: description ?? this.description, icon: icon ?? this.icon, siteLink: siteLink ?? this.siteLink, authors: authors ?? this.authors, tags: tags ?? this.tags, lastFetched: lastFetched ?? this.lastFetched, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (url.present) { map['url'] = Variable(Feed.$converterurl.toSql(url.value)); } if (title.present) { map['title'] = Variable(title.value); } if (description.present) { map['description'] = Variable(description.value); } if (icon.present) { map['icon'] = Variable(Feed.$convertericon.toSql(icon.value)); } if (siteLink.present) { map['site_link'] = Variable( Feed.$convertersiteLink.toSql(siteLink.value), ); } if (authors.present) { map['authors'] = Variable( Feed.$converterauthorsn.toSql(authors.value), ); } if (tags.present) { map['tags'] = Variable(Feed.$convertertagsn.toSql(tags.value)); } if (lastFetched.present) { map['last_fetched'] = Variable(lastFetched.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('FeedCompanion(') ..write('url: $url, ') ..write('title: $title, ') ..write('description: $description, ') ..write('icon: $icon, ') ..write('siteLink: $siteLink, ') ..write('authors: $authors, ') ..write('tags: $tags, ') ..write('lastFetched: $lastFetched, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class Article extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; Article(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumnWithTypeConverter feedId = GeneratedColumn( 'feed_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL REFERENCES feed(url)ON DELETE CASCADE', ).withConverter(Article.$converterfeedId); late final GeneratedColumn fetched = GeneratedColumn( 'fetched', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn created = GeneratedColumn( 'created', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn updated = GeneratedColumn( 'updated', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn lastRead = GeneratedColumn( 'last_read', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumnWithTypeConverter?, String> authors = GeneratedColumn( 'authors', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter?>(Article.$converterauthorsn); late final GeneratedColumnWithTypeConverter?, String> tags = GeneratedColumn( 'tags', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter?>(Article.$convertertagsn); late final GeneratedColumnWithTypeConverter?, String> links = GeneratedColumn( 'links', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ).withConverter?>(Article.$converterlinksn); late final GeneratedColumn summaryHtml = GeneratedColumn( 'summaryHtml', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn summaryMarkdown = GeneratedColumn( 'summaryMarkdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn summaryPlain = GeneratedColumn( 'summaryPlain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn contentHtml = GeneratedColumn( 'contentHtml', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn contentMarkdown = GeneratedColumn( 'contentMarkdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn contentPlain = GeneratedColumn( 'contentPlain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [ id, feedId, fetched, created, updated, lastRead, title, authors, tags, links, summaryHtml, summaryMarkdown, summaryPlain, contentHtml, contentMarkdown, contentPlain, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'article'; @override Set get $primaryKey => {id}; @override FeedArticle map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return FeedArticle( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, feedId: Article.$converterfeedId.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}feed_id'], )!, ), fetched: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}fetched'], )!, created: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}created'], ), updated: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}updated'], ), lastRead: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_read'], ), title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), authors: Article.$converterauthorsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}authors'], ), ), tags: Article.$convertertagsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tags'], ), ), links: Article.$converterlinksn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}links'], ), ), summaryHtml: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryHtml'], ), summaryMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryMarkdown'], ), summaryPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryPlain'], ), contentHtml: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentHtml'], ), contentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentMarkdown'], ), contentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentPlain'], ), ); } @override Article createAlias(String alias) { return Article(attachedDatabase, alias); } static TypeConverter $converterfeedId = const UriConverter(); static TypeConverter, String> $converterauthors = const FeedAuthorsConverter(); static TypeConverter?, String?> $converterauthorsn = NullAwareTypeConverter.wrap($converterauthors); static TypeConverter, String> $convertertags = const FeedCategoriesConverter(); static TypeConverter?, String?> $convertertagsn = NullAwareTypeConverter.wrap($convertertags); static TypeConverter, String> $converterlinks = const FeedLinksConverter(); static TypeConverter?, String?> $converterlinksn = NullAwareTypeConverter.wrap($converterlinks); @override bool get dontWriteConstraints => true; } class ArticleCompanion extends UpdateCompanion { final Value id; final Value feedId; final Value fetched; final Value created; final Value updated; final Value lastRead; final Value title; final Value?> authors; final Value?> tags; final Value?> links; final Value summaryHtml; final Value summaryMarkdown; final Value summaryPlain; final Value contentHtml; final Value contentMarkdown; final Value contentPlain; final Value rowid; const ArticleCompanion({ this.id = const Value.absent(), this.feedId = const Value.absent(), this.fetched = const Value.absent(), this.created = const Value.absent(), this.updated = const Value.absent(), this.lastRead = const Value.absent(), this.title = const Value.absent(), this.authors = const Value.absent(), this.tags = const Value.absent(), this.links = const Value.absent(), this.summaryHtml = const Value.absent(), this.summaryMarkdown = const Value.absent(), this.summaryPlain = const Value.absent(), this.contentHtml = const Value.absent(), this.contentMarkdown = const Value.absent(), this.contentPlain = const Value.absent(), this.rowid = const Value.absent(), }); ArticleCompanion.insert({ required String id, required Uri feedId, required DateTime fetched, this.created = const Value.absent(), this.updated = const Value.absent(), this.lastRead = const Value.absent(), this.title = const Value.absent(), this.authors = const Value.absent(), this.tags = const Value.absent(), this.links = const Value.absent(), this.summaryHtml = const Value.absent(), this.summaryMarkdown = const Value.absent(), this.summaryPlain = const Value.absent(), this.contentHtml = const Value.absent(), this.contentMarkdown = const Value.absent(), this.contentPlain = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), feedId = Value(feedId), fetched = Value(fetched); static Insertable custom({ Expression? id, Expression? feedId, Expression? fetched, Expression? created, Expression? updated, Expression? lastRead, Expression? title, Expression? authors, Expression? tags, Expression? links, Expression? summaryHtml, Expression? summaryMarkdown, Expression? summaryPlain, Expression? contentHtml, Expression? contentMarkdown, Expression? contentPlain, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (feedId != null) 'feed_id': feedId, if (fetched != null) 'fetched': fetched, if (created != null) 'created': created, if (updated != null) 'updated': updated, if (lastRead != null) 'last_read': lastRead, if (title != null) 'title': title, if (authors != null) 'authors': authors, if (tags != null) 'tags': tags, if (links != null) 'links': links, if (summaryHtml != null) 'summaryHtml': summaryHtml, if (summaryMarkdown != null) 'summaryMarkdown': summaryMarkdown, if (summaryPlain != null) 'summaryPlain': summaryPlain, if (contentHtml != null) 'contentHtml': contentHtml, if (contentMarkdown != null) 'contentMarkdown': contentMarkdown, if (contentPlain != null) 'contentPlain': contentPlain, if (rowid != null) 'rowid': rowid, }); } ArticleCompanion copyWith({ Value? id, Value? feedId, Value? fetched, Value? created, Value? updated, Value? lastRead, Value? title, Value?>? authors, Value?>? tags, Value?>? links, Value? summaryHtml, Value? summaryMarkdown, Value? summaryPlain, Value? contentHtml, Value? contentMarkdown, Value? contentPlain, Value? rowid, }) { return ArticleCompanion( id: id ?? this.id, feedId: feedId ?? this.feedId, fetched: fetched ?? this.fetched, created: created ?? this.created, updated: updated ?? this.updated, lastRead: lastRead ?? this.lastRead, title: title ?? this.title, authors: authors ?? this.authors, tags: tags ?? this.tags, links: links ?? this.links, summaryHtml: summaryHtml ?? this.summaryHtml, summaryMarkdown: summaryMarkdown ?? this.summaryMarkdown, summaryPlain: summaryPlain ?? this.summaryPlain, contentHtml: contentHtml ?? this.contentHtml, contentMarkdown: contentMarkdown ?? this.contentMarkdown, contentPlain: contentPlain ?? this.contentPlain, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (feedId.present) { map['feed_id'] = Variable( Article.$converterfeedId.toSql(feedId.value), ); } if (fetched.present) { map['fetched'] = Variable(fetched.value); } if (created.present) { map['created'] = Variable(created.value); } if (updated.present) { map['updated'] = Variable(updated.value); } if (lastRead.present) { map['last_read'] = Variable(lastRead.value); } if (title.present) { map['title'] = Variable(title.value); } if (authors.present) { map['authors'] = Variable( Article.$converterauthorsn.toSql(authors.value), ); } if (tags.present) { map['tags'] = Variable(Article.$convertertagsn.toSql(tags.value)); } if (links.present) { map['links'] = Variable( Article.$converterlinksn.toSql(links.value), ); } if (summaryHtml.present) { map['summaryHtml'] = Variable(summaryHtml.value); } if (summaryMarkdown.present) { map['summaryMarkdown'] = Variable(summaryMarkdown.value); } if (summaryPlain.present) { map['summaryPlain'] = Variable(summaryPlain.value); } if (contentHtml.present) { map['contentHtml'] = Variable(contentHtml.value); } if (contentMarkdown.present) { map['contentMarkdown'] = Variable(contentMarkdown.value); } if (contentPlain.present) { map['contentPlain'] = Variable(contentPlain.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ArticleCompanion(') ..write('id: $id, ') ..write('feedId: $feedId, ') ..write('fetched: $fetched, ') ..write('created: $created, ') ..write('updated: $updated, ') ..write('lastRead: $lastRead, ') ..write('title: $title, ') ..write('authors: $authors, ') ..write('tags: $tags, ') ..write('links: $links, ') ..write('summaryHtml: $summaryHtml, ') ..write('summaryMarkdown: $summaryMarkdown, ') ..write('summaryPlain: $summaryPlain, ') ..write('contentHtml: $contentHtml, ') ..write('contentMarkdown: $contentMarkdown, ') ..write('contentPlain: $contentPlain, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class ArticleView extends ViewInfo implements HasResultSet { final String? _alias; @override final _$FeedDatabase attachedDatabase; ArticleView(this.attachedDatabase, [this._alias]); @override List get $columns => [ id, feedId, fetched, created, updated, lastRead, title, authors, tags, links, summaryHtml, summaryMarkdown, summaryPlain, contentHtml, contentMarkdown, contentPlain, icon, siteLink, ]; @override String get aliasedName => _alias ?? entityName; @override String get entityName => 'article_view'; @override Map get createViewStatements => { SqlDialect.sqlite: 'CREATE VIEW article_view AS SELECT a.*, f.icon, f.site_link FROM article AS a INNER JOIN feed AS f ON f.url = a.feed_id', }; @override ArticleView get asDslTable => this; @override FeedArticle map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return FeedArticle( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, feedId: Article.$converterfeedId.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}feed_id'], )!, ), fetched: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}fetched'], )!, created: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}created'], ), updated: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}updated'], ), lastRead: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_read'], ), title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), authors: Article.$converterauthorsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}authors'], ), ), tags: Article.$convertertagsn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tags'], ), ), links: Article.$converterlinksn.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}links'], ), ), summaryHtml: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryHtml'], ), summaryMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryMarkdown'], ), summaryPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryPlain'], ), contentHtml: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentHtml'], ), contentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentMarkdown'], ), contentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentPlain'], ), icon: Feed.$convertericon.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}icon'], ), ), siteLink: Feed.$convertersiteLink.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}site_link'], ), ), ); } late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, ); late final GeneratedColumnWithTypeConverter feedId = GeneratedColumn( 'feed_id', aliasedName, false, type: DriftSqlType.string, ).withConverter(Article.$converterfeedId); late final GeneratedColumn fetched = GeneratedColumn( 'fetched', aliasedName, false, type: DriftSqlType.dateTime, ); late final GeneratedColumn created = GeneratedColumn( 'created', aliasedName, true, type: DriftSqlType.dateTime, ); late final GeneratedColumn updated = GeneratedColumn( 'updated', aliasedName, true, type: DriftSqlType.dateTime, ); late final GeneratedColumn lastRead = GeneratedColumn( 'last_read', aliasedName, true, type: DriftSqlType.dateTime, ); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumnWithTypeConverter?, String> authors = GeneratedColumn( 'authors', aliasedName, true, type: DriftSqlType.string, ).withConverter?>(Article.$converterauthorsn); late final GeneratedColumnWithTypeConverter?, String> tags = GeneratedColumn( 'tags', aliasedName, true, type: DriftSqlType.string, ).withConverter?>(Article.$convertertagsn); late final GeneratedColumnWithTypeConverter?, String> links = GeneratedColumn( 'links', aliasedName, true, type: DriftSqlType.string, ).withConverter?>(Article.$converterlinksn); late final GeneratedColumn summaryHtml = GeneratedColumn( 'summaryHtml', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumn summaryMarkdown = GeneratedColumn( 'summaryMarkdown', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumn summaryPlain = GeneratedColumn( 'summaryPlain', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumn contentHtml = GeneratedColumn( 'contentHtml', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumn contentMarkdown = GeneratedColumn( 'contentMarkdown', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumn contentPlain = GeneratedColumn( 'contentPlain', aliasedName, true, type: DriftSqlType.string, ); late final GeneratedColumnWithTypeConverter icon = GeneratedColumn( 'icon', aliasedName, true, type: DriftSqlType.string, ).withConverter(Feed.$convertericon); late final GeneratedColumnWithTypeConverter siteLink = GeneratedColumn( 'site_link', aliasedName, true, type: DriftSqlType.string, ).withConverter(Feed.$convertersiteLink); @override ArticleView createAlias(String alias) { return ArticleView(attachedDatabase, alias); } @override Query? get query => null; @override Set get readTables => const {'article', 'feed'}; } class ArticleFts extends Table with TableInfo, VirtualTableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; ArticleFts(this.attachedDatabase, [this._alias]); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); late final GeneratedColumn summaryPlain = GeneratedColumn( 'summaryPlain', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); late final GeneratedColumn contentPlain = GeneratedColumn( 'contentPlain', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); @override List get $columns => [title, summaryPlain, contentPlain]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'article_fts'; @override Set get $primaryKey => const {}; @override ArticleFt map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ArticleFt( title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, summaryPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}summaryPlain'], )!, contentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}contentPlain'], )!, ); } @override ArticleFts createAlias(String alias) { return ArticleFts(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; @override String get moduleAndArgs => 'fts5(title, summaryPlain, contentPlain, content=article, tokenize="trigram")'; } class ArticleFt extends DataClass implements Insertable { final String title; final String summaryPlain; final String contentPlain; const ArticleFt({ required this.title, required this.summaryPlain, required this.contentPlain, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['title'] = Variable(title); map['summaryPlain'] = Variable(summaryPlain); map['contentPlain'] = Variable(contentPlain); return map; } factory ArticleFt.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ArticleFt( title: serializer.fromJson(json['title']), summaryPlain: serializer.fromJson(json['summaryPlain']), contentPlain: serializer.fromJson(json['contentPlain']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'title': serializer.toJson(title), 'summaryPlain': serializer.toJson(summaryPlain), 'contentPlain': serializer.toJson(contentPlain), }; } ArticleFt copyWith({ String? title, String? summaryPlain, String? contentPlain, }) => ArticleFt( title: title ?? this.title, summaryPlain: summaryPlain ?? this.summaryPlain, contentPlain: contentPlain ?? this.contentPlain, ); ArticleFt copyWithCompanion(ArticleFtsCompanion data) { return ArticleFt( title: data.title.present ? data.title.value : this.title, summaryPlain: data.summaryPlain.present ? data.summaryPlain.value : this.summaryPlain, contentPlain: data.contentPlain.present ? data.contentPlain.value : this.contentPlain, ); } @override String toString() { return (StringBuffer('ArticleFt(') ..write('title: $title, ') ..write('summaryPlain: $summaryPlain, ') ..write('contentPlain: $contentPlain') ..write(')')) .toString(); } @override int get hashCode => Object.hash(title, summaryPlain, contentPlain); @override bool operator ==(Object other) => identical(this, other) || (other is ArticleFt && other.title == this.title && other.summaryPlain == this.summaryPlain && other.contentPlain == this.contentPlain); } class ArticleFtsCompanion extends UpdateCompanion { final Value title; final Value summaryPlain; final Value contentPlain; final Value rowid; const ArticleFtsCompanion({ this.title = const Value.absent(), this.summaryPlain = const Value.absent(), this.contentPlain = const Value.absent(), this.rowid = const Value.absent(), }); ArticleFtsCompanion.insert({ required String title, required String summaryPlain, required String contentPlain, this.rowid = const Value.absent(), }) : title = Value(title), summaryPlain = Value(summaryPlain), contentPlain = Value(contentPlain); static Insertable custom({ Expression? title, Expression? summaryPlain, Expression? contentPlain, Expression? rowid, }) { return RawValuesInsertable({ if (title != null) 'title': title, if (summaryPlain != null) 'summaryPlain': summaryPlain, if (contentPlain != null) 'contentPlain': contentPlain, if (rowid != null) 'rowid': rowid, }); } ArticleFtsCompanion copyWith({ Value? title, Value? summaryPlain, Value? contentPlain, Value? rowid, }) { return ArticleFtsCompanion( title: title ?? this.title, summaryPlain: summaryPlain ?? this.summaryPlain, contentPlain: contentPlain ?? this.contentPlain, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (title.present) { map['title'] = Variable(title.value); } if (summaryPlain.present) { map['summaryPlain'] = Variable(summaryPlain.value); } if (contentPlain.present) { map['contentPlain'] = Variable(contentPlain.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ArticleFtsCompanion(') ..write('title: $title, ') ..write('summaryPlain: $summaryPlain, ') ..write('contentPlain: $contentPlain, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } abstract class _$FeedDatabase extends GeneratedDatabase { _$FeedDatabase(QueryExecutor e) : super(e); $FeedDatabaseManager get managers => $FeedDatabaseManager(this); late final Feed feed = Feed(this); late final Article article = Article(this); late final ArticleView articleView = ArticleView(this); late final Index articleFeedId = Index( 'article_feed_id', 'CREATE INDEX article_feed_id ON article (feed_id)', ); late final ArticleFts articleFts = ArticleFts(this); late final Trigger articleAfterInsert = Trigger( 'CREATE TRIGGER article_after_insert AFTER INSERT ON article BEGIN INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', 'article_after_insert', ); late final Trigger articleAfterDelete = Trigger( 'CREATE TRIGGER article_after_delete AFTER DELETE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);END', 'article_after_delete', ); late final Trigger articleAfterUpdate = Trigger( 'CREATE TRIGGER article_after_update AFTER UPDATE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', 'article_after_update', ); late final ArticleDao articleDao = ArticleDao(this as FeedDatabase); late final FeedDao feedDao = FeedDao(this as FeedDatabase); Future optimizeFtsIndex() { return customInsert( 'INSERT INTO article_fts (article_fts) VALUES (\'optimize\')', variables: [], updates: {articleFts}, ); } Selectable queryArticlesBasic({ required String query, String? feedId, }) { return customSelect( 'WITH weights AS (SELECT 1.0 AS title_weight) SELECT a.*, f.icon,(bm25(article_fts, weights.title_weight))AS weighted_rank FROM article_fts AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE fts.title LIKE ?1 AND(?2 IS NULL OR a.feed_id = ?2)ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', variables: [Variable(query), Variable(feedId)], readsFrom: {feed, articleFts, article}, ).map( (QueryRow row) => FeedArticleQueryResult( id: row.read('id'), feedId: Article.$converterfeedId.fromSql(row.read('feed_id')), fetched: row.read('fetched'), weightedRank: row.read('weighted_rank'), created: row.readNullable('created'), updated: row.readNullable('updated'), lastRead: row.readNullable('last_read'), title: row.readNullable('title'), authors: NullAwareTypeConverter.wrapFromSql( Article.$converterauthors, row.readNullable('authors'), ), tags: NullAwareTypeConverter.wrapFromSql( Article.$convertertags, row.readNullable('tags'), ), links: NullAwareTypeConverter.wrapFromSql( Article.$converterlinks, row.readNullable('links'), ), summaryHtml: row.readNullable('summaryHtml'), summaryMarkdown: row.readNullable('summaryMarkdown'), summaryPlain: row.readNullable('summaryPlain'), contentHtml: row.readNullable('contentHtml'), contentMarkdown: row.readNullable('contentMarkdown'), contentPlain: row.readNullable('contentPlain'), icon: Feed.$convertericon.fromSql(row.readNullable('icon')), ), ); } Selectable queryArticlesFullContent({ required String beforeMatch, required String afterMatch, required String ellipsis, required int snippetLength, required String query, String? feedId, }) { return customSelect( 'WITH weights AS (SELECT 10.0 AS title_weight, 3.0 AS summary_weight, 1.0 AS content_weight) SELECT a.*, f.icon, highlight(article_fts, 0, ?1, ?2) AS title_highlight, snippet(article_fts, 1, ?1, ?2, ?3, ?4) AS summary_snippet, snippet(article_fts, 2, ?1, ?2, ?3, ?4) AS content_snippet,(bm25(article_fts, weights.title_weight, weights.summary_weight, weights.content_weight))AS weighted_rank FROM article_fts(?5)AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE ?6 IS NULL OR a.feed_id = ?6 ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', variables: [ Variable(beforeMatch), Variable(afterMatch), Variable(ellipsis), Variable(snippetLength), Variable(query), Variable(feedId), ], readsFrom: {feed, articleFts, article}, ).map( (QueryRow row) => FeedArticleQueryResult( id: row.read('id'), feedId: Article.$converterfeedId.fromSql(row.read('feed_id')), fetched: row.read('fetched'), weightedRank: row.read('weighted_rank'), created: row.readNullable('created'), updated: row.readNullable('updated'), lastRead: row.readNullable('last_read'), title: row.readNullable('title'), authors: NullAwareTypeConverter.wrapFromSql( Article.$converterauthors, row.readNullable('authors'), ), tags: NullAwareTypeConverter.wrapFromSql( Article.$convertertags, row.readNullable('tags'), ), links: NullAwareTypeConverter.wrapFromSql( Article.$converterlinks, row.readNullable('links'), ), summaryHtml: row.readNullable('summaryHtml'), summaryMarkdown: row.readNullable('summaryMarkdown'), summaryPlain: row.readNullable('summaryPlain'), contentHtml: row.readNullable('contentHtml'), contentMarkdown: row.readNullable('contentMarkdown'), contentPlain: row.readNullable('contentPlain'), icon: Feed.$convertericon.fromSql(row.readNullable('icon')), titleHighlight: row.readNullable('title_highlight'), summarySnippet: row.readNullable('summary_snippet'), contentSnippet: row.readNullable('content_snippet'), ), ); } @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ feed, article, articleView, articleFeedId, articleFts, articleAfterInsert, articleAfterDelete, articleAfterUpdate, ]; @override StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ WritePropagation( on: TableUpdateQuery.onTableName( 'feed', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('article', kind: UpdateKind.delete)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'article', limitUpdateKind: UpdateKind.insert, ), result: [TableUpdate('article_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'article', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('article_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'article', limitUpdateKind: UpdateKind.update, ), result: [TableUpdate('article_fts', kind: UpdateKind.insert)], ), ]); } typedef $FeedCreateCompanionBuilder = FeedCompanion Function({ required Uri url, Value title, Value description, Value icon, Value siteLink, Value?> authors, Value?> tags, Value lastFetched, Value rowid, }); typedef $FeedUpdateCompanionBuilder = FeedCompanion Function({ Value url, Value title, Value description, Value icon, Value siteLink, Value?> authors, Value?> tags, Value lastFetched, Value rowid, }); final class $FeedReferences extends BaseReferences<_$FeedDatabase, Feed, FeedData> { $FeedReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey> _articleRefsTable( _$FeedDatabase db, ) => MultiTypedResultKey.fromTable( db.article, aliasName: $_aliasNameGenerator(db.feed.url, db.article.feedId), ); $ArticleProcessedTableManager get articleRefs { final manager = $ArticleTableManager( $_db, $_db.article, ).filter((f) => f.feedId.url.sqlEquals($_itemColumn('url')!)); final cache = $_typedResult.readTableOrNull(_articleRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $FeedFilterComposer extends Composer<_$FeedDatabase, Feed> { $FeedFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnWithTypeConverterFilters get url => $composableBuilder( column: $table.url, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get description => $composableBuilder( column: $table.description, builder: (column) => ColumnFilters(column), ); ColumnWithTypeConverterFilters get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnWithTypeConverterFilters get siteLink => $composableBuilder( column: $table.siteLink, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnWithTypeConverterFilters?, List, String> get authors => $composableBuilder( column: $table.authors, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnWithTypeConverterFilters< List?, List, String > get tags => $composableBuilder( column: $table.tags, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnFilters get lastFetched => $composableBuilder( column: $table.lastFetched, builder: (column) => ColumnFilters(column), ); Expression articleRefs( Expression Function($ArticleFilterComposer f) f, ) { final $ArticleFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.url, referencedTable: $db.article, getReferencedColumn: (t) => t.feedId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $ArticleFilterComposer( $db: $db, $table: $db.article, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $FeedOrderingComposer extends Composer<_$FeedDatabase, Feed> { $FeedOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get url => $composableBuilder( column: $table.url, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get description => $composableBuilder( column: $table.description, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get siteLink => $composableBuilder( column: $table.siteLink, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get authors => $composableBuilder( column: $table.authors, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get tags => $composableBuilder( column: $table.tags, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get lastFetched => $composableBuilder( column: $table.lastFetched, builder: (column) => ColumnOrderings(column), ); } class $FeedAnnotationComposer extends Composer<_$FeedDatabase, Feed> { $FeedAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumnWithTypeConverter get url => $composableBuilder(column: $table.url, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get description => $composableBuilder( column: $table.description, builder: (column) => column, ); GeneratedColumnWithTypeConverter get icon => $composableBuilder(column: $table.icon, builder: (column) => column); GeneratedColumnWithTypeConverter get siteLink => $composableBuilder(column: $table.siteLink, builder: (column) => column); GeneratedColumnWithTypeConverter?, String> get authors => $composableBuilder(column: $table.authors, builder: (column) => column); GeneratedColumnWithTypeConverter?, String> get tags => $composableBuilder(column: $table.tags, builder: (column) => column); GeneratedColumn get lastFetched => $composableBuilder( column: $table.lastFetched, builder: (column) => column, ); Expression articleRefs( Expression Function($ArticleAnnotationComposer a) f, ) { final $ArticleAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.url, referencedTable: $db.article, getReferencedColumn: (t) => t.feedId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $ArticleAnnotationComposer( $db: $db, $table: $db.article, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $FeedTableManager extends RootTableManager< _$FeedDatabase, Feed, FeedData, $FeedFilterComposer, $FeedOrderingComposer, $FeedAnnotationComposer, $FeedCreateCompanionBuilder, $FeedUpdateCompanionBuilder, (FeedData, $FeedReferences), FeedData, PrefetchHooks Function({bool articleRefs}) > { $FeedTableManager(_$FeedDatabase db, Feed table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $FeedFilterComposer($db: db, $table: table), createOrderingComposer: () => $FeedOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $FeedAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value url = const Value.absent(), Value title = const Value.absent(), Value description = const Value.absent(), Value icon = const Value.absent(), Value siteLink = const Value.absent(), Value?> authors = const Value.absent(), Value?> tags = const Value.absent(), Value lastFetched = const Value.absent(), Value rowid = const Value.absent(), }) => FeedCompanion( url: url, title: title, description: description, icon: icon, siteLink: siteLink, authors: authors, tags: tags, lastFetched: lastFetched, rowid: rowid, ), createCompanionCallback: ({ required Uri url, Value title = const Value.absent(), Value description = const Value.absent(), Value icon = const Value.absent(), Value siteLink = const Value.absent(), Value?> authors = const Value.absent(), Value?> tags = const Value.absent(), Value lastFetched = const Value.absent(), Value rowid = const Value.absent(), }) => FeedCompanion.insert( url: url, title: title, description: description, icon: icon, siteLink: siteLink, authors: authors, tags: tags, lastFetched: lastFetched, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $FeedReferences(db, table, e))) .toList(), prefetchHooksCallback: ({articleRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (articleRefs) db.article], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (articleRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $FeedReferences._articleRefsTable(db), managerFromTypedResult: (p0) => $FeedReferences(db, table, p0).articleRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.feedId == item.url), typedResults: items, ), ]; }, ); }, ), ); } typedef $FeedProcessedTableManager = ProcessedTableManager< _$FeedDatabase, Feed, FeedData, $FeedFilterComposer, $FeedOrderingComposer, $FeedAnnotationComposer, $FeedCreateCompanionBuilder, $FeedUpdateCompanionBuilder, (FeedData, $FeedReferences), FeedData, PrefetchHooks Function({bool articleRefs}) >; typedef $ArticleCreateCompanionBuilder = ArticleCompanion Function({ required String id, required Uri feedId, required DateTime fetched, Value created, Value updated, Value lastRead, Value title, Value?> authors, Value?> tags, Value?> links, Value summaryHtml, Value summaryMarkdown, Value summaryPlain, Value contentHtml, Value contentMarkdown, Value contentPlain, Value rowid, }); typedef $ArticleUpdateCompanionBuilder = ArticleCompanion Function({ Value id, Value feedId, Value fetched, Value created, Value updated, Value lastRead, Value title, Value?> authors, Value?> tags, Value?> links, Value summaryHtml, Value summaryMarkdown, Value summaryPlain, Value contentHtml, Value contentMarkdown, Value contentPlain, Value rowid, }); final class $ArticleReferences extends BaseReferences<_$FeedDatabase, Article, FeedArticle> { $ArticleReferences(super.$_db, super.$_table, super.$_typedResult); static Feed _feedIdTable(_$FeedDatabase db) => db.feed.createAlias($_aliasNameGenerator(db.article.feedId, db.feed.url)); $FeedProcessedTableManager get feedId { final $_column = $_itemColumn('feed_id')!; final manager = $FeedTableManager( $_db, $_db.feed, ).filter((f) => f.url.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_feedIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $ArticleFilterComposer extends Composer<_$FeedDatabase, Article> { $ArticleFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get fetched => $composableBuilder( column: $table.fetched, builder: (column) => ColumnFilters(column), ); ColumnFilters get created => $composableBuilder( column: $table.created, builder: (column) => ColumnFilters(column), ); ColumnFilters get updated => $composableBuilder( column: $table.updated, builder: (column) => ColumnFilters(column), ); ColumnFilters get lastRead => $composableBuilder( column: $table.lastRead, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnWithTypeConverterFilters?, List, String> get authors => $composableBuilder( column: $table.authors, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnWithTypeConverterFilters< List?, List, String > get tags => $composableBuilder( column: $table.tags, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnWithTypeConverterFilters?, List, String> get links => $composableBuilder( column: $table.links, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnFilters get summaryHtml => $composableBuilder( column: $table.summaryHtml, builder: (column) => ColumnFilters(column), ); ColumnFilters get summaryMarkdown => $composableBuilder( column: $table.summaryMarkdown, builder: (column) => ColumnFilters(column), ); ColumnFilters get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => ColumnFilters(column), ); ColumnFilters get contentHtml => $composableBuilder( column: $table.contentHtml, builder: (column) => ColumnFilters(column), ); ColumnFilters get contentMarkdown => $composableBuilder( column: $table.contentMarkdown, builder: (column) => ColumnFilters(column), ); ColumnFilters get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => ColumnFilters(column), ); $FeedFilterComposer get feedId { final $FeedFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.feedId, referencedTable: $db.feed, getReferencedColumn: (t) => t.url, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $FeedFilterComposer( $db: $db, $table: $db.feed, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $ArticleOrderingComposer extends Composer<_$FeedDatabase, Article> { $ArticleOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get fetched => $composableBuilder( column: $table.fetched, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get created => $composableBuilder( column: $table.created, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get updated => $composableBuilder( column: $table.updated, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get lastRead => $composableBuilder( column: $table.lastRead, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get authors => $composableBuilder( column: $table.authors, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get tags => $composableBuilder( column: $table.tags, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get links => $composableBuilder( column: $table.links, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get summaryHtml => $composableBuilder( column: $table.summaryHtml, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get summaryMarkdown => $composableBuilder( column: $table.summaryMarkdown, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contentHtml => $composableBuilder( column: $table.contentHtml, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contentMarkdown => $composableBuilder( column: $table.contentMarkdown, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => ColumnOrderings(column), ); $FeedOrderingComposer get feedId { final $FeedOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.feedId, referencedTable: $db.feed, getReferencedColumn: (t) => t.url, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $FeedOrderingComposer( $db: $db, $table: $db.feed, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $ArticleAnnotationComposer extends Composer<_$FeedDatabase, Article> { $ArticleAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get fetched => $composableBuilder(column: $table.fetched, builder: (column) => column); GeneratedColumn get created => $composableBuilder(column: $table.created, builder: (column) => column); GeneratedColumn get updated => $composableBuilder(column: $table.updated, builder: (column) => column); GeneratedColumn get lastRead => $composableBuilder(column: $table.lastRead, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumnWithTypeConverter?, String> get authors => $composableBuilder(column: $table.authors, builder: (column) => column); GeneratedColumnWithTypeConverter?, String> get tags => $composableBuilder(column: $table.tags, builder: (column) => column); GeneratedColumnWithTypeConverter?, String> get links => $composableBuilder(column: $table.links, builder: (column) => column); GeneratedColumn get summaryHtml => $composableBuilder( column: $table.summaryHtml, builder: (column) => column, ); GeneratedColumn get summaryMarkdown => $composableBuilder( column: $table.summaryMarkdown, builder: (column) => column, ); GeneratedColumn get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => column, ); GeneratedColumn get contentHtml => $composableBuilder( column: $table.contentHtml, builder: (column) => column, ); GeneratedColumn get contentMarkdown => $composableBuilder( column: $table.contentMarkdown, builder: (column) => column, ); GeneratedColumn get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => column, ); $FeedAnnotationComposer get feedId { final $FeedAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.feedId, referencedTable: $db.feed, getReferencedColumn: (t) => t.url, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $FeedAnnotationComposer( $db: $db, $table: $db.feed, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $ArticleTableManager extends RootTableManager< _$FeedDatabase, Article, FeedArticle, $ArticleFilterComposer, $ArticleOrderingComposer, $ArticleAnnotationComposer, $ArticleCreateCompanionBuilder, $ArticleUpdateCompanionBuilder, (FeedArticle, $ArticleReferences), FeedArticle, PrefetchHooks Function({bool feedId}) > { $ArticleTableManager(_$FeedDatabase db, Article table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $ArticleFilterComposer($db: db, $table: table), createOrderingComposer: () => $ArticleOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $ArticleAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value feedId = const Value.absent(), Value fetched = const Value.absent(), Value created = const Value.absent(), Value updated = const Value.absent(), Value lastRead = const Value.absent(), Value title = const Value.absent(), Value?> authors = const Value.absent(), Value?> tags = const Value.absent(), Value?> links = const Value.absent(), Value summaryHtml = const Value.absent(), Value summaryMarkdown = const Value.absent(), Value summaryPlain = const Value.absent(), Value contentHtml = const Value.absent(), Value contentMarkdown = const Value.absent(), Value contentPlain = const Value.absent(), Value rowid = const Value.absent(), }) => ArticleCompanion( id: id, feedId: feedId, fetched: fetched, created: created, updated: updated, lastRead: lastRead, title: title, authors: authors, tags: tags, links: links, summaryHtml: summaryHtml, summaryMarkdown: summaryMarkdown, summaryPlain: summaryPlain, contentHtml: contentHtml, contentMarkdown: contentMarkdown, contentPlain: contentPlain, rowid: rowid, ), createCompanionCallback: ({ required String id, required Uri feedId, required DateTime fetched, Value created = const Value.absent(), Value updated = const Value.absent(), Value lastRead = const Value.absent(), Value title = const Value.absent(), Value?> authors = const Value.absent(), Value?> tags = const Value.absent(), Value?> links = const Value.absent(), Value summaryHtml = const Value.absent(), Value summaryMarkdown = const Value.absent(), Value summaryPlain = const Value.absent(), Value contentHtml = const Value.absent(), Value contentMarkdown = const Value.absent(), Value contentPlain = const Value.absent(), Value rowid = const Value.absent(), }) => ArticleCompanion.insert( id: id, feedId: feedId, fetched: fetched, created: created, updated: updated, lastRead: lastRead, title: title, authors: authors, tags: tags, links: links, summaryHtml: summaryHtml, summaryMarkdown: summaryMarkdown, summaryPlain: summaryPlain, contentHtml: contentHtml, contentMarkdown: contentMarkdown, contentPlain: contentPlain, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => (e.readTable(table), $ArticleReferences(db, table, e)), ) .toList(), prefetchHooksCallback: ({feedId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (feedId) { state = state.withJoin( currentTable: table, currentColumn: table.feedId, referencedTable: $ArticleReferences ._feedIdTable(db), referencedColumn: $ArticleReferences ._feedIdTable(db) .url, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $ArticleProcessedTableManager = ProcessedTableManager< _$FeedDatabase, Article, FeedArticle, $ArticleFilterComposer, $ArticleOrderingComposer, $ArticleAnnotationComposer, $ArticleCreateCompanionBuilder, $ArticleUpdateCompanionBuilder, (FeedArticle, $ArticleReferences), FeedArticle, PrefetchHooks Function({bool feedId}) >; typedef $ArticleFtsCreateCompanionBuilder = ArticleFtsCompanion Function({ required String title, required String summaryPlain, required String contentPlain, Value rowid, }); typedef $ArticleFtsUpdateCompanionBuilder = ArticleFtsCompanion Function({ Value title, Value summaryPlain, Value contentPlain, Value rowid, }); class $ArticleFtsFilterComposer extends Composer<_$FeedDatabase, ArticleFts> { $ArticleFtsFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => ColumnFilters(column), ); ColumnFilters get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => ColumnFilters(column), ); } class $ArticleFtsOrderingComposer extends Composer<_$FeedDatabase, ArticleFts> { $ArticleFtsOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => ColumnOrderings(column), ); } class $ArticleFtsAnnotationComposer extends Composer<_$FeedDatabase, ArticleFts> { $ArticleFtsAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get summaryPlain => $composableBuilder( column: $table.summaryPlain, builder: (column) => column, ); GeneratedColumn get contentPlain => $composableBuilder( column: $table.contentPlain, builder: (column) => column, ); } class $ArticleFtsTableManager extends RootTableManager< _$FeedDatabase, ArticleFts, ArticleFt, $ArticleFtsFilterComposer, $ArticleFtsOrderingComposer, $ArticleFtsAnnotationComposer, $ArticleFtsCreateCompanionBuilder, $ArticleFtsUpdateCompanionBuilder, (ArticleFt, BaseReferences<_$FeedDatabase, ArticleFts, ArticleFt>), ArticleFt, PrefetchHooks Function() > { $ArticleFtsTableManager(_$FeedDatabase db, ArticleFts table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $ArticleFtsFilterComposer($db: db, $table: table), createOrderingComposer: () => $ArticleFtsOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $ArticleFtsAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value title = const Value.absent(), Value summaryPlain = const Value.absent(), Value contentPlain = const Value.absent(), Value rowid = const Value.absent(), }) => ArticleFtsCompanion( title: title, summaryPlain: summaryPlain, contentPlain: contentPlain, rowid: rowid, ), createCompanionCallback: ({ required String title, required String summaryPlain, required String contentPlain, Value rowid = const Value.absent(), }) => ArticleFtsCompanion.insert( title: title, summaryPlain: summaryPlain, contentPlain: contentPlain, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $ArticleFtsProcessedTableManager = ProcessedTableManager< _$FeedDatabase, ArticleFts, ArticleFt, $ArticleFtsFilterComposer, $ArticleFtsOrderingComposer, $ArticleFtsAnnotationComposer, $ArticleFtsCreateCompanionBuilder, $ArticleFtsUpdateCompanionBuilder, (ArticleFt, BaseReferences<_$FeedDatabase, ArticleFts, ArticleFt>), ArticleFt, PrefetchHooks Function() >; class $FeedDatabaseManager { final _$FeedDatabase _db; $FeedDatabaseManager(this._db); $FeedTableManager get feed => $FeedTableManager(_db, _db.feed); $ArticleTableManager get article => $ArticleTableManager(_db, _db.article); $ArticleFtsTableManager get articleFts => $ArticleFtsTableManager(_db, _db.articleFts); }