// dart format width=80 // ignore_for_file: type=lint import 'package:drift/drift.dart' as i0; import 'package:weblibre/features/quotes/data/database/definitions.drift.dart' as i1; typedef $QuotesCreateCompanionBuilder = i1.QuotesCompanion Function({ required String author, required String quote, i0.Value source, i0.Value tags, i0.Value rowid, }); typedef $QuotesUpdateCompanionBuilder = i1.QuotesCompanion Function({ i0.Value author, i0.Value quote, i0.Value source, i0.Value tags, i0.Value rowid, }); class $QuotesFilterComposer extends i0.Composer { $QuotesFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); i0.ColumnFilters get author => $composableBuilder( column: $table.author, builder: (column) => i0.ColumnFilters(column), ); i0.ColumnFilters get quote => $composableBuilder( column: $table.quote, builder: (column) => i0.ColumnFilters(column), ); i0.ColumnFilters get source => $composableBuilder( column: $table.source, builder: (column) => i0.ColumnFilters(column), ); i0.ColumnFilters get tags => $composableBuilder( column: $table.tags, builder: (column) => i0.ColumnFilters(column), ); } class $QuotesOrderingComposer extends i0.Composer { $QuotesOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); i0.ColumnOrderings get author => $composableBuilder( column: $table.author, builder: (column) => i0.ColumnOrderings(column), ); i0.ColumnOrderings get quote => $composableBuilder( column: $table.quote, builder: (column) => i0.ColumnOrderings(column), ); i0.ColumnOrderings get source => $composableBuilder( column: $table.source, builder: (column) => i0.ColumnOrderings(column), ); i0.ColumnOrderings get tags => $composableBuilder( column: $table.tags, builder: (column) => i0.ColumnOrderings(column), ); } class $QuotesAnnotationComposer extends i0.Composer { $QuotesAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); i0.GeneratedColumn get author => $composableBuilder(column: $table.author, builder: (column) => column); i0.GeneratedColumn get quote => $composableBuilder(column: $table.quote, builder: (column) => column); i0.GeneratedColumn get source => $composableBuilder(column: $table.source, builder: (column) => column); i0.GeneratedColumn get tags => $composableBuilder(column: $table.tags, builder: (column) => column); } class $QuotesTableManager extends i0.RootTableManager< i0.GeneratedDatabase, i1.Quotes, i1.Quote, i1.$QuotesFilterComposer, i1.$QuotesOrderingComposer, i1.$QuotesAnnotationComposer, $QuotesCreateCompanionBuilder, $QuotesUpdateCompanionBuilder, ( i1.Quote, i0.BaseReferences, ), i1.Quote, i0.PrefetchHooks Function() > { $QuotesTableManager(i0.GeneratedDatabase db, i1.Quotes table) : super( i0.TableManagerState( db: db, table: table, createFilteringComposer: () => i1.$QuotesFilterComposer($db: db, $table: table), createOrderingComposer: () => i1.$QuotesOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => i1.$QuotesAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ i0.Value author = const i0.Value.absent(), i0.Value quote = const i0.Value.absent(), i0.Value source = const i0.Value.absent(), i0.Value tags = const i0.Value.absent(), i0.Value rowid = const i0.Value.absent(), }) => i1.QuotesCompanion( author: author, quote: quote, source: source, tags: tags, rowid: rowid, ), createCompanionCallback: ({ required String author, required String quote, i0.Value source = const i0.Value.absent(), i0.Value tags = const i0.Value.absent(), i0.Value rowid = const i0.Value.absent(), }) => i1.QuotesCompanion.insert( author: author, quote: quote, source: source, tags: tags, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $QuotesProcessedTableManager = i0.ProcessedTableManager< i0.GeneratedDatabase, i1.Quotes, i1.Quote, i1.$QuotesFilterComposer, i1.$QuotesOrderingComposer, i1.$QuotesAnnotationComposer, $QuotesCreateCompanionBuilder, $QuotesUpdateCompanionBuilder, (i1.Quote, i0.BaseReferences), i1.Quote, i0.PrefetchHooks Function() >; class Quotes extends i0.Table with i0.TableInfo { @override final i0.GeneratedDatabase attachedDatabase; final String? _alias; Quotes(this.attachedDatabase, [this._alias]); late final i0.GeneratedColumn author = i0.GeneratedColumn( 'author', aliasedName, false, type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final i0.GeneratedColumn quote = i0.GeneratedColumn( 'quote', aliasedName, false, type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final i0.GeneratedColumn source = i0.GeneratedColumn( 'source', aliasedName, true, type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final i0.GeneratedColumn tags = i0.GeneratedColumn( 'tags', aliasedName, true, type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [author, quote, source, tags]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'quotes'; @override Set get $primaryKey => const {}; @override i1.Quote map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return i1.Quote( author: attachedDatabase.typeMapping.read( i0.DriftSqlType.string, data['${effectivePrefix}author'], )!, quote: attachedDatabase.typeMapping.read( i0.DriftSqlType.string, data['${effectivePrefix}quote'], )!, source: attachedDatabase.typeMapping.read( i0.DriftSqlType.string, data['${effectivePrefix}source'], ), tags: attachedDatabase.typeMapping.read( i0.DriftSqlType.string, data['${effectivePrefix}tags'], ), ); } @override Quotes createAlias(String alias) { return Quotes(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class Quote extends i0.DataClass implements i0.Insertable { final String author; final String quote; final String? source; final String? tags; const Quote({ required this.author, required this.quote, this.source, this.tags, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['author'] = i0.Variable(author); map['quote'] = i0.Variable(quote); if (!nullToAbsent || source != null) { map['source'] = i0.Variable(source); } if (!nullToAbsent || tags != null) { map['tags'] = i0.Variable(tags); } return map; } factory Quote.fromJson( Map json, { i0.ValueSerializer? serializer, }) { serializer ??= i0.driftRuntimeOptions.defaultSerializer; return Quote( author: serializer.fromJson(json['author']), quote: serializer.fromJson(json['quote']), source: serializer.fromJson(json['source']), tags: serializer.fromJson(json['tags']), ); } @override Map toJson({i0.ValueSerializer? serializer}) { serializer ??= i0.driftRuntimeOptions.defaultSerializer; return { 'author': serializer.toJson(author), 'quote': serializer.toJson(quote), 'source': serializer.toJson(source), 'tags': serializer.toJson(tags), }; } i1.Quote copyWith({ String? author, String? quote, i0.Value source = const i0.Value.absent(), i0.Value tags = const i0.Value.absent(), }) => i1.Quote( author: author ?? this.author, quote: quote ?? this.quote, source: source.present ? source.value : this.source, tags: tags.present ? tags.value : this.tags, ); Quote copyWithCompanion(i1.QuotesCompanion data) { return Quote( author: data.author.present ? data.author.value : this.author, quote: data.quote.present ? data.quote.value : this.quote, source: data.source.present ? data.source.value : this.source, tags: data.tags.present ? data.tags.value : this.tags, ); } @override String toString() { return (StringBuffer('Quote(') ..write('author: $author, ') ..write('quote: $quote, ') ..write('source: $source, ') ..write('tags: $tags') ..write(')')) .toString(); } @override int get hashCode => Object.hash(author, quote, source, tags); @override bool operator ==(Object other) => identical(this, other) || (other is i1.Quote && other.author == this.author && other.quote == this.quote && other.source == this.source && other.tags == this.tags); } class QuotesCompanion extends i0.UpdateCompanion { final i0.Value author; final i0.Value quote; final i0.Value source; final i0.Value tags; final i0.Value rowid; const QuotesCompanion({ this.author = const i0.Value.absent(), this.quote = const i0.Value.absent(), this.source = const i0.Value.absent(), this.tags = const i0.Value.absent(), this.rowid = const i0.Value.absent(), }); QuotesCompanion.insert({ required String author, required String quote, this.source = const i0.Value.absent(), this.tags = const i0.Value.absent(), this.rowid = const i0.Value.absent(), }) : author = i0.Value(author), quote = i0.Value(quote); static i0.Insertable custom({ i0.Expression? author, i0.Expression? quote, i0.Expression? source, i0.Expression? tags, i0.Expression? rowid, }) { return i0.RawValuesInsertable({ if (author != null) 'author': author, if (quote != null) 'quote': quote, if (source != null) 'source': source, if (tags != null) 'tags': tags, if (rowid != null) 'rowid': rowid, }); } i1.QuotesCompanion copyWith({ i0.Value? author, i0.Value? quote, i0.Value? source, i0.Value? tags, i0.Value? rowid, }) { return i1.QuotesCompanion( author: author ?? this.author, quote: quote ?? this.quote, source: source ?? this.source, tags: tags ?? this.tags, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (author.present) { map['author'] = i0.Variable(author.value); } if (quote.present) { map['quote'] = i0.Variable(quote.value); } if (source.present) { map['source'] = i0.Variable(source.value); } if (tags.present) { map['tags'] = i0.Variable(tags.value); } if (rowid.present) { map['rowid'] = i0.Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('QuotesCompanion(') ..write('author: $author, ') ..write('quote: $quote, ') ..write('source: $source, ') ..write('tags: $tags, ') ..write('rowid: $rowid') ..write(')')) .toString(); } }