// GENERATED CODE - DO NOT MODIFY BY HAND part of 'app_database.dart'; // ignore_for_file: type=lint class $ProtocolsTable extends Protocols with TableInfo<$ProtocolsTable, Protocol> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ProtocolsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _categoryMeta = const VerificationMeta( 'category', ); @override late final GeneratedColumn category = GeneratedColumn( 'category', aliasedName, false, check: () => const CustomExpression( "category IN ('health','meditation','motivation','habit','learning','diet')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleEnMeta = const VerificationMeta( 'titleEn', ); @override late final GeneratedColumn titleEn = GeneratedColumn( 'title_en', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _whatMeta = const VerificationMeta('what'); @override late final GeneratedColumn what = GeneratedColumn( 'what', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _whenTextMeta = const VerificationMeta( 'whenText', ); @override late final GeneratedColumn whenText = GeneratedColumn( 'when_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _doseMeta = const VerificationMeta('dose'); @override late final GeneratedColumn dose = GeneratedColumn( 'dose', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _whyMeta = const VerificationMeta('why'); @override late final GeneratedColumn why = GeneratedColumn( 'why', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _howJsonMeta = const VerificationMeta( 'howJson', ); @override late final GeneratedColumn howJson = GeneratedColumn( 'how_json', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _checkTextMeta = const VerificationMeta( 'checkText', ); @override late final GeneratedColumn checkText = GeneratedColumn( 'check_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _cautionMeta = const VerificationMeta( 'caution', ); @override late final GeneratedColumn caution = GeneratedColumn( 'caution', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _defaultAnchorJsonMeta = const VerificationMeta( 'defaultAnchorJson', ); @override late final GeneratedColumn defaultAnchorJson = GeneratedColumn( 'default_anchor_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _minDoseForStartMeta = const VerificationMeta( 'minDoseForStart', ); @override late final GeneratedColumn minDoseForStart = GeneratedColumn( 'min_dose_for_start', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta( 'referenceIdsJson', ); @override late final GeneratedColumn referenceIdsJson = GeneratedColumn( 'reference_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta( 'evidenceStrength', ); @override late final GeneratedColumn evidenceStrength = GeneratedColumn( 'evidence_strength', aliasedName, true, check: () => const CustomExpression( "evidence_strength IS NULL OR evidence_strength IN ('strong_rct','meta_analysis','observational','mechanistic','expert_opinion')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _sourceDocMeta = const VerificationMeta( 'sourceDoc', ); @override late final GeneratedColumn sourceDoc = GeneratedColumn( 'source_doc', aliasedName, true, check: () => const CustomExpression( "source_doc IS NULL OR source_doc IN ('huberman-protocols.md','diet-protocols.md')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, category, title, titleEn, what, whenText, dose, why, howJson, checkText, caution, defaultAnchorJson, minDoseForStart, referenceIdsJson, evidenceStrength, sourceDoc, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'protocols'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('category')) { context.handle( _categoryMeta, category.isAcceptableOrUnknown(data['category']!, _categoryMeta), ); } else if (isInserting) { context.missing(_categoryMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('title_en')) { context.handle( _titleEnMeta, titleEn.isAcceptableOrUnknown(data['title_en']!, _titleEnMeta), ); } if (data.containsKey('what')) { context.handle( _whatMeta, what.isAcceptableOrUnknown(data['what']!, _whatMeta), ); } else if (isInserting) { context.missing(_whatMeta); } if (data.containsKey('when_text')) { context.handle( _whenTextMeta, whenText.isAcceptableOrUnknown(data['when_text']!, _whenTextMeta), ); } else if (isInserting) { context.missing(_whenTextMeta); } if (data.containsKey('dose')) { context.handle( _doseMeta, dose.isAcceptableOrUnknown(data['dose']!, _doseMeta), ); } else if (isInserting) { context.missing(_doseMeta); } if (data.containsKey('why')) { context.handle( _whyMeta, why.isAcceptableOrUnknown(data['why']!, _whyMeta), ); } else if (isInserting) { context.missing(_whyMeta); } if (data.containsKey('how_json')) { context.handle( _howJsonMeta, howJson.isAcceptableOrUnknown(data['how_json']!, _howJsonMeta), ); } else if (isInserting) { context.missing(_howJsonMeta); } if (data.containsKey('check_text')) { context.handle( _checkTextMeta, checkText.isAcceptableOrUnknown(data['check_text']!, _checkTextMeta), ); } else if (isInserting) { context.missing(_checkTextMeta); } if (data.containsKey('caution')) { context.handle( _cautionMeta, caution.isAcceptableOrUnknown(data['caution']!, _cautionMeta), ); } if (data.containsKey('default_anchor_json')) { context.handle( _defaultAnchorJsonMeta, defaultAnchorJson.isAcceptableOrUnknown( data['default_anchor_json']!, _defaultAnchorJsonMeta, ), ); } if (data.containsKey('min_dose_for_start')) { context.handle( _minDoseForStartMeta, minDoseForStart.isAcceptableOrUnknown( data['min_dose_for_start']!, _minDoseForStartMeta, ), ); } if (data.containsKey('reference_ids_json')) { context.handle( _referenceIdsJsonMeta, referenceIdsJson.isAcceptableOrUnknown( data['reference_ids_json']!, _referenceIdsJsonMeta, ), ); } if (data.containsKey('evidence_strength')) { context.handle( _evidenceStrengthMeta, evidenceStrength.isAcceptableOrUnknown( data['evidence_strength']!, _evidenceStrengthMeta, ), ); } if (data.containsKey('source_doc')) { context.handle( _sourceDocMeta, sourceDoc.isAcceptableOrUnknown(data['source_doc']!, _sourceDocMeta), ); } return context; } @override Set get $primaryKey => {id}; @override Protocol map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Protocol( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, category: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}category'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, titleEn: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title_en'], ), what: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}what'], )!, whenText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}when_text'], )!, dose: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}dose'], )!, why: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}why'], )!, howJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}how_json'], )!, checkText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}check_text'], )!, caution: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}caution'], ), defaultAnchorJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}default_anchor_json'], ), minDoseForStart: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}min_dose_for_start'], ), referenceIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reference_ids_json'], ), evidenceStrength: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}evidence_strength'], ), sourceDoc: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}source_doc'], ), ); } @override $ProtocolsTable createAlias(String alias) { return $ProtocolsTable(attachedDatabase, alias); } } class Protocol extends DataClass implements Insertable { final String id; final String category; final String title; final String? titleEn; final String what; final String whenText; final String dose; final String why; final String howJson; final String checkText; final String? caution; final String? defaultAnchorJson; final String? minDoseForStart; final String? referenceIdsJson; final String? evidenceStrength; final String? sourceDoc; const Protocol({ required this.id, required this.category, required this.title, this.titleEn, required this.what, required this.whenText, required this.dose, required this.why, required this.howJson, required this.checkText, this.caution, this.defaultAnchorJson, this.minDoseForStart, this.referenceIdsJson, this.evidenceStrength, this.sourceDoc, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['category'] = Variable(category); map['title'] = Variable(title); if (!nullToAbsent || titleEn != null) { map['title_en'] = Variable(titleEn); } map['what'] = Variable(what); map['when_text'] = Variable(whenText); map['dose'] = Variable(dose); map['why'] = Variable(why); map['how_json'] = Variable(howJson); map['check_text'] = Variable(checkText); if (!nullToAbsent || caution != null) { map['caution'] = Variable(caution); } if (!nullToAbsent || defaultAnchorJson != null) { map['default_anchor_json'] = Variable(defaultAnchorJson); } if (!nullToAbsent || minDoseForStart != null) { map['min_dose_for_start'] = Variable(minDoseForStart); } if (!nullToAbsent || referenceIdsJson != null) { map['reference_ids_json'] = Variable(referenceIdsJson); } if (!nullToAbsent || evidenceStrength != null) { map['evidence_strength'] = Variable(evidenceStrength); } if (!nullToAbsent || sourceDoc != null) { map['source_doc'] = Variable(sourceDoc); } return map; } ProtocolsCompanion toCompanion(bool nullToAbsent) { return ProtocolsCompanion( id: Value(id), category: Value(category), title: Value(title), titleEn: titleEn == null && nullToAbsent ? const Value.absent() : Value(titleEn), what: Value(what), whenText: Value(whenText), dose: Value(dose), why: Value(why), howJson: Value(howJson), checkText: Value(checkText), caution: caution == null && nullToAbsent ? const Value.absent() : Value(caution), defaultAnchorJson: defaultAnchorJson == null && nullToAbsent ? const Value.absent() : Value(defaultAnchorJson), minDoseForStart: minDoseForStart == null && nullToAbsent ? const Value.absent() : Value(minDoseForStart), referenceIdsJson: referenceIdsJson == null && nullToAbsent ? const Value.absent() : Value(referenceIdsJson), evidenceStrength: evidenceStrength == null && nullToAbsent ? const Value.absent() : Value(evidenceStrength), sourceDoc: sourceDoc == null && nullToAbsent ? const Value.absent() : Value(sourceDoc), ); } factory Protocol.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Protocol( id: serializer.fromJson(json['id']), category: serializer.fromJson(json['category']), title: serializer.fromJson(json['title']), titleEn: serializer.fromJson(json['titleEn']), what: serializer.fromJson(json['what']), whenText: serializer.fromJson(json['whenText']), dose: serializer.fromJson(json['dose']), why: serializer.fromJson(json['why']), howJson: serializer.fromJson(json['howJson']), checkText: serializer.fromJson(json['checkText']), caution: serializer.fromJson(json['caution']), defaultAnchorJson: serializer.fromJson( json['defaultAnchorJson'], ), minDoseForStart: serializer.fromJson(json['minDoseForStart']), referenceIdsJson: serializer.fromJson(json['referenceIdsJson']), evidenceStrength: serializer.fromJson(json['evidenceStrength']), sourceDoc: serializer.fromJson(json['sourceDoc']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'category': serializer.toJson(category), 'title': serializer.toJson(title), 'titleEn': serializer.toJson(titleEn), 'what': serializer.toJson(what), 'whenText': serializer.toJson(whenText), 'dose': serializer.toJson(dose), 'why': serializer.toJson(why), 'howJson': serializer.toJson(howJson), 'checkText': serializer.toJson(checkText), 'caution': serializer.toJson(caution), 'defaultAnchorJson': serializer.toJson(defaultAnchorJson), 'minDoseForStart': serializer.toJson(minDoseForStart), 'referenceIdsJson': serializer.toJson(referenceIdsJson), 'evidenceStrength': serializer.toJson(evidenceStrength), 'sourceDoc': serializer.toJson(sourceDoc), }; } Protocol copyWith({ String? id, String? category, String? title, Value titleEn = const Value.absent(), String? what, String? whenText, String? dose, String? why, String? howJson, String? checkText, Value caution = const Value.absent(), Value defaultAnchorJson = const Value.absent(), Value minDoseForStart = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value evidenceStrength = const Value.absent(), Value sourceDoc = const Value.absent(), }) => Protocol( id: id ?? this.id, category: category ?? this.category, title: title ?? this.title, titleEn: titleEn.present ? titleEn.value : this.titleEn, what: what ?? this.what, whenText: whenText ?? this.whenText, dose: dose ?? this.dose, why: why ?? this.why, howJson: howJson ?? this.howJson, checkText: checkText ?? this.checkText, caution: caution.present ? caution.value : this.caution, defaultAnchorJson: defaultAnchorJson.present ? defaultAnchorJson.value : this.defaultAnchorJson, minDoseForStart: minDoseForStart.present ? minDoseForStart.value : this.minDoseForStart, referenceIdsJson: referenceIdsJson.present ? referenceIdsJson.value : this.referenceIdsJson, evidenceStrength: evidenceStrength.present ? evidenceStrength.value : this.evidenceStrength, sourceDoc: sourceDoc.present ? sourceDoc.value : this.sourceDoc, ); Protocol copyWithCompanion(ProtocolsCompanion data) { return Protocol( id: data.id.present ? data.id.value : this.id, category: data.category.present ? data.category.value : this.category, title: data.title.present ? data.title.value : this.title, titleEn: data.titleEn.present ? data.titleEn.value : this.titleEn, what: data.what.present ? data.what.value : this.what, whenText: data.whenText.present ? data.whenText.value : this.whenText, dose: data.dose.present ? data.dose.value : this.dose, why: data.why.present ? data.why.value : this.why, howJson: data.howJson.present ? data.howJson.value : this.howJson, checkText: data.checkText.present ? data.checkText.value : this.checkText, caution: data.caution.present ? data.caution.value : this.caution, defaultAnchorJson: data.defaultAnchorJson.present ? data.defaultAnchorJson.value : this.defaultAnchorJson, minDoseForStart: data.minDoseForStart.present ? data.minDoseForStart.value : this.minDoseForStart, referenceIdsJson: data.referenceIdsJson.present ? data.referenceIdsJson.value : this.referenceIdsJson, evidenceStrength: data.evidenceStrength.present ? data.evidenceStrength.value : this.evidenceStrength, sourceDoc: data.sourceDoc.present ? data.sourceDoc.value : this.sourceDoc, ); } @override String toString() { return (StringBuffer('Protocol(') ..write('id: $id, ') ..write('category: $category, ') ..write('title: $title, ') ..write('titleEn: $titleEn, ') ..write('what: $what, ') ..write('whenText: $whenText, ') ..write('dose: $dose, ') ..write('why: $why, ') ..write('howJson: $howJson, ') ..write('checkText: $checkText, ') ..write('caution: $caution, ') ..write('defaultAnchorJson: $defaultAnchorJson, ') ..write('minDoseForStart: $minDoseForStart, ') ..write('referenceIdsJson: $referenceIdsJson, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('sourceDoc: $sourceDoc') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, category, title, titleEn, what, whenText, dose, why, howJson, checkText, caution, defaultAnchorJson, minDoseForStart, referenceIdsJson, evidenceStrength, sourceDoc, ); @override bool operator ==(Object other) => identical(this, other) || (other is Protocol && other.id == this.id && other.category == this.category && other.title == this.title && other.titleEn == this.titleEn && other.what == this.what && other.whenText == this.whenText && other.dose == this.dose && other.why == this.why && other.howJson == this.howJson && other.checkText == this.checkText && other.caution == this.caution && other.defaultAnchorJson == this.defaultAnchorJson && other.minDoseForStart == this.minDoseForStart && other.referenceIdsJson == this.referenceIdsJson && other.evidenceStrength == this.evidenceStrength && other.sourceDoc == this.sourceDoc); } class ProtocolsCompanion extends UpdateCompanion { final Value id; final Value category; final Value title; final Value titleEn; final Value what; final Value whenText; final Value dose; final Value why; final Value howJson; final Value checkText; final Value caution; final Value defaultAnchorJson; final Value minDoseForStart; final Value referenceIdsJson; final Value evidenceStrength; final Value sourceDoc; final Value rowid; const ProtocolsCompanion({ this.id = const Value.absent(), this.category = const Value.absent(), this.title = const Value.absent(), this.titleEn = const Value.absent(), this.what = const Value.absent(), this.whenText = const Value.absent(), this.dose = const Value.absent(), this.why = const Value.absent(), this.howJson = const Value.absent(), this.checkText = const Value.absent(), this.caution = const Value.absent(), this.defaultAnchorJson = const Value.absent(), this.minDoseForStart = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.evidenceStrength = const Value.absent(), this.sourceDoc = const Value.absent(), this.rowid = const Value.absent(), }); ProtocolsCompanion.insert({ required String id, required String category, required String title, this.titleEn = const Value.absent(), required String what, required String whenText, required String dose, required String why, required String howJson, required String checkText, this.caution = const Value.absent(), this.defaultAnchorJson = const Value.absent(), this.minDoseForStart = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.evidenceStrength = const Value.absent(), this.sourceDoc = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), category = Value(category), title = Value(title), what = Value(what), whenText = Value(whenText), dose = Value(dose), why = Value(why), howJson = Value(howJson), checkText = Value(checkText); static Insertable custom({ Expression? id, Expression? category, Expression? title, Expression? titleEn, Expression? what, Expression? whenText, Expression? dose, Expression? why, Expression? howJson, Expression? checkText, Expression? caution, Expression? defaultAnchorJson, Expression? minDoseForStart, Expression? referenceIdsJson, Expression? evidenceStrength, Expression? sourceDoc, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (category != null) 'category': category, if (title != null) 'title': title, if (titleEn != null) 'title_en': titleEn, if (what != null) 'what': what, if (whenText != null) 'when_text': whenText, if (dose != null) 'dose': dose, if (why != null) 'why': why, if (howJson != null) 'how_json': howJson, if (checkText != null) 'check_text': checkText, if (caution != null) 'caution': caution, if (defaultAnchorJson != null) 'default_anchor_json': defaultAnchorJson, if (minDoseForStart != null) 'min_dose_for_start': minDoseForStart, if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson, if (evidenceStrength != null) 'evidence_strength': evidenceStrength, if (sourceDoc != null) 'source_doc': sourceDoc, if (rowid != null) 'rowid': rowid, }); } ProtocolsCompanion copyWith({ Value? id, Value? category, Value? title, Value? titleEn, Value? what, Value? whenText, Value? dose, Value? why, Value? howJson, Value? checkText, Value? caution, Value? defaultAnchorJson, Value? minDoseForStart, Value? referenceIdsJson, Value? evidenceStrength, Value? sourceDoc, Value? rowid, }) { return ProtocolsCompanion( id: id ?? this.id, category: category ?? this.category, title: title ?? this.title, titleEn: titleEn ?? this.titleEn, what: what ?? this.what, whenText: whenText ?? this.whenText, dose: dose ?? this.dose, why: why ?? this.why, howJson: howJson ?? this.howJson, checkText: checkText ?? this.checkText, caution: caution ?? this.caution, defaultAnchorJson: defaultAnchorJson ?? this.defaultAnchorJson, minDoseForStart: minDoseForStart ?? this.minDoseForStart, referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson, evidenceStrength: evidenceStrength ?? this.evidenceStrength, sourceDoc: sourceDoc ?? this.sourceDoc, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (category.present) { map['category'] = Variable(category.value); } if (title.present) { map['title'] = Variable(title.value); } if (titleEn.present) { map['title_en'] = Variable(titleEn.value); } if (what.present) { map['what'] = Variable(what.value); } if (whenText.present) { map['when_text'] = Variable(whenText.value); } if (dose.present) { map['dose'] = Variable(dose.value); } if (why.present) { map['why'] = Variable(why.value); } if (howJson.present) { map['how_json'] = Variable(howJson.value); } if (checkText.present) { map['check_text'] = Variable(checkText.value); } if (caution.present) { map['caution'] = Variable(caution.value); } if (defaultAnchorJson.present) { map['default_anchor_json'] = Variable(defaultAnchorJson.value); } if (minDoseForStart.present) { map['min_dose_for_start'] = Variable(minDoseForStart.value); } if (referenceIdsJson.present) { map['reference_ids_json'] = Variable(referenceIdsJson.value); } if (evidenceStrength.present) { map['evidence_strength'] = Variable(evidenceStrength.value); } if (sourceDoc.present) { map['source_doc'] = Variable(sourceDoc.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ProtocolsCompanion(') ..write('id: $id, ') ..write('category: $category, ') ..write('title: $title, ') ..write('titleEn: $titleEn, ') ..write('what: $what, ') ..write('whenText: $whenText, ') ..write('dose: $dose, ') ..write('why: $why, ') ..write('howJson: $howJson, ') ..write('checkText: $checkText, ') ..write('caution: $caution, ') ..write('defaultAnchorJson: $defaultAnchorJson, ') ..write('minDoseForStart: $minDoseForStart, ') ..write('referenceIdsJson: $referenceIdsJson, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('sourceDoc: $sourceDoc, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $BreakProtocolsTable extends BreakProtocols with TableInfo<$BreakProtocolsTable, BreakProtocol> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $BreakProtocolsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _categoryMeta = const VerificationMeta( 'category', ); @override late final GeneratedColumn category = GeneratedColumn( 'category', aliasedName, false, check: () => const CustomExpression( "category IN ('alcohol','nicotine','porn_masturbation','social_media','sugar','caffeine','cannabis','behavioral')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _hubermanSummaryMeta = const VerificationMeta( 'hubermanSummary', ); @override late final GeneratedColumn hubermanSummary = GeneratedColumn( 'huberman_summary', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _frameExamplesJsonMeta = const VerificationMeta( 'frameExamplesJson', ); @override late final GeneratedColumn frameExamplesJson = GeneratedColumn( 'frame_examples_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _phasesJsonMeta = const VerificationMeta( 'phasesJson', ); @override late final GeneratedColumn phasesJson = GeneratedColumn( 'phases_json', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _defaultCommonFramesJsonMeta = const VerificationMeta('defaultCommonFramesJson'); @override late final GeneratedColumn defaultCommonFramesJson = GeneratedColumn( 'default_common_frames_json', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _toolsJsonMeta = const VerificationMeta( 'toolsJson', ); @override late final GeneratedColumn toolsJson = GeneratedColumn( 'tools_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _medicalWarningMeta = const VerificationMeta( 'medicalWarning', ); @override late final GeneratedColumn medicalWarning = GeneratedColumn( 'medical_warning', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta( 'referenceIdsJson', ); @override late final GeneratedColumn referenceIdsJson = GeneratedColumn( 'reference_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, category, title, hubermanSummary, frameExamplesJson, phasesJson, defaultCommonFramesJson, toolsJson, medicalWarning, referenceIdsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'break_protocols'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('category')) { context.handle( _categoryMeta, category.isAcceptableOrUnknown(data['category']!, _categoryMeta), ); } else if (isInserting) { context.missing(_categoryMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('huberman_summary')) { context.handle( _hubermanSummaryMeta, hubermanSummary.isAcceptableOrUnknown( data['huberman_summary']!, _hubermanSummaryMeta, ), ); } else if (isInserting) { context.missing(_hubermanSummaryMeta); } if (data.containsKey('frame_examples_json')) { context.handle( _frameExamplesJsonMeta, frameExamplesJson.isAcceptableOrUnknown( data['frame_examples_json']!, _frameExamplesJsonMeta, ), ); } if (data.containsKey('phases_json')) { context.handle( _phasesJsonMeta, phasesJson.isAcceptableOrUnknown(data['phases_json']!, _phasesJsonMeta), ); } else if (isInserting) { context.missing(_phasesJsonMeta); } if (data.containsKey('default_common_frames_json')) { context.handle( _defaultCommonFramesJsonMeta, defaultCommonFramesJson.isAcceptableOrUnknown( data['default_common_frames_json']!, _defaultCommonFramesJsonMeta, ), ); } else if (isInserting) { context.missing(_defaultCommonFramesJsonMeta); } if (data.containsKey('tools_json')) { context.handle( _toolsJsonMeta, toolsJson.isAcceptableOrUnknown(data['tools_json']!, _toolsJsonMeta), ); } if (data.containsKey('medical_warning')) { context.handle( _medicalWarningMeta, medicalWarning.isAcceptableOrUnknown( data['medical_warning']!, _medicalWarningMeta, ), ); } if (data.containsKey('reference_ids_json')) { context.handle( _referenceIdsJsonMeta, referenceIdsJson.isAcceptableOrUnknown( data['reference_ids_json']!, _referenceIdsJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override BreakProtocol map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return BreakProtocol( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, category: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}category'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, hubermanSummary: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}huberman_summary'], )!, frameExamplesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}frame_examples_json'], ), phasesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}phases_json'], )!, defaultCommonFramesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}default_common_frames_json'], )!, toolsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tools_json'], ), medicalWarning: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}medical_warning'], ), referenceIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reference_ids_json'], ), ); } @override $BreakProtocolsTable createAlias(String alias) { return $BreakProtocolsTable(attachedDatabase, alias); } } class BreakProtocol extends DataClass implements Insertable { final String id; final String category; final String title; final String hubermanSummary; final String? frameExamplesJson; final String phasesJson; final String defaultCommonFramesJson; final String? toolsJson; final String? medicalWarning; final String? referenceIdsJson; const BreakProtocol({ required this.id, required this.category, required this.title, required this.hubermanSummary, this.frameExamplesJson, required this.phasesJson, required this.defaultCommonFramesJson, this.toolsJson, this.medicalWarning, this.referenceIdsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['category'] = Variable(category); map['title'] = Variable(title); map['huberman_summary'] = Variable(hubermanSummary); if (!nullToAbsent || frameExamplesJson != null) { map['frame_examples_json'] = Variable(frameExamplesJson); } map['phases_json'] = Variable(phasesJson); map['default_common_frames_json'] = Variable( defaultCommonFramesJson, ); if (!nullToAbsent || toolsJson != null) { map['tools_json'] = Variable(toolsJson); } if (!nullToAbsent || medicalWarning != null) { map['medical_warning'] = Variable(medicalWarning); } if (!nullToAbsent || referenceIdsJson != null) { map['reference_ids_json'] = Variable(referenceIdsJson); } return map; } BreakProtocolsCompanion toCompanion(bool nullToAbsent) { return BreakProtocolsCompanion( id: Value(id), category: Value(category), title: Value(title), hubermanSummary: Value(hubermanSummary), frameExamplesJson: frameExamplesJson == null && nullToAbsent ? const Value.absent() : Value(frameExamplesJson), phasesJson: Value(phasesJson), defaultCommonFramesJson: Value(defaultCommonFramesJson), toolsJson: toolsJson == null && nullToAbsent ? const Value.absent() : Value(toolsJson), medicalWarning: medicalWarning == null && nullToAbsent ? const Value.absent() : Value(medicalWarning), referenceIdsJson: referenceIdsJson == null && nullToAbsent ? const Value.absent() : Value(referenceIdsJson), ); } factory BreakProtocol.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return BreakProtocol( id: serializer.fromJson(json['id']), category: serializer.fromJson(json['category']), title: serializer.fromJson(json['title']), hubermanSummary: serializer.fromJson(json['hubermanSummary']), frameExamplesJson: serializer.fromJson( json['frameExamplesJson'], ), phasesJson: serializer.fromJson(json['phasesJson']), defaultCommonFramesJson: serializer.fromJson( json['defaultCommonFramesJson'], ), toolsJson: serializer.fromJson(json['toolsJson']), medicalWarning: serializer.fromJson(json['medicalWarning']), referenceIdsJson: serializer.fromJson(json['referenceIdsJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'category': serializer.toJson(category), 'title': serializer.toJson(title), 'hubermanSummary': serializer.toJson(hubermanSummary), 'frameExamplesJson': serializer.toJson(frameExamplesJson), 'phasesJson': serializer.toJson(phasesJson), 'defaultCommonFramesJson': serializer.toJson( defaultCommonFramesJson, ), 'toolsJson': serializer.toJson(toolsJson), 'medicalWarning': serializer.toJson(medicalWarning), 'referenceIdsJson': serializer.toJson(referenceIdsJson), }; } BreakProtocol copyWith({ String? id, String? category, String? title, String? hubermanSummary, Value frameExamplesJson = const Value.absent(), String? phasesJson, String? defaultCommonFramesJson, Value toolsJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value referenceIdsJson = const Value.absent(), }) => BreakProtocol( id: id ?? this.id, category: category ?? this.category, title: title ?? this.title, hubermanSummary: hubermanSummary ?? this.hubermanSummary, frameExamplesJson: frameExamplesJson.present ? frameExamplesJson.value : this.frameExamplesJson, phasesJson: phasesJson ?? this.phasesJson, defaultCommonFramesJson: defaultCommonFramesJson ?? this.defaultCommonFramesJson, toolsJson: toolsJson.present ? toolsJson.value : this.toolsJson, medicalWarning: medicalWarning.present ? medicalWarning.value : this.medicalWarning, referenceIdsJson: referenceIdsJson.present ? referenceIdsJson.value : this.referenceIdsJson, ); BreakProtocol copyWithCompanion(BreakProtocolsCompanion data) { return BreakProtocol( id: data.id.present ? data.id.value : this.id, category: data.category.present ? data.category.value : this.category, title: data.title.present ? data.title.value : this.title, hubermanSummary: data.hubermanSummary.present ? data.hubermanSummary.value : this.hubermanSummary, frameExamplesJson: data.frameExamplesJson.present ? data.frameExamplesJson.value : this.frameExamplesJson, phasesJson: data.phasesJson.present ? data.phasesJson.value : this.phasesJson, defaultCommonFramesJson: data.defaultCommonFramesJson.present ? data.defaultCommonFramesJson.value : this.defaultCommonFramesJson, toolsJson: data.toolsJson.present ? data.toolsJson.value : this.toolsJson, medicalWarning: data.medicalWarning.present ? data.medicalWarning.value : this.medicalWarning, referenceIdsJson: data.referenceIdsJson.present ? data.referenceIdsJson.value : this.referenceIdsJson, ); } @override String toString() { return (StringBuffer('BreakProtocol(') ..write('id: $id, ') ..write('category: $category, ') ..write('title: $title, ') ..write('hubermanSummary: $hubermanSummary, ') ..write('frameExamplesJson: $frameExamplesJson, ') ..write('phasesJson: $phasesJson, ') ..write('defaultCommonFramesJson: $defaultCommonFramesJson, ') ..write('toolsJson: $toolsJson, ') ..write('medicalWarning: $medicalWarning, ') ..write('referenceIdsJson: $referenceIdsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, category, title, hubermanSummary, frameExamplesJson, phasesJson, defaultCommonFramesJson, toolsJson, medicalWarning, referenceIdsJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is BreakProtocol && other.id == this.id && other.category == this.category && other.title == this.title && other.hubermanSummary == this.hubermanSummary && other.frameExamplesJson == this.frameExamplesJson && other.phasesJson == this.phasesJson && other.defaultCommonFramesJson == this.defaultCommonFramesJson && other.toolsJson == this.toolsJson && other.medicalWarning == this.medicalWarning && other.referenceIdsJson == this.referenceIdsJson); } class BreakProtocolsCompanion extends UpdateCompanion { final Value id; final Value category; final Value title; final Value hubermanSummary; final Value frameExamplesJson; final Value phasesJson; final Value defaultCommonFramesJson; final Value toolsJson; final Value medicalWarning; final Value referenceIdsJson; final Value rowid; const BreakProtocolsCompanion({ this.id = const Value.absent(), this.category = const Value.absent(), this.title = const Value.absent(), this.hubermanSummary = const Value.absent(), this.frameExamplesJson = const Value.absent(), this.phasesJson = const Value.absent(), this.defaultCommonFramesJson = const Value.absent(), this.toolsJson = const Value.absent(), this.medicalWarning = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }); BreakProtocolsCompanion.insert({ required String id, required String category, required String title, required String hubermanSummary, this.frameExamplesJson = const Value.absent(), required String phasesJson, required String defaultCommonFramesJson, this.toolsJson = const Value.absent(), this.medicalWarning = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), category = Value(category), title = Value(title), hubermanSummary = Value(hubermanSummary), phasesJson = Value(phasesJson), defaultCommonFramesJson = Value(defaultCommonFramesJson); static Insertable custom({ Expression? id, Expression? category, Expression? title, Expression? hubermanSummary, Expression? frameExamplesJson, Expression? phasesJson, Expression? defaultCommonFramesJson, Expression? toolsJson, Expression? medicalWarning, Expression? referenceIdsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (category != null) 'category': category, if (title != null) 'title': title, if (hubermanSummary != null) 'huberman_summary': hubermanSummary, if (frameExamplesJson != null) 'frame_examples_json': frameExamplesJson, if (phasesJson != null) 'phases_json': phasesJson, if (defaultCommonFramesJson != null) 'default_common_frames_json': defaultCommonFramesJson, if (toolsJson != null) 'tools_json': toolsJson, if (medicalWarning != null) 'medical_warning': medicalWarning, if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson, if (rowid != null) 'rowid': rowid, }); } BreakProtocolsCompanion copyWith({ Value? id, Value? category, Value? title, Value? hubermanSummary, Value? frameExamplesJson, Value? phasesJson, Value? defaultCommonFramesJson, Value? toolsJson, Value? medicalWarning, Value? referenceIdsJson, Value? rowid, }) { return BreakProtocolsCompanion( id: id ?? this.id, category: category ?? this.category, title: title ?? this.title, hubermanSummary: hubermanSummary ?? this.hubermanSummary, frameExamplesJson: frameExamplesJson ?? this.frameExamplesJson, phasesJson: phasesJson ?? this.phasesJson, defaultCommonFramesJson: defaultCommonFramesJson ?? this.defaultCommonFramesJson, toolsJson: toolsJson ?? this.toolsJson, medicalWarning: medicalWarning ?? this.medicalWarning, referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (category.present) { map['category'] = Variable(category.value); } if (title.present) { map['title'] = Variable(title.value); } if (hubermanSummary.present) { map['huberman_summary'] = Variable(hubermanSummary.value); } if (frameExamplesJson.present) { map['frame_examples_json'] = Variable(frameExamplesJson.value); } if (phasesJson.present) { map['phases_json'] = Variable(phasesJson.value); } if (defaultCommonFramesJson.present) { map['default_common_frames_json'] = Variable( defaultCommonFramesJson.value, ); } if (toolsJson.present) { map['tools_json'] = Variable(toolsJson.value); } if (medicalWarning.present) { map['medical_warning'] = Variable(medicalWarning.value); } if (referenceIdsJson.present) { map['reference_ids_json'] = Variable(referenceIdsJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('BreakProtocolsCompanion(') ..write('id: $id, ') ..write('category: $category, ') ..write('title: $title, ') ..write('hubermanSummary: $hubermanSummary, ') ..write('frameExamplesJson: $frameExamplesJson, ') ..write('phasesJson: $phasesJson, ') ..write('defaultCommonFramesJson: $defaultCommonFramesJson, ') ..write('toolsJson: $toolsJson, ') ..write('medicalWarning: $medicalWarning, ') ..write('referenceIdsJson: $referenceIdsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $CommonFramesTable extends CommonFrames with TableInfo<$CommonFramesTable, CommonFrame> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $CommonFramesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, check: () => const CustomExpression( "id IN ('dopamine_reset','urge_surf','environment_design','relapse_recovery','recovery_stack')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _whatMeta = const VerificationMeta('what'); @override late final GeneratedColumn what = GeneratedColumn( 'what', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _whyMeta = const VerificationMeta('why'); @override late final GeneratedColumn why = GeneratedColumn( 'why', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _doseMeta = const VerificationMeta('dose'); @override late final GeneratedColumn dose = GeneratedColumn( 'dose', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _howJsonMeta = const VerificationMeta( 'howJson', ); @override late final GeneratedColumn howJson = GeneratedColumn( 'how_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _checkTextMeta = const VerificationMeta( 'checkText', ); @override late final GeneratedColumn checkText = GeneratedColumn( 'check_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _applicableBreakCategoriesJsonMeta = const VerificationMeta('applicableBreakCategoriesJson'); @override late final GeneratedColumn applicableBreakCategoriesJson = GeneratedColumn( 'applicable_break_categories_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta( 'referenceIdsJson', ); @override late final GeneratedColumn referenceIdsJson = GeneratedColumn( 'reference_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, title, what, why, dose, howJson, checkText, applicableBreakCategoriesJson, referenceIdsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'common_frames'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('what')) { context.handle( _whatMeta, what.isAcceptableOrUnknown(data['what']!, _whatMeta), ); } else if (isInserting) { context.missing(_whatMeta); } if (data.containsKey('why')) { context.handle( _whyMeta, why.isAcceptableOrUnknown(data['why']!, _whyMeta), ); } else if (isInserting) { context.missing(_whyMeta); } if (data.containsKey('dose')) { context.handle( _doseMeta, dose.isAcceptableOrUnknown(data['dose']!, _doseMeta), ); } if (data.containsKey('how_json')) { context.handle( _howJsonMeta, howJson.isAcceptableOrUnknown(data['how_json']!, _howJsonMeta), ); } if (data.containsKey('check_text')) { context.handle( _checkTextMeta, checkText.isAcceptableOrUnknown(data['check_text']!, _checkTextMeta), ); } else if (isInserting) { context.missing(_checkTextMeta); } if (data.containsKey('applicable_break_categories_json')) { context.handle( _applicableBreakCategoriesJsonMeta, applicableBreakCategoriesJson.isAcceptableOrUnknown( data['applicable_break_categories_json']!, _applicableBreakCategoriesJsonMeta, ), ); } if (data.containsKey('reference_ids_json')) { context.handle( _referenceIdsJsonMeta, referenceIdsJson.isAcceptableOrUnknown( data['reference_ids_json']!, _referenceIdsJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override CommonFrame map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return CommonFrame( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, what: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}what'], )!, why: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}why'], )!, dose: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}dose'], ), howJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}how_json'], ), checkText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}check_text'], )!, applicableBreakCategoriesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}applicable_break_categories_json'], ), referenceIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reference_ids_json'], ), ); } @override $CommonFramesTable createAlias(String alias) { return $CommonFramesTable(attachedDatabase, alias); } } class CommonFrame extends DataClass implements Insertable { final String id; final String title; final String what; final String why; final String? dose; final String? howJson; final String checkText; final String? applicableBreakCategoriesJson; final String? referenceIdsJson; const CommonFrame({ required this.id, required this.title, required this.what, required this.why, this.dose, this.howJson, required this.checkText, this.applicableBreakCategoriesJson, this.referenceIdsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['title'] = Variable(title); map['what'] = Variable(what); map['why'] = Variable(why); if (!nullToAbsent || dose != null) { map['dose'] = Variable(dose); } if (!nullToAbsent || howJson != null) { map['how_json'] = Variable(howJson); } map['check_text'] = Variable(checkText); if (!nullToAbsent || applicableBreakCategoriesJson != null) { map['applicable_break_categories_json'] = Variable( applicableBreakCategoriesJson, ); } if (!nullToAbsent || referenceIdsJson != null) { map['reference_ids_json'] = Variable(referenceIdsJson); } return map; } CommonFramesCompanion toCompanion(bool nullToAbsent) { return CommonFramesCompanion( id: Value(id), title: Value(title), what: Value(what), why: Value(why), dose: dose == null && nullToAbsent ? const Value.absent() : Value(dose), howJson: howJson == null && nullToAbsent ? const Value.absent() : Value(howJson), checkText: Value(checkText), applicableBreakCategoriesJson: applicableBreakCategoriesJson == null && nullToAbsent ? const Value.absent() : Value(applicableBreakCategoriesJson), referenceIdsJson: referenceIdsJson == null && nullToAbsent ? const Value.absent() : Value(referenceIdsJson), ); } factory CommonFrame.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return CommonFrame( id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), what: serializer.fromJson(json['what']), why: serializer.fromJson(json['why']), dose: serializer.fromJson(json['dose']), howJson: serializer.fromJson(json['howJson']), checkText: serializer.fromJson(json['checkText']), applicableBreakCategoriesJson: serializer.fromJson( json['applicableBreakCategoriesJson'], ), referenceIdsJson: serializer.fromJson(json['referenceIdsJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'what': serializer.toJson(what), 'why': serializer.toJson(why), 'dose': serializer.toJson(dose), 'howJson': serializer.toJson(howJson), 'checkText': serializer.toJson(checkText), 'applicableBreakCategoriesJson': serializer.toJson( applicableBreakCategoriesJson, ), 'referenceIdsJson': serializer.toJson(referenceIdsJson), }; } CommonFrame copyWith({ String? id, String? title, String? what, String? why, Value dose = const Value.absent(), Value howJson = const Value.absent(), String? checkText, Value applicableBreakCategoriesJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), }) => CommonFrame( id: id ?? this.id, title: title ?? this.title, what: what ?? this.what, why: why ?? this.why, dose: dose.present ? dose.value : this.dose, howJson: howJson.present ? howJson.value : this.howJson, checkText: checkText ?? this.checkText, applicableBreakCategoriesJson: applicableBreakCategoriesJson.present ? applicableBreakCategoriesJson.value : this.applicableBreakCategoriesJson, referenceIdsJson: referenceIdsJson.present ? referenceIdsJson.value : this.referenceIdsJson, ); CommonFrame copyWithCompanion(CommonFramesCompanion data) { return CommonFrame( id: data.id.present ? data.id.value : this.id, title: data.title.present ? data.title.value : this.title, what: data.what.present ? data.what.value : this.what, why: data.why.present ? data.why.value : this.why, dose: data.dose.present ? data.dose.value : this.dose, howJson: data.howJson.present ? data.howJson.value : this.howJson, checkText: data.checkText.present ? data.checkText.value : this.checkText, applicableBreakCategoriesJson: data.applicableBreakCategoriesJson.present ? data.applicableBreakCategoriesJson.value : this.applicableBreakCategoriesJson, referenceIdsJson: data.referenceIdsJson.present ? data.referenceIdsJson.value : this.referenceIdsJson, ); } @override String toString() { return (StringBuffer('CommonFrame(') ..write('id: $id, ') ..write('title: $title, ') ..write('what: $what, ') ..write('why: $why, ') ..write('dose: $dose, ') ..write('howJson: $howJson, ') ..write('checkText: $checkText, ') ..write( 'applicableBreakCategoriesJson: $applicableBreakCategoriesJson, ', ) ..write('referenceIdsJson: $referenceIdsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, title, what, why, dose, howJson, checkText, applicableBreakCategoriesJson, referenceIdsJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is CommonFrame && other.id == this.id && other.title == this.title && other.what == this.what && other.why == this.why && other.dose == this.dose && other.howJson == this.howJson && other.checkText == this.checkText && other.applicableBreakCategoriesJson == this.applicableBreakCategoriesJson && other.referenceIdsJson == this.referenceIdsJson); } class CommonFramesCompanion extends UpdateCompanion { final Value id; final Value title; final Value what; final Value why; final Value dose; final Value howJson; final Value checkText; final Value applicableBreakCategoriesJson; final Value referenceIdsJson; final Value rowid; const CommonFramesCompanion({ this.id = const Value.absent(), this.title = const Value.absent(), this.what = const Value.absent(), this.why = const Value.absent(), this.dose = const Value.absent(), this.howJson = const Value.absent(), this.checkText = const Value.absent(), this.applicableBreakCategoriesJson = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }); CommonFramesCompanion.insert({ required String id, required String title, required String what, required String why, this.dose = const Value.absent(), this.howJson = const Value.absent(), required String checkText, this.applicableBreakCategoriesJson = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), title = Value(title), what = Value(what), why = Value(why), checkText = Value(checkText); static Insertable custom({ Expression? id, Expression? title, Expression? what, Expression? why, Expression? dose, Expression? howJson, Expression? checkText, Expression? applicableBreakCategoriesJson, Expression? referenceIdsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (title != null) 'title': title, if (what != null) 'what': what, if (why != null) 'why': why, if (dose != null) 'dose': dose, if (howJson != null) 'how_json': howJson, if (checkText != null) 'check_text': checkText, if (applicableBreakCategoriesJson != null) 'applicable_break_categories_json': applicableBreakCategoriesJson, if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson, if (rowid != null) 'rowid': rowid, }); } CommonFramesCompanion copyWith({ Value? id, Value? title, Value? what, Value? why, Value? dose, Value? howJson, Value? checkText, Value? applicableBreakCategoriesJson, Value? referenceIdsJson, Value? rowid, }) { return CommonFramesCompanion( id: id ?? this.id, title: title ?? this.title, what: what ?? this.what, why: why ?? this.why, dose: dose ?? this.dose, howJson: howJson ?? this.howJson, checkText: checkText ?? this.checkText, applicableBreakCategoriesJson: applicableBreakCategoriesJson ?? this.applicableBreakCategoriesJson, referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson, 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 (what.present) { map['what'] = Variable(what.value); } if (why.present) { map['why'] = Variable(why.value); } if (dose.present) { map['dose'] = Variable(dose.value); } if (howJson.present) { map['how_json'] = Variable(howJson.value); } if (checkText.present) { map['check_text'] = Variable(checkText.value); } if (applicableBreakCategoriesJson.present) { map['applicable_break_categories_json'] = Variable( applicableBreakCategoriesJson.value, ); } if (referenceIdsJson.present) { map['reference_ids_json'] = Variable(referenceIdsJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('CommonFramesCompanion(') ..write('id: $id, ') ..write('title: $title, ') ..write('what: $what, ') ..write('why: $why, ') ..write('dose: $dose, ') ..write('howJson: $howJson, ') ..write('checkText: $checkText, ') ..write( 'applicableBreakCategoriesJson: $applicableBreakCategoriesJson, ', ) ..write('referenceIdsJson: $referenceIdsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $MethodologiesTable extends Methodologies with TableInfo<$MethodologiesTable, Methodology> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $MethodologiesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _originatorMeta = const VerificationMeta( 'originator', ); @override late final GeneratedColumn originator = GeneratedColumn( 'originator', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _oneLineDefinitionMeta = const VerificationMeta( 'oneLineDefinition', ); @override late final GeneratedColumn oneLineDefinition = GeneratedColumn( 'one_line_definition', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _coreUnitMeta = const VerificationMeta( 'coreUnit', ); @override late final GeneratedColumn coreUnit = GeneratedColumn( 'core_unit', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _procedureJsonMeta = const VerificationMeta( 'procedureJson', ); @override late final GeneratedColumn procedureJson = GeneratedColumn( 'procedure_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _toolsJsonMeta = const VerificationMeta( 'toolsJson', ); @override late final GeneratedColumn toolsJson = GeneratedColumn( 'tools_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _strengthsJsonMeta = const VerificationMeta( 'strengthsJson', ); @override late final GeneratedColumn strengthsJson = GeneratedColumn( 'strengths_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _weaknessesJsonMeta = const VerificationMeta( 'weaknessesJson', ); @override late final GeneratedColumn weaknessesJson = GeneratedColumn( 'weaknesses_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _goodForMeta = const VerificationMeta( 'goodFor', ); @override late final GeneratedColumn goodFor = GeneratedColumn( 'good_for', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _hubermanFitScoreMeta = const VerificationMeta( 'hubermanFitScore', ); @override late final GeneratedColumn hubermanFitScore = GeneratedColumn( 'huberman_fit_score', aliasedName, false, check: () => const CustomExpression("huberman_fit_score BETWEEN 1 AND 5"), type: DriftSqlType.int, requiredDuringInsert: true, ); static const VerificationMeta _isCoreEngineMeta = const VerificationMeta( 'isCoreEngine', ); @override late final GeneratedColumn isCoreEngine = GeneratedColumn( 'is_core_engine', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_core_engine" IN (0, 1))', ), defaultValue: const Constant(false), ); static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta( 'referenceIdsJson', ); @override late final GeneratedColumn referenceIdsJson = GeneratedColumn( 'reference_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, name, originator, oneLineDefinition, coreUnit, procedureJson, toolsJson, strengthsJson, weaknessesJson, goodFor, hubermanFitScore, isCoreEngine, referenceIdsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'methodologies'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta), ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('originator')) { context.handle( _originatorMeta, originator.isAcceptableOrUnknown(data['originator']!, _originatorMeta), ); } else if (isInserting) { context.missing(_originatorMeta); } if (data.containsKey('one_line_definition')) { context.handle( _oneLineDefinitionMeta, oneLineDefinition.isAcceptableOrUnknown( data['one_line_definition']!, _oneLineDefinitionMeta, ), ); } else if (isInserting) { context.missing(_oneLineDefinitionMeta); } if (data.containsKey('core_unit')) { context.handle( _coreUnitMeta, coreUnit.isAcceptableOrUnknown(data['core_unit']!, _coreUnitMeta), ); } else if (isInserting) { context.missing(_coreUnitMeta); } if (data.containsKey('procedure_json')) { context.handle( _procedureJsonMeta, procedureJson.isAcceptableOrUnknown( data['procedure_json']!, _procedureJsonMeta, ), ); } if (data.containsKey('tools_json')) { context.handle( _toolsJsonMeta, toolsJson.isAcceptableOrUnknown(data['tools_json']!, _toolsJsonMeta), ); } if (data.containsKey('strengths_json')) { context.handle( _strengthsJsonMeta, strengthsJson.isAcceptableOrUnknown( data['strengths_json']!, _strengthsJsonMeta, ), ); } if (data.containsKey('weaknesses_json')) { context.handle( _weaknessesJsonMeta, weaknessesJson.isAcceptableOrUnknown( data['weaknesses_json']!, _weaknessesJsonMeta, ), ); } if (data.containsKey('good_for')) { context.handle( _goodForMeta, goodFor.isAcceptableOrUnknown(data['good_for']!, _goodForMeta), ); } if (data.containsKey('huberman_fit_score')) { context.handle( _hubermanFitScoreMeta, hubermanFitScore.isAcceptableOrUnknown( data['huberman_fit_score']!, _hubermanFitScoreMeta, ), ); } else if (isInserting) { context.missing(_hubermanFitScoreMeta); } if (data.containsKey('is_core_engine')) { context.handle( _isCoreEngineMeta, isCoreEngine.isAcceptableOrUnknown( data['is_core_engine']!, _isCoreEngineMeta, ), ); } if (data.containsKey('reference_ids_json')) { context.handle( _referenceIdsJsonMeta, referenceIdsJson.isAcceptableOrUnknown( data['reference_ids_json']!, _referenceIdsJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override Methodology map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Methodology( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, name: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}name'], )!, originator: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}originator'], )!, oneLineDefinition: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}one_line_definition'], )!, coreUnit: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}core_unit'], )!, procedureJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}procedure_json'], ), toolsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tools_json'], ), strengthsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}strengths_json'], ), weaknessesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}weaknesses_json'], ), goodFor: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}good_for'], ), hubermanFitScore: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}huberman_fit_score'], )!, isCoreEngine: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}is_core_engine'], )!, referenceIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reference_ids_json'], ), ); } @override $MethodologiesTable createAlias(String alias) { return $MethodologiesTable(attachedDatabase, alias); } } class Methodology extends DataClass implements Insertable { final String id; final String name; final String originator; final String oneLineDefinition; final String coreUnit; final String? procedureJson; final String? toolsJson; final String? strengthsJson; final String? weaknessesJson; final String? goodFor; final int hubermanFitScore; final bool isCoreEngine; final String? referenceIdsJson; const Methodology({ required this.id, required this.name, required this.originator, required this.oneLineDefinition, required this.coreUnit, this.procedureJson, this.toolsJson, this.strengthsJson, this.weaknessesJson, this.goodFor, required this.hubermanFitScore, required this.isCoreEngine, this.referenceIdsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['originator'] = Variable(originator); map['one_line_definition'] = Variable(oneLineDefinition); map['core_unit'] = Variable(coreUnit); if (!nullToAbsent || procedureJson != null) { map['procedure_json'] = Variable(procedureJson); } if (!nullToAbsent || toolsJson != null) { map['tools_json'] = Variable(toolsJson); } if (!nullToAbsent || strengthsJson != null) { map['strengths_json'] = Variable(strengthsJson); } if (!nullToAbsent || weaknessesJson != null) { map['weaknesses_json'] = Variable(weaknessesJson); } if (!nullToAbsent || goodFor != null) { map['good_for'] = Variable(goodFor); } map['huberman_fit_score'] = Variable(hubermanFitScore); map['is_core_engine'] = Variable(isCoreEngine); if (!nullToAbsent || referenceIdsJson != null) { map['reference_ids_json'] = Variable(referenceIdsJson); } return map; } MethodologiesCompanion toCompanion(bool nullToAbsent) { return MethodologiesCompanion( id: Value(id), name: Value(name), originator: Value(originator), oneLineDefinition: Value(oneLineDefinition), coreUnit: Value(coreUnit), procedureJson: procedureJson == null && nullToAbsent ? const Value.absent() : Value(procedureJson), toolsJson: toolsJson == null && nullToAbsent ? const Value.absent() : Value(toolsJson), strengthsJson: strengthsJson == null && nullToAbsent ? const Value.absent() : Value(strengthsJson), weaknessesJson: weaknessesJson == null && nullToAbsent ? const Value.absent() : Value(weaknessesJson), goodFor: goodFor == null && nullToAbsent ? const Value.absent() : Value(goodFor), hubermanFitScore: Value(hubermanFitScore), isCoreEngine: Value(isCoreEngine), referenceIdsJson: referenceIdsJson == null && nullToAbsent ? const Value.absent() : Value(referenceIdsJson), ); } factory Methodology.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Methodology( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), originator: serializer.fromJson(json['originator']), oneLineDefinition: serializer.fromJson(json['oneLineDefinition']), coreUnit: serializer.fromJson(json['coreUnit']), procedureJson: serializer.fromJson(json['procedureJson']), toolsJson: serializer.fromJson(json['toolsJson']), strengthsJson: serializer.fromJson(json['strengthsJson']), weaknessesJson: serializer.fromJson(json['weaknessesJson']), goodFor: serializer.fromJson(json['goodFor']), hubermanFitScore: serializer.fromJson(json['hubermanFitScore']), isCoreEngine: serializer.fromJson(json['isCoreEngine']), referenceIdsJson: serializer.fromJson(json['referenceIdsJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'originator': serializer.toJson(originator), 'oneLineDefinition': serializer.toJson(oneLineDefinition), 'coreUnit': serializer.toJson(coreUnit), 'procedureJson': serializer.toJson(procedureJson), 'toolsJson': serializer.toJson(toolsJson), 'strengthsJson': serializer.toJson(strengthsJson), 'weaknessesJson': serializer.toJson(weaknessesJson), 'goodFor': serializer.toJson(goodFor), 'hubermanFitScore': serializer.toJson(hubermanFitScore), 'isCoreEngine': serializer.toJson(isCoreEngine), 'referenceIdsJson': serializer.toJson(referenceIdsJson), }; } Methodology copyWith({ String? id, String? name, String? originator, String? oneLineDefinition, String? coreUnit, Value procedureJson = const Value.absent(), Value toolsJson = const Value.absent(), Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), Value goodFor = const Value.absent(), int? hubermanFitScore, bool? isCoreEngine, Value referenceIdsJson = const Value.absent(), }) => Methodology( id: id ?? this.id, name: name ?? this.name, originator: originator ?? this.originator, oneLineDefinition: oneLineDefinition ?? this.oneLineDefinition, coreUnit: coreUnit ?? this.coreUnit, procedureJson: procedureJson.present ? procedureJson.value : this.procedureJson, toolsJson: toolsJson.present ? toolsJson.value : this.toolsJson, strengthsJson: strengthsJson.present ? strengthsJson.value : this.strengthsJson, weaknessesJson: weaknessesJson.present ? weaknessesJson.value : this.weaknessesJson, goodFor: goodFor.present ? goodFor.value : this.goodFor, hubermanFitScore: hubermanFitScore ?? this.hubermanFitScore, isCoreEngine: isCoreEngine ?? this.isCoreEngine, referenceIdsJson: referenceIdsJson.present ? referenceIdsJson.value : this.referenceIdsJson, ); Methodology copyWithCompanion(MethodologiesCompanion data) { return Methodology( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, originator: data.originator.present ? data.originator.value : this.originator, oneLineDefinition: data.oneLineDefinition.present ? data.oneLineDefinition.value : this.oneLineDefinition, coreUnit: data.coreUnit.present ? data.coreUnit.value : this.coreUnit, procedureJson: data.procedureJson.present ? data.procedureJson.value : this.procedureJson, toolsJson: data.toolsJson.present ? data.toolsJson.value : this.toolsJson, strengthsJson: data.strengthsJson.present ? data.strengthsJson.value : this.strengthsJson, weaknessesJson: data.weaknessesJson.present ? data.weaknessesJson.value : this.weaknessesJson, goodFor: data.goodFor.present ? data.goodFor.value : this.goodFor, hubermanFitScore: data.hubermanFitScore.present ? data.hubermanFitScore.value : this.hubermanFitScore, isCoreEngine: data.isCoreEngine.present ? data.isCoreEngine.value : this.isCoreEngine, referenceIdsJson: data.referenceIdsJson.present ? data.referenceIdsJson.value : this.referenceIdsJson, ); } @override String toString() { return (StringBuffer('Methodology(') ..write('id: $id, ') ..write('name: $name, ') ..write('originator: $originator, ') ..write('oneLineDefinition: $oneLineDefinition, ') ..write('coreUnit: $coreUnit, ') ..write('procedureJson: $procedureJson, ') ..write('toolsJson: $toolsJson, ') ..write('strengthsJson: $strengthsJson, ') ..write('weaknessesJson: $weaknessesJson, ') ..write('goodFor: $goodFor, ') ..write('hubermanFitScore: $hubermanFitScore, ') ..write('isCoreEngine: $isCoreEngine, ') ..write('referenceIdsJson: $referenceIdsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, name, originator, oneLineDefinition, coreUnit, procedureJson, toolsJson, strengthsJson, weaknessesJson, goodFor, hubermanFitScore, isCoreEngine, referenceIdsJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is Methodology && other.id == this.id && other.name == this.name && other.originator == this.originator && other.oneLineDefinition == this.oneLineDefinition && other.coreUnit == this.coreUnit && other.procedureJson == this.procedureJson && other.toolsJson == this.toolsJson && other.strengthsJson == this.strengthsJson && other.weaknessesJson == this.weaknessesJson && other.goodFor == this.goodFor && other.hubermanFitScore == this.hubermanFitScore && other.isCoreEngine == this.isCoreEngine && other.referenceIdsJson == this.referenceIdsJson); } class MethodologiesCompanion extends UpdateCompanion { final Value id; final Value name; final Value originator; final Value oneLineDefinition; final Value coreUnit; final Value procedureJson; final Value toolsJson; final Value strengthsJson; final Value weaknessesJson; final Value goodFor; final Value hubermanFitScore; final Value isCoreEngine; final Value referenceIdsJson; final Value rowid; const MethodologiesCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.originator = const Value.absent(), this.oneLineDefinition = const Value.absent(), this.coreUnit = const Value.absent(), this.procedureJson = const Value.absent(), this.toolsJson = const Value.absent(), this.strengthsJson = const Value.absent(), this.weaknessesJson = const Value.absent(), this.goodFor = const Value.absent(), this.hubermanFitScore = const Value.absent(), this.isCoreEngine = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }); MethodologiesCompanion.insert({ required String id, required String name, required String originator, required String oneLineDefinition, required String coreUnit, this.procedureJson = const Value.absent(), this.toolsJson = const Value.absent(), this.strengthsJson = const Value.absent(), this.weaknessesJson = const Value.absent(), this.goodFor = const Value.absent(), required int hubermanFitScore, this.isCoreEngine = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), name = Value(name), originator = Value(originator), oneLineDefinition = Value(oneLineDefinition), coreUnit = Value(coreUnit), hubermanFitScore = Value(hubermanFitScore); static Insertable custom({ Expression? id, Expression? name, Expression? originator, Expression? oneLineDefinition, Expression? coreUnit, Expression? procedureJson, Expression? toolsJson, Expression? strengthsJson, Expression? weaknessesJson, Expression? goodFor, Expression? hubermanFitScore, Expression? isCoreEngine, Expression? referenceIdsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (originator != null) 'originator': originator, if (oneLineDefinition != null) 'one_line_definition': oneLineDefinition, if (coreUnit != null) 'core_unit': coreUnit, if (procedureJson != null) 'procedure_json': procedureJson, if (toolsJson != null) 'tools_json': toolsJson, if (strengthsJson != null) 'strengths_json': strengthsJson, if (weaknessesJson != null) 'weaknesses_json': weaknessesJson, if (goodFor != null) 'good_for': goodFor, if (hubermanFitScore != null) 'huberman_fit_score': hubermanFitScore, if (isCoreEngine != null) 'is_core_engine': isCoreEngine, if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson, if (rowid != null) 'rowid': rowid, }); } MethodologiesCompanion copyWith({ Value? id, Value? name, Value? originator, Value? oneLineDefinition, Value? coreUnit, Value? procedureJson, Value? toolsJson, Value? strengthsJson, Value? weaknessesJson, Value? goodFor, Value? hubermanFitScore, Value? isCoreEngine, Value? referenceIdsJson, Value? rowid, }) { return MethodologiesCompanion( id: id ?? this.id, name: name ?? this.name, originator: originator ?? this.originator, oneLineDefinition: oneLineDefinition ?? this.oneLineDefinition, coreUnit: coreUnit ?? this.coreUnit, procedureJson: procedureJson ?? this.procedureJson, toolsJson: toolsJson ?? this.toolsJson, strengthsJson: strengthsJson ?? this.strengthsJson, weaknessesJson: weaknessesJson ?? this.weaknessesJson, goodFor: goodFor ?? this.goodFor, hubermanFitScore: hubermanFitScore ?? this.hubermanFitScore, isCoreEngine: isCoreEngine ?? this.isCoreEngine, referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (originator.present) { map['originator'] = Variable(originator.value); } if (oneLineDefinition.present) { map['one_line_definition'] = Variable(oneLineDefinition.value); } if (coreUnit.present) { map['core_unit'] = Variable(coreUnit.value); } if (procedureJson.present) { map['procedure_json'] = Variable(procedureJson.value); } if (toolsJson.present) { map['tools_json'] = Variable(toolsJson.value); } if (strengthsJson.present) { map['strengths_json'] = Variable(strengthsJson.value); } if (weaknessesJson.present) { map['weaknesses_json'] = Variable(weaknessesJson.value); } if (goodFor.present) { map['good_for'] = Variable(goodFor.value); } if (hubermanFitScore.present) { map['huberman_fit_score'] = Variable(hubermanFitScore.value); } if (isCoreEngine.present) { map['is_core_engine'] = Variable(isCoreEngine.value); } if (referenceIdsJson.present) { map['reference_ids_json'] = Variable(referenceIdsJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('MethodologiesCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('originator: $originator, ') ..write('oneLineDefinition: $oneLineDefinition, ') ..write('coreUnit: $coreUnit, ') ..write('procedureJson: $procedureJson, ') ..write('toolsJson: $toolsJson, ') ..write('strengthsJson: $strengthsJson, ') ..write('weaknessesJson: $weaknessesJson, ') ..write('goodFor: $goodFor, ') ..write('hubermanFitScore: $hubermanFitScore, ') ..write('isCoreEngine: $isCoreEngine, ') ..write('referenceIdsJson: $referenceIdsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $FramePatternsTable extends FramePatterns with TableInfo<$FramePatternsTable, FramePattern> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $FramePatternsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _domainMeta = const VerificationMeta('domain'); @override late final GeneratedColumn domain = GeneratedColumn( 'domain', aliasedName, true, check: () => const CustomExpression( "domain IS NULL OR domain IN ('food','drink','smoking','screen','porn','sleep','exercise','general')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _avoidanceKeywordMeta = const VerificationMeta( 'avoidanceKeyword', ); @override late final GeneratedColumn avoidanceKeyword = GeneratedColumn( 'avoidance_keyword', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _l0ExampleMeta = const VerificationMeta( 'l0Example', ); @override late final GeneratedColumn l0Example = GeneratedColumn( 'l0_example', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _l1SimpleReplaceMeta = const VerificationMeta( 'l1SimpleReplace', ); @override late final GeneratedColumn l1SimpleReplace = GeneratedColumn( 'l1_simple_replace', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _l2SuggestionMeta = const VerificationMeta( 'l2Suggestion', ); @override late final GeneratedColumn l2Suggestion = GeneratedColumn( 'l2_suggestion', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _l3IdentityMeta = const VerificationMeta( 'l3Identity', ); @override late final GeneratedColumn l3Identity = GeneratedColumn( 'l3_identity', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, domain, avoidanceKeyword, l0Example, l1SimpleReplace, l2Suggestion, l3Identity, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'frame_patterns'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('domain')) { context.handle( _domainMeta, domain.isAcceptableOrUnknown(data['domain']!, _domainMeta), ); } if (data.containsKey('avoidance_keyword')) { context.handle( _avoidanceKeywordMeta, avoidanceKeyword.isAcceptableOrUnknown( data['avoidance_keyword']!, _avoidanceKeywordMeta, ), ); } else if (isInserting) { context.missing(_avoidanceKeywordMeta); } if (data.containsKey('l0_example')) { context.handle( _l0ExampleMeta, l0Example.isAcceptableOrUnknown(data['l0_example']!, _l0ExampleMeta), ); } else if (isInserting) { context.missing(_l0ExampleMeta); } if (data.containsKey('l1_simple_replace')) { context.handle( _l1SimpleReplaceMeta, l1SimpleReplace.isAcceptableOrUnknown( data['l1_simple_replace']!, _l1SimpleReplaceMeta, ), ); } if (data.containsKey('l2_suggestion')) { context.handle( _l2SuggestionMeta, l2Suggestion.isAcceptableOrUnknown( data['l2_suggestion']!, _l2SuggestionMeta, ), ); } else if (isInserting) { context.missing(_l2SuggestionMeta); } if (data.containsKey('l3_identity')) { context.handle( _l3IdentityMeta, l3Identity.isAcceptableOrUnknown(data['l3_identity']!, _l3IdentityMeta), ); } return context; } @override Set get $primaryKey => {id}; @override FramePattern map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return FramePattern( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, domain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}domain'], ), avoidanceKeyword: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}avoidance_keyword'], )!, l0Example: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}l0_example'], )!, l1SimpleReplace: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}l1_simple_replace'], ), l2Suggestion: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}l2_suggestion'], )!, l3Identity: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}l3_identity'], ), ); } @override $FramePatternsTable createAlias(String alias) { return $FramePatternsTable(attachedDatabase, alias); } } class FramePattern extends DataClass implements Insertable { final String id; final String? domain; final String avoidanceKeyword; final String l0Example; final String? l1SimpleReplace; final String l2Suggestion; final String? l3Identity; const FramePattern({ required this.id, this.domain, required this.avoidanceKeyword, required this.l0Example, this.l1SimpleReplace, required this.l2Suggestion, this.l3Identity, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || domain != null) { map['domain'] = Variable(domain); } map['avoidance_keyword'] = Variable(avoidanceKeyword); map['l0_example'] = Variable(l0Example); if (!nullToAbsent || l1SimpleReplace != null) { map['l1_simple_replace'] = Variable(l1SimpleReplace); } map['l2_suggestion'] = Variable(l2Suggestion); if (!nullToAbsent || l3Identity != null) { map['l3_identity'] = Variable(l3Identity); } return map; } FramePatternsCompanion toCompanion(bool nullToAbsent) { return FramePatternsCompanion( id: Value(id), domain: domain == null && nullToAbsent ? const Value.absent() : Value(domain), avoidanceKeyword: Value(avoidanceKeyword), l0Example: Value(l0Example), l1SimpleReplace: l1SimpleReplace == null && nullToAbsent ? const Value.absent() : Value(l1SimpleReplace), l2Suggestion: Value(l2Suggestion), l3Identity: l3Identity == null && nullToAbsent ? const Value.absent() : Value(l3Identity), ); } factory FramePattern.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return FramePattern( id: serializer.fromJson(json['id']), domain: serializer.fromJson(json['domain']), avoidanceKeyword: serializer.fromJson(json['avoidanceKeyword']), l0Example: serializer.fromJson(json['l0Example']), l1SimpleReplace: serializer.fromJson(json['l1SimpleReplace']), l2Suggestion: serializer.fromJson(json['l2Suggestion']), l3Identity: serializer.fromJson(json['l3Identity']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'domain': serializer.toJson(domain), 'avoidanceKeyword': serializer.toJson(avoidanceKeyword), 'l0Example': serializer.toJson(l0Example), 'l1SimpleReplace': serializer.toJson(l1SimpleReplace), 'l2Suggestion': serializer.toJson(l2Suggestion), 'l3Identity': serializer.toJson(l3Identity), }; } FramePattern copyWith({ String? id, Value domain = const Value.absent(), String? avoidanceKeyword, String? l0Example, Value l1SimpleReplace = const Value.absent(), String? l2Suggestion, Value l3Identity = const Value.absent(), }) => FramePattern( id: id ?? this.id, domain: domain.present ? domain.value : this.domain, avoidanceKeyword: avoidanceKeyword ?? this.avoidanceKeyword, l0Example: l0Example ?? this.l0Example, l1SimpleReplace: l1SimpleReplace.present ? l1SimpleReplace.value : this.l1SimpleReplace, l2Suggestion: l2Suggestion ?? this.l2Suggestion, l3Identity: l3Identity.present ? l3Identity.value : this.l3Identity, ); FramePattern copyWithCompanion(FramePatternsCompanion data) { return FramePattern( id: data.id.present ? data.id.value : this.id, domain: data.domain.present ? data.domain.value : this.domain, avoidanceKeyword: data.avoidanceKeyword.present ? data.avoidanceKeyword.value : this.avoidanceKeyword, l0Example: data.l0Example.present ? data.l0Example.value : this.l0Example, l1SimpleReplace: data.l1SimpleReplace.present ? data.l1SimpleReplace.value : this.l1SimpleReplace, l2Suggestion: data.l2Suggestion.present ? data.l2Suggestion.value : this.l2Suggestion, l3Identity: data.l3Identity.present ? data.l3Identity.value : this.l3Identity, ); } @override String toString() { return (StringBuffer('FramePattern(') ..write('id: $id, ') ..write('domain: $domain, ') ..write('avoidanceKeyword: $avoidanceKeyword, ') ..write('l0Example: $l0Example, ') ..write('l1SimpleReplace: $l1SimpleReplace, ') ..write('l2Suggestion: $l2Suggestion, ') ..write('l3Identity: $l3Identity') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, domain, avoidanceKeyword, l0Example, l1SimpleReplace, l2Suggestion, l3Identity, ); @override bool operator ==(Object other) => identical(this, other) || (other is FramePattern && other.id == this.id && other.domain == this.domain && other.avoidanceKeyword == this.avoidanceKeyword && other.l0Example == this.l0Example && other.l1SimpleReplace == this.l1SimpleReplace && other.l2Suggestion == this.l2Suggestion && other.l3Identity == this.l3Identity); } class FramePatternsCompanion extends UpdateCompanion { final Value id; final Value domain; final Value avoidanceKeyword; final Value l0Example; final Value l1SimpleReplace; final Value l2Suggestion; final Value l3Identity; final Value rowid; const FramePatternsCompanion({ this.id = const Value.absent(), this.domain = const Value.absent(), this.avoidanceKeyword = const Value.absent(), this.l0Example = const Value.absent(), this.l1SimpleReplace = const Value.absent(), this.l2Suggestion = const Value.absent(), this.l3Identity = const Value.absent(), this.rowid = const Value.absent(), }); FramePatternsCompanion.insert({ required String id, this.domain = const Value.absent(), required String avoidanceKeyword, required String l0Example, this.l1SimpleReplace = const Value.absent(), required String l2Suggestion, this.l3Identity = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), avoidanceKeyword = Value(avoidanceKeyword), l0Example = Value(l0Example), l2Suggestion = Value(l2Suggestion); static Insertable custom({ Expression? id, Expression? domain, Expression? avoidanceKeyword, Expression? l0Example, Expression? l1SimpleReplace, Expression? l2Suggestion, Expression? l3Identity, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (domain != null) 'domain': domain, if (avoidanceKeyword != null) 'avoidance_keyword': avoidanceKeyword, if (l0Example != null) 'l0_example': l0Example, if (l1SimpleReplace != null) 'l1_simple_replace': l1SimpleReplace, if (l2Suggestion != null) 'l2_suggestion': l2Suggestion, if (l3Identity != null) 'l3_identity': l3Identity, if (rowid != null) 'rowid': rowid, }); } FramePatternsCompanion copyWith({ Value? id, Value? domain, Value? avoidanceKeyword, Value? l0Example, Value? l1SimpleReplace, Value? l2Suggestion, Value? l3Identity, Value? rowid, }) { return FramePatternsCompanion( id: id ?? this.id, domain: domain ?? this.domain, avoidanceKeyword: avoidanceKeyword ?? this.avoidanceKeyword, l0Example: l0Example ?? this.l0Example, l1SimpleReplace: l1SimpleReplace ?? this.l1SimpleReplace, l2Suggestion: l2Suggestion ?? this.l2Suggestion, l3Identity: l3Identity ?? this.l3Identity, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (domain.present) { map['domain'] = Variable(domain.value); } if (avoidanceKeyword.present) { map['avoidance_keyword'] = Variable(avoidanceKeyword.value); } if (l0Example.present) { map['l0_example'] = Variable(l0Example.value); } if (l1SimpleReplace.present) { map['l1_simple_replace'] = Variable(l1SimpleReplace.value); } if (l2Suggestion.present) { map['l2_suggestion'] = Variable(l2Suggestion.value); } if (l3Identity.present) { map['l3_identity'] = Variable(l3Identity.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('FramePatternsCompanion(') ..write('id: $id, ') ..write('domain: $domain, ') ..write('avoidanceKeyword: $avoidanceKeyword, ') ..write('l0Example: $l0Example, ') ..write('l1SimpleReplace: $l1SimpleReplace, ') ..write('l2Suggestion: $l2Suggestion, ') ..write('l3Identity: $l3Identity, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $RewardMenuItemsTable extends RewardMenuItems with TableInfo<$RewardMenuItemsTable, RewardMenuItem> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $RewardMenuItemsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _tierRecommendedMeta = const VerificationMeta( 'tierRecommended', ); @override late final GeneratedColumn tierRecommended = GeneratedColumn( 'tier_recommended', aliasedName, false, check: () => const CustomExpression( "tier_recommended IN ('T0','T1','T2','T3','T4')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _descriptionMeta = const VerificationMeta( 'description', ); @override late final GeneratedColumn description = GeneratedColumn( 'description', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _estimatedCostKrwMinMeta = const VerificationMeta('estimatedCostKrwMin'); @override late final GeneratedColumn estimatedCostKrwMin = GeneratedColumn( 'estimated_cost_krw_min', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _estimatedCostKrwMaxMeta = const VerificationMeta('estimatedCostKrwMax'); @override late final GeneratedColumn estimatedCostKrwMax = GeneratedColumn( 'estimated_cost_krw_max', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _isEffortTiedMeta = const VerificationMeta( 'isEffortTied', ); @override late final GeneratedColumn isEffortTied = GeneratedColumn( 'is_effort_tied', aliasedName, true, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_effort_tied" IN (0, 1))', ), ); static const VerificationMeta _tagsJsonMeta = const VerificationMeta( 'tagsJson', ); @override late final GeneratedColumn tagsJson = GeneratedColumn( 'tags_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _avoidForBreakHabitsJsonMeta = const VerificationMeta('avoidForBreakHabitsJson'); @override late final GeneratedColumn avoidForBreakHabitsJson = GeneratedColumn( 'avoid_for_break_habits_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, tierRecommended, title, description, estimatedCostKrwMin, estimatedCostKrwMax, isEffortTied, tagsJson, avoidForBreakHabitsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'reward_menu_items'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('tier_recommended')) { context.handle( _tierRecommendedMeta, tierRecommended.isAcceptableOrUnknown( data['tier_recommended']!, _tierRecommendedMeta, ), ); } else if (isInserting) { context.missing(_tierRecommendedMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('description')) { context.handle( _descriptionMeta, description.isAcceptableOrUnknown( data['description']!, _descriptionMeta, ), ); } if (data.containsKey('estimated_cost_krw_min')) { context.handle( _estimatedCostKrwMinMeta, estimatedCostKrwMin.isAcceptableOrUnknown( data['estimated_cost_krw_min']!, _estimatedCostKrwMinMeta, ), ); } if (data.containsKey('estimated_cost_krw_max')) { context.handle( _estimatedCostKrwMaxMeta, estimatedCostKrwMax.isAcceptableOrUnknown( data['estimated_cost_krw_max']!, _estimatedCostKrwMaxMeta, ), ); } if (data.containsKey('is_effort_tied')) { context.handle( _isEffortTiedMeta, isEffortTied.isAcceptableOrUnknown( data['is_effort_tied']!, _isEffortTiedMeta, ), ); } if (data.containsKey('tags_json')) { context.handle( _tagsJsonMeta, tagsJson.isAcceptableOrUnknown(data['tags_json']!, _tagsJsonMeta), ); } if (data.containsKey('avoid_for_break_habits_json')) { context.handle( _avoidForBreakHabitsJsonMeta, avoidForBreakHabitsJson.isAcceptableOrUnknown( data['avoid_for_break_habits_json']!, _avoidForBreakHabitsJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override RewardMenuItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return RewardMenuItem( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, tierRecommended: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tier_recommended'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, description: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}description'], ), estimatedCostKrwMin: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}estimated_cost_krw_min'], ), estimatedCostKrwMax: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}estimated_cost_krw_max'], ), isEffortTied: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}is_effort_tied'], ), tagsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tags_json'], ), avoidForBreakHabitsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}avoid_for_break_habits_json'], ), ); } @override $RewardMenuItemsTable createAlias(String alias) { return $RewardMenuItemsTable(attachedDatabase, alias); } } class RewardMenuItem extends DataClass implements Insertable { final String id; final String tierRecommended; final String title; final String? description; final int? estimatedCostKrwMin; final int? estimatedCostKrwMax; final bool? isEffortTied; final String? tagsJson; final String? avoidForBreakHabitsJson; const RewardMenuItem({ required this.id, required this.tierRecommended, required this.title, this.description, this.estimatedCostKrwMin, this.estimatedCostKrwMax, this.isEffortTied, this.tagsJson, this.avoidForBreakHabitsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['tier_recommended'] = Variable(tierRecommended); map['title'] = Variable(title); if (!nullToAbsent || description != null) { map['description'] = Variable(description); } if (!nullToAbsent || estimatedCostKrwMin != null) { map['estimated_cost_krw_min'] = Variable(estimatedCostKrwMin); } if (!nullToAbsent || estimatedCostKrwMax != null) { map['estimated_cost_krw_max'] = Variable(estimatedCostKrwMax); } if (!nullToAbsent || isEffortTied != null) { map['is_effort_tied'] = Variable(isEffortTied); } if (!nullToAbsent || tagsJson != null) { map['tags_json'] = Variable(tagsJson); } if (!nullToAbsent || avoidForBreakHabitsJson != null) { map['avoid_for_break_habits_json'] = Variable( avoidForBreakHabitsJson, ); } return map; } RewardMenuItemsCompanion toCompanion(bool nullToAbsent) { return RewardMenuItemsCompanion( id: Value(id), tierRecommended: Value(tierRecommended), title: Value(title), description: description == null && nullToAbsent ? const Value.absent() : Value(description), estimatedCostKrwMin: estimatedCostKrwMin == null && nullToAbsent ? const Value.absent() : Value(estimatedCostKrwMin), estimatedCostKrwMax: estimatedCostKrwMax == null && nullToAbsent ? const Value.absent() : Value(estimatedCostKrwMax), isEffortTied: isEffortTied == null && nullToAbsent ? const Value.absent() : Value(isEffortTied), tagsJson: tagsJson == null && nullToAbsent ? const Value.absent() : Value(tagsJson), avoidForBreakHabitsJson: avoidForBreakHabitsJson == null && nullToAbsent ? const Value.absent() : Value(avoidForBreakHabitsJson), ); } factory RewardMenuItem.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return RewardMenuItem( id: serializer.fromJson(json['id']), tierRecommended: serializer.fromJson(json['tierRecommended']), title: serializer.fromJson(json['title']), description: serializer.fromJson(json['description']), estimatedCostKrwMin: serializer.fromJson( json['estimatedCostKrwMin'], ), estimatedCostKrwMax: serializer.fromJson( json['estimatedCostKrwMax'], ), isEffortTied: serializer.fromJson(json['isEffortTied']), tagsJson: serializer.fromJson(json['tagsJson']), avoidForBreakHabitsJson: serializer.fromJson( json['avoidForBreakHabitsJson'], ), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'tierRecommended': serializer.toJson(tierRecommended), 'title': serializer.toJson(title), 'description': serializer.toJson(description), 'estimatedCostKrwMin': serializer.toJson(estimatedCostKrwMin), 'estimatedCostKrwMax': serializer.toJson(estimatedCostKrwMax), 'isEffortTied': serializer.toJson(isEffortTied), 'tagsJson': serializer.toJson(tagsJson), 'avoidForBreakHabitsJson': serializer.toJson( avoidForBreakHabitsJson, ), }; } RewardMenuItem copyWith({ String? id, String? tierRecommended, String? title, Value description = const Value.absent(), Value estimatedCostKrwMin = const Value.absent(), Value estimatedCostKrwMax = const Value.absent(), Value isEffortTied = const Value.absent(), Value tagsJson = const Value.absent(), Value avoidForBreakHabitsJson = const Value.absent(), }) => RewardMenuItem( id: id ?? this.id, tierRecommended: tierRecommended ?? this.tierRecommended, title: title ?? this.title, description: description.present ? description.value : this.description, estimatedCostKrwMin: estimatedCostKrwMin.present ? estimatedCostKrwMin.value : this.estimatedCostKrwMin, estimatedCostKrwMax: estimatedCostKrwMax.present ? estimatedCostKrwMax.value : this.estimatedCostKrwMax, isEffortTied: isEffortTied.present ? isEffortTied.value : this.isEffortTied, tagsJson: tagsJson.present ? tagsJson.value : this.tagsJson, avoidForBreakHabitsJson: avoidForBreakHabitsJson.present ? avoidForBreakHabitsJson.value : this.avoidForBreakHabitsJson, ); RewardMenuItem copyWithCompanion(RewardMenuItemsCompanion data) { return RewardMenuItem( id: data.id.present ? data.id.value : this.id, tierRecommended: data.tierRecommended.present ? data.tierRecommended.value : this.tierRecommended, title: data.title.present ? data.title.value : this.title, description: data.description.present ? data.description.value : this.description, estimatedCostKrwMin: data.estimatedCostKrwMin.present ? data.estimatedCostKrwMin.value : this.estimatedCostKrwMin, estimatedCostKrwMax: data.estimatedCostKrwMax.present ? data.estimatedCostKrwMax.value : this.estimatedCostKrwMax, isEffortTied: data.isEffortTied.present ? data.isEffortTied.value : this.isEffortTied, tagsJson: data.tagsJson.present ? data.tagsJson.value : this.tagsJson, avoidForBreakHabitsJson: data.avoidForBreakHabitsJson.present ? data.avoidForBreakHabitsJson.value : this.avoidForBreakHabitsJson, ); } @override String toString() { return (StringBuffer('RewardMenuItem(') ..write('id: $id, ') ..write('tierRecommended: $tierRecommended, ') ..write('title: $title, ') ..write('description: $description, ') ..write('estimatedCostKrwMin: $estimatedCostKrwMin, ') ..write('estimatedCostKrwMax: $estimatedCostKrwMax, ') ..write('isEffortTied: $isEffortTied, ') ..write('tagsJson: $tagsJson, ') ..write('avoidForBreakHabitsJson: $avoidForBreakHabitsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, tierRecommended, title, description, estimatedCostKrwMin, estimatedCostKrwMax, isEffortTied, tagsJson, avoidForBreakHabitsJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is RewardMenuItem && other.id == this.id && other.tierRecommended == this.tierRecommended && other.title == this.title && other.description == this.description && other.estimatedCostKrwMin == this.estimatedCostKrwMin && other.estimatedCostKrwMax == this.estimatedCostKrwMax && other.isEffortTied == this.isEffortTied && other.tagsJson == this.tagsJson && other.avoidForBreakHabitsJson == this.avoidForBreakHabitsJson); } class RewardMenuItemsCompanion extends UpdateCompanion { final Value id; final Value tierRecommended; final Value title; final Value description; final Value estimatedCostKrwMin; final Value estimatedCostKrwMax; final Value isEffortTied; final Value tagsJson; final Value avoidForBreakHabitsJson; final Value rowid; const RewardMenuItemsCompanion({ this.id = const Value.absent(), this.tierRecommended = const Value.absent(), this.title = const Value.absent(), this.description = const Value.absent(), this.estimatedCostKrwMin = const Value.absent(), this.estimatedCostKrwMax = const Value.absent(), this.isEffortTied = const Value.absent(), this.tagsJson = const Value.absent(), this.avoidForBreakHabitsJson = const Value.absent(), this.rowid = const Value.absent(), }); RewardMenuItemsCompanion.insert({ required String id, required String tierRecommended, required String title, this.description = const Value.absent(), this.estimatedCostKrwMin = const Value.absent(), this.estimatedCostKrwMax = const Value.absent(), this.isEffortTied = const Value.absent(), this.tagsJson = const Value.absent(), this.avoidForBreakHabitsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), tierRecommended = Value(tierRecommended), title = Value(title); static Insertable custom({ Expression? id, Expression? tierRecommended, Expression? title, Expression? description, Expression? estimatedCostKrwMin, Expression? estimatedCostKrwMax, Expression? isEffortTied, Expression? tagsJson, Expression? avoidForBreakHabitsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (tierRecommended != null) 'tier_recommended': tierRecommended, if (title != null) 'title': title, if (description != null) 'description': description, if (estimatedCostKrwMin != null) 'estimated_cost_krw_min': estimatedCostKrwMin, if (estimatedCostKrwMax != null) 'estimated_cost_krw_max': estimatedCostKrwMax, if (isEffortTied != null) 'is_effort_tied': isEffortTied, if (tagsJson != null) 'tags_json': tagsJson, if (avoidForBreakHabitsJson != null) 'avoid_for_break_habits_json': avoidForBreakHabitsJson, if (rowid != null) 'rowid': rowid, }); } RewardMenuItemsCompanion copyWith({ Value? id, Value? tierRecommended, Value? title, Value? description, Value? estimatedCostKrwMin, Value? estimatedCostKrwMax, Value? isEffortTied, Value? tagsJson, Value? avoidForBreakHabitsJson, Value? rowid, }) { return RewardMenuItemsCompanion( id: id ?? this.id, tierRecommended: tierRecommended ?? this.tierRecommended, title: title ?? this.title, description: description ?? this.description, estimatedCostKrwMin: estimatedCostKrwMin ?? this.estimatedCostKrwMin, estimatedCostKrwMax: estimatedCostKrwMax ?? this.estimatedCostKrwMax, isEffortTied: isEffortTied ?? this.isEffortTied, tagsJson: tagsJson ?? this.tagsJson, avoidForBreakHabitsJson: avoidForBreakHabitsJson ?? this.avoidForBreakHabitsJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (tierRecommended.present) { map['tier_recommended'] = Variable(tierRecommended.value); } if (title.present) { map['title'] = Variable(title.value); } if (description.present) { map['description'] = Variable(description.value); } if (estimatedCostKrwMin.present) { map['estimated_cost_krw_min'] = Variable(estimatedCostKrwMin.value); } if (estimatedCostKrwMax.present) { map['estimated_cost_krw_max'] = Variable(estimatedCostKrwMax.value); } if (isEffortTied.present) { map['is_effort_tied'] = Variable(isEffortTied.value); } if (tagsJson.present) { map['tags_json'] = Variable(tagsJson.value); } if (avoidForBreakHabitsJson.present) { map['avoid_for_break_habits_json'] = Variable( avoidForBreakHabitsJson.value, ); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('RewardMenuItemsCompanion(') ..write('id: $id, ') ..write('tierRecommended: $tierRecommended, ') ..write('title: $title, ') ..write('description: $description, ') ..write('estimatedCostKrwMin: $estimatedCostKrwMin, ') ..write('estimatedCostKrwMax: $estimatedCostKrwMax, ') ..write('isEffortTied: $isEffortTied, ') ..write('tagsJson: $tagsJson, ') ..write('avoidForBreakHabitsJson: $avoidForBreakHabitsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $ReferencesTable extends References with TableInfo<$ReferencesTable, ReferenceRow> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ReferencesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _kindMeta = const VerificationMeta('kind'); @override late final GeneratedColumn kind = GeneratedColumn( 'kind', aliasedName, false, check: () => const CustomExpression( "kind IN ('paper','podcast_episode','book','url','korean_explainer')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _authorsJsonMeta = const VerificationMeta( 'authorsJson', ); @override late final GeneratedColumn authorsJson = GeneratedColumn( 'authors_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _yearMeta = const VerificationMeta('year'); @override late final GeneratedColumn year = GeneratedColumn( 'year', aliasedName, true, check: () => const CustomExpression( "year IS NULL OR (year BETWEEN 1900 AND 2100)", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _journalMeta = const VerificationMeta( 'journal', ); @override late final GeneratedColumn journal = GeneratedColumn( 'journal', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _doiMeta = const VerificationMeta('doi'); @override late final GeneratedColumn doi = GeneratedColumn( 'doi', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _urlMeta = const VerificationMeta('url'); @override late final GeneratedColumn url = GeneratedColumn( 'url', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _episodeNumberMeta = const VerificationMeta( 'episodeNumber', ); @override late final GeneratedColumn episodeNumber = GeneratedColumn( 'episode_number', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _publisherMeta = const VerificationMeta( 'publisher', ); @override late final GeneratedColumn publisher = GeneratedColumn( 'publisher', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta( 'evidenceStrength', ); @override late final GeneratedColumn evidenceStrength = GeneratedColumn( 'evidence_strength', aliasedName, true, check: () => const CustomExpression( "evidence_strength IS NULL OR evidence_strength IN ('strong_rct','meta_analysis','observational','mechanistic','expert_opinion')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _verifiedMeta = const VerificationMeta( 'verified', ); @override late final GeneratedColumn verified = GeneratedColumn( 'verified', aliasedName, true, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("verified" IN (0, 1))', ), ); static const VerificationMeta _noteMeta = const VerificationMeta('note'); @override late final GeneratedColumn note = GeneratedColumn( 'note', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, kind, title, authorsJson, year, journal, doi, url, episodeNumber, publisher, evidenceStrength, verified, note, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'references'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('kind')) { context.handle( _kindMeta, kind.isAcceptableOrUnknown(data['kind']!, _kindMeta), ); } else if (isInserting) { context.missing(_kindMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('authors_json')) { context.handle( _authorsJsonMeta, authorsJson.isAcceptableOrUnknown( data['authors_json']!, _authorsJsonMeta, ), ); } if (data.containsKey('year')) { context.handle( _yearMeta, year.isAcceptableOrUnknown(data['year']!, _yearMeta), ); } if (data.containsKey('journal')) { context.handle( _journalMeta, journal.isAcceptableOrUnknown(data['journal']!, _journalMeta), ); } if (data.containsKey('doi')) { context.handle( _doiMeta, doi.isAcceptableOrUnknown(data['doi']!, _doiMeta), ); } if (data.containsKey('url')) { context.handle( _urlMeta, url.isAcceptableOrUnknown(data['url']!, _urlMeta), ); } if (data.containsKey('episode_number')) { context.handle( _episodeNumberMeta, episodeNumber.isAcceptableOrUnknown( data['episode_number']!, _episodeNumberMeta, ), ); } if (data.containsKey('publisher')) { context.handle( _publisherMeta, publisher.isAcceptableOrUnknown(data['publisher']!, _publisherMeta), ); } if (data.containsKey('evidence_strength')) { context.handle( _evidenceStrengthMeta, evidenceStrength.isAcceptableOrUnknown( data['evidence_strength']!, _evidenceStrengthMeta, ), ); } if (data.containsKey('verified')) { context.handle( _verifiedMeta, verified.isAcceptableOrUnknown(data['verified']!, _verifiedMeta), ); } if (data.containsKey('note')) { context.handle( _noteMeta, note.isAcceptableOrUnknown(data['note']!, _noteMeta), ); } return context; } @override Set get $primaryKey => {id}; @override ReferenceRow map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ReferenceRow( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, kind: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}kind'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, authorsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}authors_json'], ), year: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}year'], ), journal: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}journal'], ), doi: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}doi'], ), url: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], ), episodeNumber: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}episode_number'], ), publisher: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}publisher'], ), evidenceStrength: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}evidence_strength'], ), verified: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}verified'], ), note: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}note'], ), ); } @override $ReferencesTable createAlias(String alias) { return $ReferencesTable(attachedDatabase, alias); } } class ReferenceRow extends DataClass implements Insertable { final String id; final String kind; final String title; final String? authorsJson; final int? year; final String? journal; final String? doi; final String? url; final int? episodeNumber; final String? publisher; final String? evidenceStrength; final bool? verified; final String? note; const ReferenceRow({ required this.id, required this.kind, required this.title, this.authorsJson, this.year, this.journal, this.doi, this.url, this.episodeNumber, this.publisher, this.evidenceStrength, this.verified, this.note, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['kind'] = Variable(kind); map['title'] = Variable(title); if (!nullToAbsent || authorsJson != null) { map['authors_json'] = Variable(authorsJson); } if (!nullToAbsent || year != null) { map['year'] = Variable(year); } if (!nullToAbsent || journal != null) { map['journal'] = Variable(journal); } if (!nullToAbsent || doi != null) { map['doi'] = Variable(doi); } if (!nullToAbsent || url != null) { map['url'] = Variable(url); } if (!nullToAbsent || episodeNumber != null) { map['episode_number'] = Variable(episodeNumber); } if (!nullToAbsent || publisher != null) { map['publisher'] = Variable(publisher); } if (!nullToAbsent || evidenceStrength != null) { map['evidence_strength'] = Variable(evidenceStrength); } if (!nullToAbsent || verified != null) { map['verified'] = Variable(verified); } if (!nullToAbsent || note != null) { map['note'] = Variable(note); } return map; } ReferencesCompanion toCompanion(bool nullToAbsent) { return ReferencesCompanion( id: Value(id), kind: Value(kind), title: Value(title), authorsJson: authorsJson == null && nullToAbsent ? const Value.absent() : Value(authorsJson), year: year == null && nullToAbsent ? const Value.absent() : Value(year), journal: journal == null && nullToAbsent ? const Value.absent() : Value(journal), doi: doi == null && nullToAbsent ? const Value.absent() : Value(doi), url: url == null && nullToAbsent ? const Value.absent() : Value(url), episodeNumber: episodeNumber == null && nullToAbsent ? const Value.absent() : Value(episodeNumber), publisher: publisher == null && nullToAbsent ? const Value.absent() : Value(publisher), evidenceStrength: evidenceStrength == null && nullToAbsent ? const Value.absent() : Value(evidenceStrength), verified: verified == null && nullToAbsent ? const Value.absent() : Value(verified), note: note == null && nullToAbsent ? const Value.absent() : Value(note), ); } factory ReferenceRow.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ReferenceRow( id: serializer.fromJson(json['id']), kind: serializer.fromJson(json['kind']), title: serializer.fromJson(json['title']), authorsJson: serializer.fromJson(json['authorsJson']), year: serializer.fromJson(json['year']), journal: serializer.fromJson(json['journal']), doi: serializer.fromJson(json['doi']), url: serializer.fromJson(json['url']), episodeNumber: serializer.fromJson(json['episodeNumber']), publisher: serializer.fromJson(json['publisher']), evidenceStrength: serializer.fromJson(json['evidenceStrength']), verified: serializer.fromJson(json['verified']), note: serializer.fromJson(json['note']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'kind': serializer.toJson(kind), 'title': serializer.toJson(title), 'authorsJson': serializer.toJson(authorsJson), 'year': serializer.toJson(year), 'journal': serializer.toJson(journal), 'doi': serializer.toJson(doi), 'url': serializer.toJson(url), 'episodeNumber': serializer.toJson(episodeNumber), 'publisher': serializer.toJson(publisher), 'evidenceStrength': serializer.toJson(evidenceStrength), 'verified': serializer.toJson(verified), 'note': serializer.toJson(note), }; } ReferenceRow copyWith({ String? id, String? kind, String? title, Value authorsJson = const Value.absent(), Value year = const Value.absent(), Value journal = const Value.absent(), Value doi = const Value.absent(), Value url = const Value.absent(), Value episodeNumber = const Value.absent(), Value publisher = const Value.absent(), Value evidenceStrength = const Value.absent(), Value verified = const Value.absent(), Value note = const Value.absent(), }) => ReferenceRow( id: id ?? this.id, kind: kind ?? this.kind, title: title ?? this.title, authorsJson: authorsJson.present ? authorsJson.value : this.authorsJson, year: year.present ? year.value : this.year, journal: journal.present ? journal.value : this.journal, doi: doi.present ? doi.value : this.doi, url: url.present ? url.value : this.url, episodeNumber: episodeNumber.present ? episodeNumber.value : this.episodeNumber, publisher: publisher.present ? publisher.value : this.publisher, evidenceStrength: evidenceStrength.present ? evidenceStrength.value : this.evidenceStrength, verified: verified.present ? verified.value : this.verified, note: note.present ? note.value : this.note, ); ReferenceRow copyWithCompanion(ReferencesCompanion data) { return ReferenceRow( id: data.id.present ? data.id.value : this.id, kind: data.kind.present ? data.kind.value : this.kind, title: data.title.present ? data.title.value : this.title, authorsJson: data.authorsJson.present ? data.authorsJson.value : this.authorsJson, year: data.year.present ? data.year.value : this.year, journal: data.journal.present ? data.journal.value : this.journal, doi: data.doi.present ? data.doi.value : this.doi, url: data.url.present ? data.url.value : this.url, episodeNumber: data.episodeNumber.present ? data.episodeNumber.value : this.episodeNumber, publisher: data.publisher.present ? data.publisher.value : this.publisher, evidenceStrength: data.evidenceStrength.present ? data.evidenceStrength.value : this.evidenceStrength, verified: data.verified.present ? data.verified.value : this.verified, note: data.note.present ? data.note.value : this.note, ); } @override String toString() { return (StringBuffer('ReferenceRow(') ..write('id: $id, ') ..write('kind: $kind, ') ..write('title: $title, ') ..write('authorsJson: $authorsJson, ') ..write('year: $year, ') ..write('journal: $journal, ') ..write('doi: $doi, ') ..write('url: $url, ') ..write('episodeNumber: $episodeNumber, ') ..write('publisher: $publisher, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('verified: $verified, ') ..write('note: $note') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, kind, title, authorsJson, year, journal, doi, url, episodeNumber, publisher, evidenceStrength, verified, note, ); @override bool operator ==(Object other) => identical(this, other) || (other is ReferenceRow && other.id == this.id && other.kind == this.kind && other.title == this.title && other.authorsJson == this.authorsJson && other.year == this.year && other.journal == this.journal && other.doi == this.doi && other.url == this.url && other.episodeNumber == this.episodeNumber && other.publisher == this.publisher && other.evidenceStrength == this.evidenceStrength && other.verified == this.verified && other.note == this.note); } class ReferencesCompanion extends UpdateCompanion { final Value id; final Value kind; final Value title; final Value authorsJson; final Value year; final Value journal; final Value doi; final Value url; final Value episodeNumber; final Value publisher; final Value evidenceStrength; final Value verified; final Value note; final Value rowid; const ReferencesCompanion({ this.id = const Value.absent(), this.kind = const Value.absent(), this.title = const Value.absent(), this.authorsJson = const Value.absent(), this.year = const Value.absent(), this.journal = const Value.absent(), this.doi = const Value.absent(), this.url = const Value.absent(), this.episodeNumber = const Value.absent(), this.publisher = const Value.absent(), this.evidenceStrength = const Value.absent(), this.verified = const Value.absent(), this.note = const Value.absent(), this.rowid = const Value.absent(), }); ReferencesCompanion.insert({ required String id, required String kind, required String title, this.authorsJson = const Value.absent(), this.year = const Value.absent(), this.journal = const Value.absent(), this.doi = const Value.absent(), this.url = const Value.absent(), this.episodeNumber = const Value.absent(), this.publisher = const Value.absent(), this.evidenceStrength = const Value.absent(), this.verified = const Value.absent(), this.note = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), kind = Value(kind), title = Value(title); static Insertable custom({ Expression? id, Expression? kind, Expression? title, Expression? authorsJson, Expression? year, Expression? journal, Expression? doi, Expression? url, Expression? episodeNumber, Expression? publisher, Expression? evidenceStrength, Expression? verified, Expression? note, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (kind != null) 'kind': kind, if (title != null) 'title': title, if (authorsJson != null) 'authors_json': authorsJson, if (year != null) 'year': year, if (journal != null) 'journal': journal, if (doi != null) 'doi': doi, if (url != null) 'url': url, if (episodeNumber != null) 'episode_number': episodeNumber, if (publisher != null) 'publisher': publisher, if (evidenceStrength != null) 'evidence_strength': evidenceStrength, if (verified != null) 'verified': verified, if (note != null) 'note': note, if (rowid != null) 'rowid': rowid, }); } ReferencesCompanion copyWith({ Value? id, Value? kind, Value? title, Value? authorsJson, Value? year, Value? journal, Value? doi, Value? url, Value? episodeNumber, Value? publisher, Value? evidenceStrength, Value? verified, Value? note, Value? rowid, }) { return ReferencesCompanion( id: id ?? this.id, kind: kind ?? this.kind, title: title ?? this.title, authorsJson: authorsJson ?? this.authorsJson, year: year ?? this.year, journal: journal ?? this.journal, doi: doi ?? this.doi, url: url ?? this.url, episodeNumber: episodeNumber ?? this.episodeNumber, publisher: publisher ?? this.publisher, evidenceStrength: evidenceStrength ?? this.evidenceStrength, verified: verified ?? this.verified, note: note ?? this.note, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (kind.present) { map['kind'] = Variable(kind.value); } if (title.present) { map['title'] = Variable(title.value); } if (authorsJson.present) { map['authors_json'] = Variable(authorsJson.value); } if (year.present) { map['year'] = Variable(year.value); } if (journal.present) { map['journal'] = Variable(journal.value); } if (doi.present) { map['doi'] = Variable(doi.value); } if (url.present) { map['url'] = Variable(url.value); } if (episodeNumber.present) { map['episode_number'] = Variable(episodeNumber.value); } if (publisher.present) { map['publisher'] = Variable(publisher.value); } if (evidenceStrength.present) { map['evidence_strength'] = Variable(evidenceStrength.value); } if (verified.present) { map['verified'] = Variable(verified.value); } if (note.present) { map['note'] = Variable(note.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ReferencesCompanion(') ..write('id: $id, ') ..write('kind: $kind, ') ..write('title: $title, ') ..write('authorsJson: $authorsJson, ') ..write('year: $year, ') ..write('journal: $journal, ') ..write('doi: $doi, ') ..write('url: $url, ') ..write('episodeNumber: $episodeNumber, ') ..write('publisher: $publisher, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('verified: $verified, ') ..write('note: $note, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $DietPatternsTable extends DietPatterns with TableInfo<$DietPatternsTable, DietPattern> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $DietPatternsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _coreMeta = const VerificationMeta('core'); @override late final GeneratedColumn core = GeneratedColumn( 'core', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _strengthsJsonMeta = const VerificationMeta( 'strengthsJson', ); @override late final GeneratedColumn strengthsJson = GeneratedColumn( 'strengths_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _weaknessesJsonMeta = const VerificationMeta( 'weaknessesJson', ); @override late final GeneratedColumn weaknessesJson = GeneratedColumn( 'weaknesses_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta( 'evidenceStrength', ); @override late final GeneratedColumn evidenceStrength = GeneratedColumn( 'evidence_strength', aliasedName, false, check: () => const CustomExpression( "evidence_strength IN ('strong','moderate','mixed','weak')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _koreanContextFitMeta = const VerificationMeta( 'koreanContextFit', ); @override late final GeneratedColumn koreanContextFit = GeneratedColumn( 'korean_context_fit', aliasedName, true, check: () => const CustomExpression( "korean_context_fit IS NULL OR korean_context_fit IN ('high','medium','low')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _starterLeversJsonMeta = const VerificationMeta( 'starterLeversJson', ); @override late final GeneratedColumn starterLeversJson = GeneratedColumn( 'starter_levers_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _medicalWarningMeta = const VerificationMeta( 'medicalWarning', ); @override late final GeneratedColumn medicalWarning = GeneratedColumn( 'medical_warning', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _linkedProtocolIdsJsonMeta = const VerificationMeta('linkedProtocolIdsJson'); @override late final GeneratedColumn linkedProtocolIdsJson = GeneratedColumn( 'linked_protocol_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta( 'referenceIdsJson', ); @override late final GeneratedColumn referenceIdsJson = GeneratedColumn( 'reference_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, name, core, strengthsJson, weaknessesJson, evidenceStrength, koreanContextFit, starterLeversJson, medicalWarning, linkedProtocolIdsJson, referenceIdsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'diet_patterns'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta), ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('core')) { context.handle( _coreMeta, core.isAcceptableOrUnknown(data['core']!, _coreMeta), ); } else if (isInserting) { context.missing(_coreMeta); } if (data.containsKey('strengths_json')) { context.handle( _strengthsJsonMeta, strengthsJson.isAcceptableOrUnknown( data['strengths_json']!, _strengthsJsonMeta, ), ); } if (data.containsKey('weaknesses_json')) { context.handle( _weaknessesJsonMeta, weaknessesJson.isAcceptableOrUnknown( data['weaknesses_json']!, _weaknessesJsonMeta, ), ); } if (data.containsKey('evidence_strength')) { context.handle( _evidenceStrengthMeta, evidenceStrength.isAcceptableOrUnknown( data['evidence_strength']!, _evidenceStrengthMeta, ), ); } else if (isInserting) { context.missing(_evidenceStrengthMeta); } if (data.containsKey('korean_context_fit')) { context.handle( _koreanContextFitMeta, koreanContextFit.isAcceptableOrUnknown( data['korean_context_fit']!, _koreanContextFitMeta, ), ); } if (data.containsKey('starter_levers_json')) { context.handle( _starterLeversJsonMeta, starterLeversJson.isAcceptableOrUnknown( data['starter_levers_json']!, _starterLeversJsonMeta, ), ); } if (data.containsKey('medical_warning')) { context.handle( _medicalWarningMeta, medicalWarning.isAcceptableOrUnknown( data['medical_warning']!, _medicalWarningMeta, ), ); } if (data.containsKey('linked_protocol_ids_json')) { context.handle( _linkedProtocolIdsJsonMeta, linkedProtocolIdsJson.isAcceptableOrUnknown( data['linked_protocol_ids_json']!, _linkedProtocolIdsJsonMeta, ), ); } if (data.containsKey('reference_ids_json')) { context.handle( _referenceIdsJsonMeta, referenceIdsJson.isAcceptableOrUnknown( data['reference_ids_json']!, _referenceIdsJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override DietPattern map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DietPattern( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, name: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}name'], )!, core: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}core'], )!, strengthsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}strengths_json'], ), weaknessesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}weaknesses_json'], ), evidenceStrength: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}evidence_strength'], )!, koreanContextFit: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}korean_context_fit'], ), starterLeversJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}starter_levers_json'], ), medicalWarning: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}medical_warning'], ), linkedProtocolIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}linked_protocol_ids_json'], ), referenceIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reference_ids_json'], ), ); } @override $DietPatternsTable createAlias(String alias) { return $DietPatternsTable(attachedDatabase, alias); } } class DietPattern extends DataClass implements Insertable { final String id; final String name; final String core; final String? strengthsJson; final String? weaknessesJson; final String evidenceStrength; final String? koreanContextFit; final String? starterLeversJson; final String? medicalWarning; final String? linkedProtocolIdsJson; final String? referenceIdsJson; const DietPattern({ required this.id, required this.name, required this.core, this.strengthsJson, this.weaknessesJson, required this.evidenceStrength, this.koreanContextFit, this.starterLeversJson, this.medicalWarning, this.linkedProtocolIdsJson, this.referenceIdsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['core'] = Variable(core); if (!nullToAbsent || strengthsJson != null) { map['strengths_json'] = Variable(strengthsJson); } if (!nullToAbsent || weaknessesJson != null) { map['weaknesses_json'] = Variable(weaknessesJson); } map['evidence_strength'] = Variable(evidenceStrength); if (!nullToAbsent || koreanContextFit != null) { map['korean_context_fit'] = Variable(koreanContextFit); } if (!nullToAbsent || starterLeversJson != null) { map['starter_levers_json'] = Variable(starterLeversJson); } if (!nullToAbsent || medicalWarning != null) { map['medical_warning'] = Variable(medicalWarning); } if (!nullToAbsent || linkedProtocolIdsJson != null) { map['linked_protocol_ids_json'] = Variable(linkedProtocolIdsJson); } if (!nullToAbsent || referenceIdsJson != null) { map['reference_ids_json'] = Variable(referenceIdsJson); } return map; } DietPatternsCompanion toCompanion(bool nullToAbsent) { return DietPatternsCompanion( id: Value(id), name: Value(name), core: Value(core), strengthsJson: strengthsJson == null && nullToAbsent ? const Value.absent() : Value(strengthsJson), weaknessesJson: weaknessesJson == null && nullToAbsent ? const Value.absent() : Value(weaknessesJson), evidenceStrength: Value(evidenceStrength), koreanContextFit: koreanContextFit == null && nullToAbsent ? const Value.absent() : Value(koreanContextFit), starterLeversJson: starterLeversJson == null && nullToAbsent ? const Value.absent() : Value(starterLeversJson), medicalWarning: medicalWarning == null && nullToAbsent ? const Value.absent() : Value(medicalWarning), linkedProtocolIdsJson: linkedProtocolIdsJson == null && nullToAbsent ? const Value.absent() : Value(linkedProtocolIdsJson), referenceIdsJson: referenceIdsJson == null && nullToAbsent ? const Value.absent() : Value(referenceIdsJson), ); } factory DietPattern.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return DietPattern( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), core: serializer.fromJson(json['core']), strengthsJson: serializer.fromJson(json['strengthsJson']), weaknessesJson: serializer.fromJson(json['weaknessesJson']), evidenceStrength: serializer.fromJson(json['evidenceStrength']), koreanContextFit: serializer.fromJson(json['koreanContextFit']), starterLeversJson: serializer.fromJson( json['starterLeversJson'], ), medicalWarning: serializer.fromJson(json['medicalWarning']), linkedProtocolIdsJson: serializer.fromJson( json['linkedProtocolIdsJson'], ), referenceIdsJson: serializer.fromJson(json['referenceIdsJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'core': serializer.toJson(core), 'strengthsJson': serializer.toJson(strengthsJson), 'weaknessesJson': serializer.toJson(weaknessesJson), 'evidenceStrength': serializer.toJson(evidenceStrength), 'koreanContextFit': serializer.toJson(koreanContextFit), 'starterLeversJson': serializer.toJson(starterLeversJson), 'medicalWarning': serializer.toJson(medicalWarning), 'linkedProtocolIdsJson': serializer.toJson( linkedProtocolIdsJson, ), 'referenceIdsJson': serializer.toJson(referenceIdsJson), }; } DietPattern copyWith({ String? id, String? name, String? core, Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), String? evidenceStrength, Value koreanContextFit = const Value.absent(), Value starterLeversJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value linkedProtocolIdsJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), }) => DietPattern( id: id ?? this.id, name: name ?? this.name, core: core ?? this.core, strengthsJson: strengthsJson.present ? strengthsJson.value : this.strengthsJson, weaknessesJson: weaknessesJson.present ? weaknessesJson.value : this.weaknessesJson, evidenceStrength: evidenceStrength ?? this.evidenceStrength, koreanContextFit: koreanContextFit.present ? koreanContextFit.value : this.koreanContextFit, starterLeversJson: starterLeversJson.present ? starterLeversJson.value : this.starterLeversJson, medicalWarning: medicalWarning.present ? medicalWarning.value : this.medicalWarning, linkedProtocolIdsJson: linkedProtocolIdsJson.present ? linkedProtocolIdsJson.value : this.linkedProtocolIdsJson, referenceIdsJson: referenceIdsJson.present ? referenceIdsJson.value : this.referenceIdsJson, ); DietPattern copyWithCompanion(DietPatternsCompanion data) { return DietPattern( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, core: data.core.present ? data.core.value : this.core, strengthsJson: data.strengthsJson.present ? data.strengthsJson.value : this.strengthsJson, weaknessesJson: data.weaknessesJson.present ? data.weaknessesJson.value : this.weaknessesJson, evidenceStrength: data.evidenceStrength.present ? data.evidenceStrength.value : this.evidenceStrength, koreanContextFit: data.koreanContextFit.present ? data.koreanContextFit.value : this.koreanContextFit, starterLeversJson: data.starterLeversJson.present ? data.starterLeversJson.value : this.starterLeversJson, medicalWarning: data.medicalWarning.present ? data.medicalWarning.value : this.medicalWarning, linkedProtocolIdsJson: data.linkedProtocolIdsJson.present ? data.linkedProtocolIdsJson.value : this.linkedProtocolIdsJson, referenceIdsJson: data.referenceIdsJson.present ? data.referenceIdsJson.value : this.referenceIdsJson, ); } @override String toString() { return (StringBuffer('DietPattern(') ..write('id: $id, ') ..write('name: $name, ') ..write('core: $core, ') ..write('strengthsJson: $strengthsJson, ') ..write('weaknessesJson: $weaknessesJson, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('koreanContextFit: $koreanContextFit, ') ..write('starterLeversJson: $starterLeversJson, ') ..write('medicalWarning: $medicalWarning, ') ..write('linkedProtocolIdsJson: $linkedProtocolIdsJson, ') ..write('referenceIdsJson: $referenceIdsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, name, core, strengthsJson, weaknessesJson, evidenceStrength, koreanContextFit, starterLeversJson, medicalWarning, linkedProtocolIdsJson, referenceIdsJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is DietPattern && other.id == this.id && other.name == this.name && other.core == this.core && other.strengthsJson == this.strengthsJson && other.weaknessesJson == this.weaknessesJson && other.evidenceStrength == this.evidenceStrength && other.koreanContextFit == this.koreanContextFit && other.starterLeversJson == this.starterLeversJson && other.medicalWarning == this.medicalWarning && other.linkedProtocolIdsJson == this.linkedProtocolIdsJson && other.referenceIdsJson == this.referenceIdsJson); } class DietPatternsCompanion extends UpdateCompanion { final Value id; final Value name; final Value core; final Value strengthsJson; final Value weaknessesJson; final Value evidenceStrength; final Value koreanContextFit; final Value starterLeversJson; final Value medicalWarning; final Value linkedProtocolIdsJson; final Value referenceIdsJson; final Value rowid; const DietPatternsCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.core = const Value.absent(), this.strengthsJson = const Value.absent(), this.weaknessesJson = const Value.absent(), this.evidenceStrength = const Value.absent(), this.koreanContextFit = const Value.absent(), this.starterLeversJson = const Value.absent(), this.medicalWarning = const Value.absent(), this.linkedProtocolIdsJson = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }); DietPatternsCompanion.insert({ required String id, required String name, required String core, this.strengthsJson = const Value.absent(), this.weaknessesJson = const Value.absent(), required String evidenceStrength, this.koreanContextFit = const Value.absent(), this.starterLeversJson = const Value.absent(), this.medicalWarning = const Value.absent(), this.linkedProtocolIdsJson = const Value.absent(), this.referenceIdsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), name = Value(name), core = Value(core), evidenceStrength = Value(evidenceStrength); static Insertable custom({ Expression? id, Expression? name, Expression? core, Expression? strengthsJson, Expression? weaknessesJson, Expression? evidenceStrength, Expression? koreanContextFit, Expression? starterLeversJson, Expression? medicalWarning, Expression? linkedProtocolIdsJson, Expression? referenceIdsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (core != null) 'core': core, if (strengthsJson != null) 'strengths_json': strengthsJson, if (weaknessesJson != null) 'weaknesses_json': weaknessesJson, if (evidenceStrength != null) 'evidence_strength': evidenceStrength, if (koreanContextFit != null) 'korean_context_fit': koreanContextFit, if (starterLeversJson != null) 'starter_levers_json': starterLeversJson, if (medicalWarning != null) 'medical_warning': medicalWarning, if (linkedProtocolIdsJson != null) 'linked_protocol_ids_json': linkedProtocolIdsJson, if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson, if (rowid != null) 'rowid': rowid, }); } DietPatternsCompanion copyWith({ Value? id, Value? name, Value? core, Value? strengthsJson, Value? weaknessesJson, Value? evidenceStrength, Value? koreanContextFit, Value? starterLeversJson, Value? medicalWarning, Value? linkedProtocolIdsJson, Value? referenceIdsJson, Value? rowid, }) { return DietPatternsCompanion( id: id ?? this.id, name: name ?? this.name, core: core ?? this.core, strengthsJson: strengthsJson ?? this.strengthsJson, weaknessesJson: weaknessesJson ?? this.weaknessesJson, evidenceStrength: evidenceStrength ?? this.evidenceStrength, koreanContextFit: koreanContextFit ?? this.koreanContextFit, starterLeversJson: starterLeversJson ?? this.starterLeversJson, medicalWarning: medicalWarning ?? this.medicalWarning, linkedProtocolIdsJson: linkedProtocolIdsJson ?? this.linkedProtocolIdsJson, referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (core.present) { map['core'] = Variable(core.value); } if (strengthsJson.present) { map['strengths_json'] = Variable(strengthsJson.value); } if (weaknessesJson.present) { map['weaknesses_json'] = Variable(weaknessesJson.value); } if (evidenceStrength.present) { map['evidence_strength'] = Variable(evidenceStrength.value); } if (koreanContextFit.present) { map['korean_context_fit'] = Variable(koreanContextFit.value); } if (starterLeversJson.present) { map['starter_levers_json'] = Variable(starterLeversJson.value); } if (medicalWarning.present) { map['medical_warning'] = Variable(medicalWarning.value); } if (linkedProtocolIdsJson.present) { map['linked_protocol_ids_json'] = Variable( linkedProtocolIdsJson.value, ); } if (referenceIdsJson.present) { map['reference_ids_json'] = Variable(referenceIdsJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('DietPatternsCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('core: $core, ') ..write('strengthsJson: $strengthsJson, ') ..write('weaknessesJson: $weaknessesJson, ') ..write('evidenceStrength: $evidenceStrength, ') ..write('koreanContextFit: $koreanContextFit, ') ..write('starterLeversJson: $starterLeversJson, ') ..write('medicalWarning: $medicalWarning, ') ..write('linkedProtocolIdsJson: $linkedProtocolIdsJson, ') ..write('referenceIdsJson: $referenceIdsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $UsersTable extends Users with TableInfo<$UsersTable, User> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $UsersTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _displayNameMeta = const VerificationMeta( 'displayName', ); @override late final GeneratedColumn displayName = GeneratedColumn( 'display_name', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _localeMeta = const VerificationMeta('locale'); @override late final GeneratedColumn locale = GeneratedColumn( 'locale', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const Constant('ko-KR'), ); static const VerificationMeta _timezoneMeta = const VerificationMeta( 'timezone', ); @override late final GeneratedColumn timezone = GeneratedColumn( 'timezone', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const Constant('Asia/Seoul'), ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _preferencesJsonMeta = const VerificationMeta( 'preferencesJson', ); @override late final GeneratedColumn preferencesJson = GeneratedColumn( 'preferences_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, displayName, locale, timezone, createdAt, preferencesJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'users'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('display_name')) { context.handle( _displayNameMeta, displayName.isAcceptableOrUnknown( data['display_name']!, _displayNameMeta, ), ); } if (data.containsKey('locale')) { context.handle( _localeMeta, locale.isAcceptableOrUnknown(data['locale']!, _localeMeta), ); } if (data.containsKey('timezone')) { context.handle( _timezoneMeta, timezone.isAcceptableOrUnknown(data['timezone']!, _timezoneMeta), ); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } else if (isInserting) { context.missing(_createdAtMeta); } if (data.containsKey('preferences_json')) { context.handle( _preferencesJsonMeta, preferencesJson.isAcceptableOrUnknown( data['preferences_json']!, _preferencesJsonMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override User map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return User( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, displayName: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}display_name'], ), locale: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}locale'], )!, timezone: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}timezone'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}created_at'], )!, preferencesJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}preferences_json'], ), ); } @override $UsersTable createAlias(String alias) { return $UsersTable(attachedDatabase, alias); } } class User extends DataClass implements Insertable { final String id; final String? displayName; final String locale; final String timezone; final String createdAt; final String? preferencesJson; const User({ required this.id, this.displayName, required this.locale, required this.timezone, required this.createdAt, this.preferencesJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || displayName != null) { map['display_name'] = Variable(displayName); } map['locale'] = Variable(locale); map['timezone'] = Variable(timezone); map['created_at'] = Variable(createdAt); if (!nullToAbsent || preferencesJson != null) { map['preferences_json'] = Variable(preferencesJson); } return map; } UsersCompanion toCompanion(bool nullToAbsent) { return UsersCompanion( id: Value(id), displayName: displayName == null && nullToAbsent ? const Value.absent() : Value(displayName), locale: Value(locale), timezone: Value(timezone), createdAt: Value(createdAt), preferencesJson: preferencesJson == null && nullToAbsent ? const Value.absent() : Value(preferencesJson), ); } factory User.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return User( id: serializer.fromJson(json['id']), displayName: serializer.fromJson(json['displayName']), locale: serializer.fromJson(json['locale']), timezone: serializer.fromJson(json['timezone']), createdAt: serializer.fromJson(json['createdAt']), preferencesJson: serializer.fromJson(json['preferencesJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'displayName': serializer.toJson(displayName), 'locale': serializer.toJson(locale), 'timezone': serializer.toJson(timezone), 'createdAt': serializer.toJson(createdAt), 'preferencesJson': serializer.toJson(preferencesJson), }; } User copyWith({ String? id, Value displayName = const Value.absent(), String? locale, String? timezone, String? createdAt, Value preferencesJson = const Value.absent(), }) => User( id: id ?? this.id, displayName: displayName.present ? displayName.value : this.displayName, locale: locale ?? this.locale, timezone: timezone ?? this.timezone, createdAt: createdAt ?? this.createdAt, preferencesJson: preferencesJson.present ? preferencesJson.value : this.preferencesJson, ); User copyWithCompanion(UsersCompanion data) { return User( id: data.id.present ? data.id.value : this.id, displayName: data.displayName.present ? data.displayName.value : this.displayName, locale: data.locale.present ? data.locale.value : this.locale, timezone: data.timezone.present ? data.timezone.value : this.timezone, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, preferencesJson: data.preferencesJson.present ? data.preferencesJson.value : this.preferencesJson, ); } @override String toString() { return (StringBuffer('User(') ..write('id: $id, ') ..write('displayName: $displayName, ') ..write('locale: $locale, ') ..write('timezone: $timezone, ') ..write('createdAt: $createdAt, ') ..write('preferencesJson: $preferencesJson') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, displayName, locale, timezone, createdAt, preferencesJson, ); @override bool operator ==(Object other) => identical(this, other) || (other is User && other.id == this.id && other.displayName == this.displayName && other.locale == this.locale && other.timezone == this.timezone && other.createdAt == this.createdAt && other.preferencesJson == this.preferencesJson); } class UsersCompanion extends UpdateCompanion { final Value id; final Value displayName; final Value locale; final Value timezone; final Value createdAt; final Value preferencesJson; final Value rowid; const UsersCompanion({ this.id = const Value.absent(), this.displayName = const Value.absent(), this.locale = const Value.absent(), this.timezone = const Value.absent(), this.createdAt = const Value.absent(), this.preferencesJson = const Value.absent(), this.rowid = const Value.absent(), }); UsersCompanion.insert({ required String id, this.displayName = const Value.absent(), this.locale = const Value.absent(), this.timezone = const Value.absent(), required String createdAt, this.preferencesJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), createdAt = Value(createdAt); static Insertable custom({ Expression? id, Expression? displayName, Expression? locale, Expression? timezone, Expression? createdAt, Expression? preferencesJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (displayName != null) 'display_name': displayName, if (locale != null) 'locale': locale, if (timezone != null) 'timezone': timezone, if (createdAt != null) 'created_at': createdAt, if (preferencesJson != null) 'preferences_json': preferencesJson, if (rowid != null) 'rowid': rowid, }); } UsersCompanion copyWith({ Value? id, Value? displayName, Value? locale, Value? timezone, Value? createdAt, Value? preferencesJson, Value? rowid, }) { return UsersCompanion( id: id ?? this.id, displayName: displayName ?? this.displayName, locale: locale ?? this.locale, timezone: timezone ?? this.timezone, createdAt: createdAt ?? this.createdAt, preferencesJson: preferencesJson ?? this.preferencesJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (displayName.present) { map['display_name'] = Variable(displayName.value); } if (locale.present) { map['locale'] = Variable(locale.value); } if (timezone.present) { map['timezone'] = Variable(timezone.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (preferencesJson.present) { map['preferences_json'] = Variable(preferencesJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('UsersCompanion(') ..write('id: $id, ') ..write('displayName: $displayName, ') ..write('locale: $locale, ') ..write('timezone: $timezone, ') ..write('createdAt: $createdAt, ') ..write('preferencesJson: $preferencesJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $PhasesTable extends Phases with TableInfo<$PhasesTable, Phase> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $PhasesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( 'user_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES users(id) NOT NULL', ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _startedAtMeta = const VerificationMeta( 'startedAt', ); @override late final GeneratedColumn startedAt = GeneratedColumn( 'started_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _endedAtMeta = const VerificationMeta( 'endedAt', ); @override late final GeneratedColumn endedAt = GeneratedColumn( 'ended_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _durationWeeksMeta = const VerificationMeta( 'durationWeeks', ); @override late final GeneratedColumn durationWeeks = GeneratedColumn( 'duration_weeks', aliasedName, false, check: () => const CustomExpression("duration_weeks >= 1"), type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const Constant(6), ); static const VerificationMeta _statusMeta = const VerificationMeta('status'); @override late final GeneratedColumn status = GeneratedColumn( 'status', aliasedName, false, check: () => const CustomExpression( "status IN ('active','completed','abandoned')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _intentionTextMeta = const VerificationMeta( 'intentionText', ); @override late final GeneratedColumn intentionText = GeneratedColumn( 'intention_text', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _rewardDeclarationsLockedMeta = const VerificationMeta('rewardDeclarationsLocked'); @override late final GeneratedColumn rewardDeclarationsLocked = GeneratedColumn( 'reward_declarations_locked', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("reward_declarations_locked" IN (0, 1))', ), defaultValue: const Constant(false), ); @override List get $columns => [ id, userId, title, startedAt, endedAt, durationWeeks, status, intentionText, rewardDeclarationsLocked, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'phases'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('user_id')) { context.handle( _userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta), ); } else if (isInserting) { context.missing(_userIdMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } if (data.containsKey('started_at')) { context.handle( _startedAtMeta, startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta), ); } else if (isInserting) { context.missing(_startedAtMeta); } if (data.containsKey('ended_at')) { context.handle( _endedAtMeta, endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta), ); } if (data.containsKey('duration_weeks')) { context.handle( _durationWeeksMeta, durationWeeks.isAcceptableOrUnknown( data['duration_weeks']!, _durationWeeksMeta, ), ); } if (data.containsKey('status')) { context.handle( _statusMeta, status.isAcceptableOrUnknown(data['status']!, _statusMeta), ); } else if (isInserting) { context.missing(_statusMeta); } if (data.containsKey('intention_text')) { context.handle( _intentionTextMeta, intentionText.isAcceptableOrUnknown( data['intention_text']!, _intentionTextMeta, ), ); } if (data.containsKey('reward_declarations_locked')) { context.handle( _rewardDeclarationsLockedMeta, rewardDeclarationsLocked.isAcceptableOrUnknown( data['reward_declarations_locked']!, _rewardDeclarationsLockedMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override Phase map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Phase( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, userId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}user_id'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), startedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}started_at'], )!, endedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}ended_at'], ), durationWeeks: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}duration_weeks'], )!, status: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}status'], )!, intentionText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}intention_text'], ), rewardDeclarationsLocked: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}reward_declarations_locked'], )!, ); } @override $PhasesTable createAlias(String alias) { return $PhasesTable(attachedDatabase, alias); } } class Phase extends DataClass implements Insertable { final String id; final String userId; final String? title; final String startedAt; final String? endedAt; final int durationWeeks; final String status; final String? intentionText; final bool rewardDeclarationsLocked; const Phase({ required this.id, required this.userId, this.title, required this.startedAt, this.endedAt, required this.durationWeeks, required this.status, this.intentionText, required this.rewardDeclarationsLocked, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['user_id'] = Variable(userId); if (!nullToAbsent || title != null) { map['title'] = Variable(title); } map['started_at'] = Variable(startedAt); if (!nullToAbsent || endedAt != null) { map['ended_at'] = Variable(endedAt); } map['duration_weeks'] = Variable(durationWeeks); map['status'] = Variable(status); if (!nullToAbsent || intentionText != null) { map['intention_text'] = Variable(intentionText); } map['reward_declarations_locked'] = Variable( rewardDeclarationsLocked, ); return map; } PhasesCompanion toCompanion(bool nullToAbsent) { return PhasesCompanion( id: Value(id), userId: Value(userId), title: title == null && nullToAbsent ? const Value.absent() : Value(title), startedAt: Value(startedAt), endedAt: endedAt == null && nullToAbsent ? const Value.absent() : Value(endedAt), durationWeeks: Value(durationWeeks), status: Value(status), intentionText: intentionText == null && nullToAbsent ? const Value.absent() : Value(intentionText), rewardDeclarationsLocked: Value(rewardDeclarationsLocked), ); } factory Phase.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Phase( id: serializer.fromJson(json['id']), userId: serializer.fromJson(json['userId']), title: serializer.fromJson(json['title']), startedAt: serializer.fromJson(json['startedAt']), endedAt: serializer.fromJson(json['endedAt']), durationWeeks: serializer.fromJson(json['durationWeeks']), status: serializer.fromJson(json['status']), intentionText: serializer.fromJson(json['intentionText']), rewardDeclarationsLocked: serializer.fromJson( json['rewardDeclarationsLocked'], ), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'userId': serializer.toJson(userId), 'title': serializer.toJson(title), 'startedAt': serializer.toJson(startedAt), 'endedAt': serializer.toJson(endedAt), 'durationWeeks': serializer.toJson(durationWeeks), 'status': serializer.toJson(status), 'intentionText': serializer.toJson(intentionText), 'rewardDeclarationsLocked': serializer.toJson( rewardDeclarationsLocked, ), }; } Phase copyWith({ String? id, String? userId, Value title = const Value.absent(), String? startedAt, Value endedAt = const Value.absent(), int? durationWeeks, String? status, Value intentionText = const Value.absent(), bool? rewardDeclarationsLocked, }) => Phase( id: id ?? this.id, userId: userId ?? this.userId, title: title.present ? title.value : this.title, startedAt: startedAt ?? this.startedAt, endedAt: endedAt.present ? endedAt.value : this.endedAt, durationWeeks: durationWeeks ?? this.durationWeeks, status: status ?? this.status, intentionText: intentionText.present ? intentionText.value : this.intentionText, rewardDeclarationsLocked: rewardDeclarationsLocked ?? this.rewardDeclarationsLocked, ); Phase copyWithCompanion(PhasesCompanion data) { return Phase( id: data.id.present ? data.id.value : this.id, userId: data.userId.present ? data.userId.value : this.userId, title: data.title.present ? data.title.value : this.title, startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt, endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt, durationWeeks: data.durationWeeks.present ? data.durationWeeks.value : this.durationWeeks, status: data.status.present ? data.status.value : this.status, intentionText: data.intentionText.present ? data.intentionText.value : this.intentionText, rewardDeclarationsLocked: data.rewardDeclarationsLocked.present ? data.rewardDeclarationsLocked.value : this.rewardDeclarationsLocked, ); } @override String toString() { return (StringBuffer('Phase(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('title: $title, ') ..write('startedAt: $startedAt, ') ..write('endedAt: $endedAt, ') ..write('durationWeeks: $durationWeeks, ') ..write('status: $status, ') ..write('intentionText: $intentionText, ') ..write('rewardDeclarationsLocked: $rewardDeclarationsLocked') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, userId, title, startedAt, endedAt, durationWeeks, status, intentionText, rewardDeclarationsLocked, ); @override bool operator ==(Object other) => identical(this, other) || (other is Phase && other.id == this.id && other.userId == this.userId && other.title == this.title && other.startedAt == this.startedAt && other.endedAt == this.endedAt && other.durationWeeks == this.durationWeeks && other.status == this.status && other.intentionText == this.intentionText && other.rewardDeclarationsLocked == this.rewardDeclarationsLocked); } class PhasesCompanion extends UpdateCompanion { final Value id; final Value userId; final Value title; final Value startedAt; final Value endedAt; final Value durationWeeks; final Value status; final Value intentionText; final Value rewardDeclarationsLocked; final Value rowid; const PhasesCompanion({ this.id = const Value.absent(), this.userId = const Value.absent(), this.title = const Value.absent(), this.startedAt = const Value.absent(), this.endedAt = const Value.absent(), this.durationWeeks = const Value.absent(), this.status = const Value.absent(), this.intentionText = const Value.absent(), this.rewardDeclarationsLocked = const Value.absent(), this.rowid = const Value.absent(), }); PhasesCompanion.insert({ required String id, required String userId, this.title = const Value.absent(), required String startedAt, this.endedAt = const Value.absent(), this.durationWeeks = const Value.absent(), required String status, this.intentionText = const Value.absent(), this.rewardDeclarationsLocked = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), userId = Value(userId), startedAt = Value(startedAt), status = Value(status); static Insertable custom({ Expression? id, Expression? userId, Expression? title, Expression? startedAt, Expression? endedAt, Expression? durationWeeks, Expression? status, Expression? intentionText, Expression? rewardDeclarationsLocked, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (userId != null) 'user_id': userId, if (title != null) 'title': title, if (startedAt != null) 'started_at': startedAt, if (endedAt != null) 'ended_at': endedAt, if (durationWeeks != null) 'duration_weeks': durationWeeks, if (status != null) 'status': status, if (intentionText != null) 'intention_text': intentionText, if (rewardDeclarationsLocked != null) 'reward_declarations_locked': rewardDeclarationsLocked, if (rowid != null) 'rowid': rowid, }); } PhasesCompanion copyWith({ Value? id, Value? userId, Value? title, Value? startedAt, Value? endedAt, Value? durationWeeks, Value? status, Value? intentionText, Value? rewardDeclarationsLocked, Value? rowid, }) { return PhasesCompanion( id: id ?? this.id, userId: userId ?? this.userId, title: title ?? this.title, startedAt: startedAt ?? this.startedAt, endedAt: endedAt ?? this.endedAt, durationWeeks: durationWeeks ?? this.durationWeeks, status: status ?? this.status, intentionText: intentionText ?? this.intentionText, rewardDeclarationsLocked: rewardDeclarationsLocked ?? this.rewardDeclarationsLocked, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (userId.present) { map['user_id'] = Variable(userId.value); } if (title.present) { map['title'] = Variable(title.value); } if (startedAt.present) { map['started_at'] = Variable(startedAt.value); } if (endedAt.present) { map['ended_at'] = Variable(endedAt.value); } if (durationWeeks.present) { map['duration_weeks'] = Variable(durationWeeks.value); } if (status.present) { map['status'] = Variable(status.value); } if (intentionText.present) { map['intention_text'] = Variable(intentionText.value); } if (rewardDeclarationsLocked.present) { map['reward_declarations_locked'] = Variable( rewardDeclarationsLocked.value, ); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('PhasesCompanion(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('title: $title, ') ..write('startedAt: $startedAt, ') ..write('endedAt: $endedAt, ') ..write('durationWeeks: $durationWeeks, ') ..write('status: $status, ') ..write('intentionText: $intentionText, ') ..write('rewardDeclarationsLocked: $rewardDeclarationsLocked, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $HabitsTable extends Habits with TableInfo<$HabitsTable, Habit> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $HabitsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( 'user_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES users(id) NOT NULL', ); static const VerificationMeta _phaseIdMeta = const VerificationMeta( 'phaseId', ); @override late final GeneratedColumn phaseId = GeneratedColumn( 'phase_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES phases(id) ON DELETE SET NULL', ); static const VerificationMeta _typeMeta = const VerificationMeta('type'); @override late final GeneratedColumn type = GeneratedColumn( 'type', aliasedName, false, check: () => const CustomExpression("type IN ('build','break')"), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _statusMeta = const VerificationMeta('status'); @override late final GeneratedColumn status = GeneratedColumn( 'status', aliasedName, false, check: () => const CustomExpression( "status IN ('active','paused','completed','abandoned')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _protocolIdMeta = const VerificationMeta( 'protocolId', ); @override late final GeneratedColumn protocolId = GeneratedColumn( 'protocol_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES protocols(id)', ); static const VerificationMeta _breakProtocolIdMeta = const VerificationMeta( 'breakProtocolId', ); @override late final GeneratedColumn breakProtocolId = GeneratedColumn( 'break_protocol_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES break_protocols(id)', ); static const VerificationMeta _commonFrameIdsJsonMeta = const VerificationMeta('commonFrameIdsJson'); @override late final GeneratedColumn commonFrameIdsJson = GeneratedColumn( 'common_frame_ids_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _frameLevelMeta = const VerificationMeta( 'frameLevel', ); @override late final GeneratedColumn frameLevel = GeneratedColumn( 'frame_level', aliasedName, false, check: () => const CustomExpression("frame_level IN ('L2','L3')"), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _frameOriginalTextMeta = const VerificationMeta( 'frameOriginalText', ); @override late final GeneratedColumn frameOriginalText = GeneratedColumn( 'frame_original_text', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _frameFramedTextMeta = const VerificationMeta( 'frameFramedText', ); @override late final GeneratedColumn frameFramedText = GeneratedColumn( 'frame_framed_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _anchorWhenMeta = const VerificationMeta( 'anchorWhen', ); @override late final GeneratedColumn anchorWhen = GeneratedColumn( 'anchor_when', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _anchorAfterWhatMeta = const VerificationMeta( 'anchorAfterWhat', ); @override late final GeneratedColumn anchorAfterWhat = GeneratedColumn( 'anchor_after_what', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _anchorWhereMeta = const VerificationMeta( 'anchorWhere', ); @override late final GeneratedColumn anchorWhere = GeneratedColumn( 'anchor_where', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _stackPositionMeta = const VerificationMeta( 'stackPosition', ); @override late final GeneratedColumn stackPosition = GeneratedColumn( 'stack_position', aliasedName, true, check: () => const CustomExpression( "stack_position IS NULL OR stack_position >= 1", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _minDoseMeta = const VerificationMeta( 'minDose', ); @override late final GeneratedColumn minDose = GeneratedColumn( 'min_dose', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _targetDoseMeta = const VerificationMeta( 'targetDose', ); @override late final GeneratedColumn targetDose = GeneratedColumn( 'target_dose', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _startedAtMeta = const VerificationMeta( 'startedAt', ); @override late final GeneratedColumn startedAt = GeneratedColumn( 'started_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _endedAtMeta = const VerificationMeta( 'endedAt', ); @override late final GeneratedColumn endedAt = GeneratedColumn( 'ended_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _tagsJsonMeta = const VerificationMeta( 'tagsJson', ); @override late final GeneratedColumn tagsJson = GeneratedColumn( 'tags_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, userId, phaseId, type, status, title, protocolId, breakProtocolId, commonFrameIdsJson, frameLevel, frameOriginalText, frameFramedText, anchorWhen, anchorAfterWhat, anchorWhere, stackPosition, minDose, targetDose, startedAt, endedAt, tagsJson, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'habits'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('user_id')) { context.handle( _userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta), ); } else if (isInserting) { context.missing(_userIdMeta); } if (data.containsKey('phase_id')) { context.handle( _phaseIdMeta, phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta), ); } if (data.containsKey('type')) { context.handle( _typeMeta, type.isAcceptableOrUnknown(data['type']!, _typeMeta), ); } else if (isInserting) { context.missing(_typeMeta); } if (data.containsKey('status')) { context.handle( _statusMeta, status.isAcceptableOrUnknown(data['status']!, _statusMeta), ); } else if (isInserting) { context.missing(_statusMeta); } if (data.containsKey('title')) { context.handle( _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta), ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('protocol_id')) { context.handle( _protocolIdMeta, protocolId.isAcceptableOrUnknown(data['protocol_id']!, _protocolIdMeta), ); } if (data.containsKey('break_protocol_id')) { context.handle( _breakProtocolIdMeta, breakProtocolId.isAcceptableOrUnknown( data['break_protocol_id']!, _breakProtocolIdMeta, ), ); } if (data.containsKey('common_frame_ids_json')) { context.handle( _commonFrameIdsJsonMeta, commonFrameIdsJson.isAcceptableOrUnknown( data['common_frame_ids_json']!, _commonFrameIdsJsonMeta, ), ); } if (data.containsKey('frame_level')) { context.handle( _frameLevelMeta, frameLevel.isAcceptableOrUnknown(data['frame_level']!, _frameLevelMeta), ); } else if (isInserting) { context.missing(_frameLevelMeta); } if (data.containsKey('frame_original_text')) { context.handle( _frameOriginalTextMeta, frameOriginalText.isAcceptableOrUnknown( data['frame_original_text']!, _frameOriginalTextMeta, ), ); } if (data.containsKey('frame_framed_text')) { context.handle( _frameFramedTextMeta, frameFramedText.isAcceptableOrUnknown( data['frame_framed_text']!, _frameFramedTextMeta, ), ); } else if (isInserting) { context.missing(_frameFramedTextMeta); } if (data.containsKey('anchor_when')) { context.handle( _anchorWhenMeta, anchorWhen.isAcceptableOrUnknown(data['anchor_when']!, _anchorWhenMeta), ); } if (data.containsKey('anchor_after_what')) { context.handle( _anchorAfterWhatMeta, anchorAfterWhat.isAcceptableOrUnknown( data['anchor_after_what']!, _anchorAfterWhatMeta, ), ); } if (data.containsKey('anchor_where')) { context.handle( _anchorWhereMeta, anchorWhere.isAcceptableOrUnknown( data['anchor_where']!, _anchorWhereMeta, ), ); } if (data.containsKey('stack_position')) { context.handle( _stackPositionMeta, stackPosition.isAcceptableOrUnknown( data['stack_position']!, _stackPositionMeta, ), ); } if (data.containsKey('min_dose')) { context.handle( _minDoseMeta, minDose.isAcceptableOrUnknown(data['min_dose']!, _minDoseMeta), ); } if (data.containsKey('target_dose')) { context.handle( _targetDoseMeta, targetDose.isAcceptableOrUnknown(data['target_dose']!, _targetDoseMeta), ); } if (data.containsKey('started_at')) { context.handle( _startedAtMeta, startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta), ); } else if (isInserting) { context.missing(_startedAtMeta); } if (data.containsKey('ended_at')) { context.handle( _endedAtMeta, endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta), ); } if (data.containsKey('tags_json')) { context.handle( _tagsJsonMeta, tagsJson.isAcceptableOrUnknown(data['tags_json']!, _tagsJsonMeta), ); } return context; } @override Set get $primaryKey => {id}; @override Habit map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Habit( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, userId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}user_id'], )!, phaseId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}phase_id'], ), type: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}type'], )!, status: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}status'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, protocolId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}protocol_id'], ), breakProtocolId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}break_protocol_id'], ), commonFrameIdsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}common_frame_ids_json'], ), frameLevel: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}frame_level'], )!, frameOriginalText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}frame_original_text'], ), frameFramedText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}frame_framed_text'], )!, anchorWhen: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}anchor_when'], ), anchorAfterWhat: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}anchor_after_what'], ), anchorWhere: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}anchor_where'], ), stackPosition: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}stack_position'], ), minDose: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}min_dose'], ), targetDose: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}target_dose'], ), startedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}started_at'], )!, endedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}ended_at'], ), tagsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tags_json'], ), ); } @override $HabitsTable createAlias(String alias) { return $HabitsTable(attachedDatabase, alias); } } class Habit extends DataClass implements Insertable { final String id; final String userId; final String? phaseId; final String type; final String status; final String title; final String? protocolId; final String? breakProtocolId; final String? commonFrameIdsJson; final String frameLevel; final String? frameOriginalText; final String frameFramedText; final String? anchorWhen; final String? anchorAfterWhat; final String? anchorWhere; final int? stackPosition; final String? minDose; final String? targetDose; final String startedAt; final String? endedAt; final String? tagsJson; const Habit({ required this.id, required this.userId, this.phaseId, required this.type, required this.status, required this.title, this.protocolId, this.breakProtocolId, this.commonFrameIdsJson, required this.frameLevel, this.frameOriginalText, required this.frameFramedText, this.anchorWhen, this.anchorAfterWhat, this.anchorWhere, this.stackPosition, this.minDose, this.targetDose, required this.startedAt, this.endedAt, this.tagsJson, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['user_id'] = Variable(userId); if (!nullToAbsent || phaseId != null) { map['phase_id'] = Variable(phaseId); } map['type'] = Variable(type); map['status'] = Variable(status); map['title'] = Variable(title); if (!nullToAbsent || protocolId != null) { map['protocol_id'] = Variable(protocolId); } if (!nullToAbsent || breakProtocolId != null) { map['break_protocol_id'] = Variable(breakProtocolId); } if (!nullToAbsent || commonFrameIdsJson != null) { map['common_frame_ids_json'] = Variable(commonFrameIdsJson); } map['frame_level'] = Variable(frameLevel); if (!nullToAbsent || frameOriginalText != null) { map['frame_original_text'] = Variable(frameOriginalText); } map['frame_framed_text'] = Variable(frameFramedText); if (!nullToAbsent || anchorWhen != null) { map['anchor_when'] = Variable(anchorWhen); } if (!nullToAbsent || anchorAfterWhat != null) { map['anchor_after_what'] = Variable(anchorAfterWhat); } if (!nullToAbsent || anchorWhere != null) { map['anchor_where'] = Variable(anchorWhere); } if (!nullToAbsent || stackPosition != null) { map['stack_position'] = Variable(stackPosition); } if (!nullToAbsent || minDose != null) { map['min_dose'] = Variable(minDose); } if (!nullToAbsent || targetDose != null) { map['target_dose'] = Variable(targetDose); } map['started_at'] = Variable(startedAt); if (!nullToAbsent || endedAt != null) { map['ended_at'] = Variable(endedAt); } if (!nullToAbsent || tagsJson != null) { map['tags_json'] = Variable(tagsJson); } return map; } HabitsCompanion toCompanion(bool nullToAbsent) { return HabitsCompanion( id: Value(id), userId: Value(userId), phaseId: phaseId == null && nullToAbsent ? const Value.absent() : Value(phaseId), type: Value(type), status: Value(status), title: Value(title), protocolId: protocolId == null && nullToAbsent ? const Value.absent() : Value(protocolId), breakProtocolId: breakProtocolId == null && nullToAbsent ? const Value.absent() : Value(breakProtocolId), commonFrameIdsJson: commonFrameIdsJson == null && nullToAbsent ? const Value.absent() : Value(commonFrameIdsJson), frameLevel: Value(frameLevel), frameOriginalText: frameOriginalText == null && nullToAbsent ? const Value.absent() : Value(frameOriginalText), frameFramedText: Value(frameFramedText), anchorWhen: anchorWhen == null && nullToAbsent ? const Value.absent() : Value(anchorWhen), anchorAfterWhat: anchorAfterWhat == null && nullToAbsent ? const Value.absent() : Value(anchorAfterWhat), anchorWhere: anchorWhere == null && nullToAbsent ? const Value.absent() : Value(anchorWhere), stackPosition: stackPosition == null && nullToAbsent ? const Value.absent() : Value(stackPosition), minDose: minDose == null && nullToAbsent ? const Value.absent() : Value(minDose), targetDose: targetDose == null && nullToAbsent ? const Value.absent() : Value(targetDose), startedAt: Value(startedAt), endedAt: endedAt == null && nullToAbsent ? const Value.absent() : Value(endedAt), tagsJson: tagsJson == null && nullToAbsent ? const Value.absent() : Value(tagsJson), ); } factory Habit.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Habit( id: serializer.fromJson(json['id']), userId: serializer.fromJson(json['userId']), phaseId: serializer.fromJson(json['phaseId']), type: serializer.fromJson(json['type']), status: serializer.fromJson(json['status']), title: serializer.fromJson(json['title']), protocolId: serializer.fromJson(json['protocolId']), breakProtocolId: serializer.fromJson(json['breakProtocolId']), commonFrameIdsJson: serializer.fromJson( json['commonFrameIdsJson'], ), frameLevel: serializer.fromJson(json['frameLevel']), frameOriginalText: serializer.fromJson( json['frameOriginalText'], ), frameFramedText: serializer.fromJson(json['frameFramedText']), anchorWhen: serializer.fromJson(json['anchorWhen']), anchorAfterWhat: serializer.fromJson(json['anchorAfterWhat']), anchorWhere: serializer.fromJson(json['anchorWhere']), stackPosition: serializer.fromJson(json['stackPosition']), minDose: serializer.fromJson(json['minDose']), targetDose: serializer.fromJson(json['targetDose']), startedAt: serializer.fromJson(json['startedAt']), endedAt: serializer.fromJson(json['endedAt']), tagsJson: serializer.fromJson(json['tagsJson']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'userId': serializer.toJson(userId), 'phaseId': serializer.toJson(phaseId), 'type': serializer.toJson(type), 'status': serializer.toJson(status), 'title': serializer.toJson(title), 'protocolId': serializer.toJson(protocolId), 'breakProtocolId': serializer.toJson(breakProtocolId), 'commonFrameIdsJson': serializer.toJson(commonFrameIdsJson), 'frameLevel': serializer.toJson(frameLevel), 'frameOriginalText': serializer.toJson(frameOriginalText), 'frameFramedText': serializer.toJson(frameFramedText), 'anchorWhen': serializer.toJson(anchorWhen), 'anchorAfterWhat': serializer.toJson(anchorAfterWhat), 'anchorWhere': serializer.toJson(anchorWhere), 'stackPosition': serializer.toJson(stackPosition), 'minDose': serializer.toJson(minDose), 'targetDose': serializer.toJson(targetDose), 'startedAt': serializer.toJson(startedAt), 'endedAt': serializer.toJson(endedAt), 'tagsJson': serializer.toJson(tagsJson), }; } Habit copyWith({ String? id, String? userId, Value phaseId = const Value.absent(), String? type, String? status, String? title, Value protocolId = const Value.absent(), Value breakProtocolId = const Value.absent(), Value commonFrameIdsJson = const Value.absent(), String? frameLevel, Value frameOriginalText = const Value.absent(), String? frameFramedText, Value anchorWhen = const Value.absent(), Value anchorAfterWhat = const Value.absent(), Value anchorWhere = const Value.absent(), Value stackPosition = const Value.absent(), Value minDose = const Value.absent(), Value targetDose = const Value.absent(), String? startedAt, Value endedAt = const Value.absent(), Value tagsJson = const Value.absent(), }) => Habit( id: id ?? this.id, userId: userId ?? this.userId, phaseId: phaseId.present ? phaseId.value : this.phaseId, type: type ?? this.type, status: status ?? this.status, title: title ?? this.title, protocolId: protocolId.present ? protocolId.value : this.protocolId, breakProtocolId: breakProtocolId.present ? breakProtocolId.value : this.breakProtocolId, commonFrameIdsJson: commonFrameIdsJson.present ? commonFrameIdsJson.value : this.commonFrameIdsJson, frameLevel: frameLevel ?? this.frameLevel, frameOriginalText: frameOriginalText.present ? frameOriginalText.value : this.frameOriginalText, frameFramedText: frameFramedText ?? this.frameFramedText, anchorWhen: anchorWhen.present ? anchorWhen.value : this.anchorWhen, anchorAfterWhat: anchorAfterWhat.present ? anchorAfterWhat.value : this.anchorAfterWhat, anchorWhere: anchorWhere.present ? anchorWhere.value : this.anchorWhere, stackPosition: stackPosition.present ? stackPosition.value : this.stackPosition, minDose: minDose.present ? minDose.value : this.minDose, targetDose: targetDose.present ? targetDose.value : this.targetDose, startedAt: startedAt ?? this.startedAt, endedAt: endedAt.present ? endedAt.value : this.endedAt, tagsJson: tagsJson.present ? tagsJson.value : this.tagsJson, ); Habit copyWithCompanion(HabitsCompanion data) { return Habit( id: data.id.present ? data.id.value : this.id, userId: data.userId.present ? data.userId.value : this.userId, phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId, type: data.type.present ? data.type.value : this.type, status: data.status.present ? data.status.value : this.status, title: data.title.present ? data.title.value : this.title, protocolId: data.protocolId.present ? data.protocolId.value : this.protocolId, breakProtocolId: data.breakProtocolId.present ? data.breakProtocolId.value : this.breakProtocolId, commonFrameIdsJson: data.commonFrameIdsJson.present ? data.commonFrameIdsJson.value : this.commonFrameIdsJson, frameLevel: data.frameLevel.present ? data.frameLevel.value : this.frameLevel, frameOriginalText: data.frameOriginalText.present ? data.frameOriginalText.value : this.frameOriginalText, frameFramedText: data.frameFramedText.present ? data.frameFramedText.value : this.frameFramedText, anchorWhen: data.anchorWhen.present ? data.anchorWhen.value : this.anchorWhen, anchorAfterWhat: data.anchorAfterWhat.present ? data.anchorAfterWhat.value : this.anchorAfterWhat, anchorWhere: data.anchorWhere.present ? data.anchorWhere.value : this.anchorWhere, stackPosition: data.stackPosition.present ? data.stackPosition.value : this.stackPosition, minDose: data.minDose.present ? data.minDose.value : this.minDose, targetDose: data.targetDose.present ? data.targetDose.value : this.targetDose, startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt, endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt, tagsJson: data.tagsJson.present ? data.tagsJson.value : this.tagsJson, ); } @override String toString() { return (StringBuffer('Habit(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('phaseId: $phaseId, ') ..write('type: $type, ') ..write('status: $status, ') ..write('title: $title, ') ..write('protocolId: $protocolId, ') ..write('breakProtocolId: $breakProtocolId, ') ..write('commonFrameIdsJson: $commonFrameIdsJson, ') ..write('frameLevel: $frameLevel, ') ..write('frameOriginalText: $frameOriginalText, ') ..write('frameFramedText: $frameFramedText, ') ..write('anchorWhen: $anchorWhen, ') ..write('anchorAfterWhat: $anchorAfterWhat, ') ..write('anchorWhere: $anchorWhere, ') ..write('stackPosition: $stackPosition, ') ..write('minDose: $minDose, ') ..write('targetDose: $targetDose, ') ..write('startedAt: $startedAt, ') ..write('endedAt: $endedAt, ') ..write('tagsJson: $tagsJson') ..write(')')) .toString(); } @override int get hashCode => Object.hashAll([ id, userId, phaseId, type, status, title, protocolId, breakProtocolId, commonFrameIdsJson, frameLevel, frameOriginalText, frameFramedText, anchorWhen, anchorAfterWhat, anchorWhere, stackPosition, minDose, targetDose, startedAt, endedAt, tagsJson, ]); @override bool operator ==(Object other) => identical(this, other) || (other is Habit && other.id == this.id && other.userId == this.userId && other.phaseId == this.phaseId && other.type == this.type && other.status == this.status && other.title == this.title && other.protocolId == this.protocolId && other.breakProtocolId == this.breakProtocolId && other.commonFrameIdsJson == this.commonFrameIdsJson && other.frameLevel == this.frameLevel && other.frameOriginalText == this.frameOriginalText && other.frameFramedText == this.frameFramedText && other.anchorWhen == this.anchorWhen && other.anchorAfterWhat == this.anchorAfterWhat && other.anchorWhere == this.anchorWhere && other.stackPosition == this.stackPosition && other.minDose == this.minDose && other.targetDose == this.targetDose && other.startedAt == this.startedAt && other.endedAt == this.endedAt && other.tagsJson == this.tagsJson); } class HabitsCompanion extends UpdateCompanion { final Value id; final Value userId; final Value phaseId; final Value type; final Value status; final Value title; final Value protocolId; final Value breakProtocolId; final Value commonFrameIdsJson; final Value frameLevel; final Value frameOriginalText; final Value frameFramedText; final Value anchorWhen; final Value anchorAfterWhat; final Value anchorWhere; final Value stackPosition; final Value minDose; final Value targetDose; final Value startedAt; final Value endedAt; final Value tagsJson; final Value rowid; const HabitsCompanion({ this.id = const Value.absent(), this.userId = const Value.absent(), this.phaseId = const Value.absent(), this.type = const Value.absent(), this.status = const Value.absent(), this.title = const Value.absent(), this.protocolId = const Value.absent(), this.breakProtocolId = const Value.absent(), this.commonFrameIdsJson = const Value.absent(), this.frameLevel = const Value.absent(), this.frameOriginalText = const Value.absent(), this.frameFramedText = const Value.absent(), this.anchorWhen = const Value.absent(), this.anchorAfterWhat = const Value.absent(), this.anchorWhere = const Value.absent(), this.stackPosition = const Value.absent(), this.minDose = const Value.absent(), this.targetDose = const Value.absent(), this.startedAt = const Value.absent(), this.endedAt = const Value.absent(), this.tagsJson = const Value.absent(), this.rowid = const Value.absent(), }); HabitsCompanion.insert({ required String id, required String userId, this.phaseId = const Value.absent(), required String type, required String status, required String title, this.protocolId = const Value.absent(), this.breakProtocolId = const Value.absent(), this.commonFrameIdsJson = const Value.absent(), required String frameLevel, this.frameOriginalText = const Value.absent(), required String frameFramedText, this.anchorWhen = const Value.absent(), this.anchorAfterWhat = const Value.absent(), this.anchorWhere = const Value.absent(), this.stackPosition = const Value.absent(), this.minDose = const Value.absent(), this.targetDose = const Value.absent(), required String startedAt, this.endedAt = const Value.absent(), this.tagsJson = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), userId = Value(userId), type = Value(type), status = Value(status), title = Value(title), frameLevel = Value(frameLevel), frameFramedText = Value(frameFramedText), startedAt = Value(startedAt); static Insertable custom({ Expression? id, Expression? userId, Expression? phaseId, Expression? type, Expression? status, Expression? title, Expression? protocolId, Expression? breakProtocolId, Expression? commonFrameIdsJson, Expression? frameLevel, Expression? frameOriginalText, Expression? frameFramedText, Expression? anchorWhen, Expression? anchorAfterWhat, Expression? anchorWhere, Expression? stackPosition, Expression? minDose, Expression? targetDose, Expression? startedAt, Expression? endedAt, Expression? tagsJson, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (userId != null) 'user_id': userId, if (phaseId != null) 'phase_id': phaseId, if (type != null) 'type': type, if (status != null) 'status': status, if (title != null) 'title': title, if (protocolId != null) 'protocol_id': protocolId, if (breakProtocolId != null) 'break_protocol_id': breakProtocolId, if (commonFrameIdsJson != null) 'common_frame_ids_json': commonFrameIdsJson, if (frameLevel != null) 'frame_level': frameLevel, if (frameOriginalText != null) 'frame_original_text': frameOriginalText, if (frameFramedText != null) 'frame_framed_text': frameFramedText, if (anchorWhen != null) 'anchor_when': anchorWhen, if (anchorAfterWhat != null) 'anchor_after_what': anchorAfterWhat, if (anchorWhere != null) 'anchor_where': anchorWhere, if (stackPosition != null) 'stack_position': stackPosition, if (minDose != null) 'min_dose': minDose, if (targetDose != null) 'target_dose': targetDose, if (startedAt != null) 'started_at': startedAt, if (endedAt != null) 'ended_at': endedAt, if (tagsJson != null) 'tags_json': tagsJson, if (rowid != null) 'rowid': rowid, }); } HabitsCompanion copyWith({ Value? id, Value? userId, Value? phaseId, Value? type, Value? status, Value? title, Value? protocolId, Value? breakProtocolId, Value? commonFrameIdsJson, Value? frameLevel, Value? frameOriginalText, Value? frameFramedText, Value? anchorWhen, Value? anchorAfterWhat, Value? anchorWhere, Value? stackPosition, Value? minDose, Value? targetDose, Value? startedAt, Value? endedAt, Value? tagsJson, Value? rowid, }) { return HabitsCompanion( id: id ?? this.id, userId: userId ?? this.userId, phaseId: phaseId ?? this.phaseId, type: type ?? this.type, status: status ?? this.status, title: title ?? this.title, protocolId: protocolId ?? this.protocolId, breakProtocolId: breakProtocolId ?? this.breakProtocolId, commonFrameIdsJson: commonFrameIdsJson ?? this.commonFrameIdsJson, frameLevel: frameLevel ?? this.frameLevel, frameOriginalText: frameOriginalText ?? this.frameOriginalText, frameFramedText: frameFramedText ?? this.frameFramedText, anchorWhen: anchorWhen ?? this.anchorWhen, anchorAfterWhat: anchorAfterWhat ?? this.anchorAfterWhat, anchorWhere: anchorWhere ?? this.anchorWhere, stackPosition: stackPosition ?? this.stackPosition, minDose: minDose ?? this.minDose, targetDose: targetDose ?? this.targetDose, startedAt: startedAt ?? this.startedAt, endedAt: endedAt ?? this.endedAt, tagsJson: tagsJson ?? this.tagsJson, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (userId.present) { map['user_id'] = Variable(userId.value); } if (phaseId.present) { map['phase_id'] = Variable(phaseId.value); } if (type.present) { map['type'] = Variable(type.value); } if (status.present) { map['status'] = Variable(status.value); } if (title.present) { map['title'] = Variable(title.value); } if (protocolId.present) { map['protocol_id'] = Variable(protocolId.value); } if (breakProtocolId.present) { map['break_protocol_id'] = Variable(breakProtocolId.value); } if (commonFrameIdsJson.present) { map['common_frame_ids_json'] = Variable(commonFrameIdsJson.value); } if (frameLevel.present) { map['frame_level'] = Variable(frameLevel.value); } if (frameOriginalText.present) { map['frame_original_text'] = Variable(frameOriginalText.value); } if (frameFramedText.present) { map['frame_framed_text'] = Variable(frameFramedText.value); } if (anchorWhen.present) { map['anchor_when'] = Variable(anchorWhen.value); } if (anchorAfterWhat.present) { map['anchor_after_what'] = Variable(anchorAfterWhat.value); } if (anchorWhere.present) { map['anchor_where'] = Variable(anchorWhere.value); } if (stackPosition.present) { map['stack_position'] = Variable(stackPosition.value); } if (minDose.present) { map['min_dose'] = Variable(minDose.value); } if (targetDose.present) { map['target_dose'] = Variable(targetDose.value); } if (startedAt.present) { map['started_at'] = Variable(startedAt.value); } if (endedAt.present) { map['ended_at'] = Variable(endedAt.value); } if (tagsJson.present) { map['tags_json'] = Variable(tagsJson.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('HabitsCompanion(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('phaseId: $phaseId, ') ..write('type: $type, ') ..write('status: $status, ') ..write('title: $title, ') ..write('protocolId: $protocolId, ') ..write('breakProtocolId: $breakProtocolId, ') ..write('commonFrameIdsJson: $commonFrameIdsJson, ') ..write('frameLevel: $frameLevel, ') ..write('frameOriginalText: $frameOriginalText, ') ..write('frameFramedText: $frameFramedText, ') ..write('anchorWhen: $anchorWhen, ') ..write('anchorAfterWhat: $anchorAfterWhat, ') ..write('anchorWhere: $anchorWhere, ') ..write('stackPosition: $stackPosition, ') ..write('minDose: $minDose, ') ..write('targetDose: $targetDose, ') ..write('startedAt: $startedAt, ') ..write('endedAt: $endedAt, ') ..write('tagsJson: $tagsJson, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $HabitDoseVariantsTable extends HabitDoseVariants with TableInfo<$HabitDoseVariantsTable, HabitDoseVariant> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $HabitDoseVariantsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _variantIdMeta = const VerificationMeta( 'variantId', ); @override late final GeneratedColumn variantId = GeneratedColumn( 'variant_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) ON DELETE CASCADE NOT NULL', ); static const VerificationMeta _labelMeta = const VerificationMeta('label'); @override late final GeneratedColumn label = GeneratedColumn( 'label', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _doseTextMeta = const VerificationMeta( 'doseText', ); @override late final GeneratedColumn doseText = GeneratedColumn( 'dose_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _contextTagsJsonMeta = const VerificationMeta( 'contextTagsJson', ); @override late final GeneratedColumn contextTagsJson = GeneratedColumn( 'context_tags_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _conditionTagsJsonMeta = const VerificationMeta( 'conditionTagsJson', ); @override late final GeneratedColumn conditionTagsJson = GeneratedColumn( 'condition_tags_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _isMinimumMeta = const VerificationMeta( 'isMinimum', ); @override late final GeneratedColumn isMinimum = GeneratedColumn( 'is_minimum', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_minimum" IN (0, 1))', ), defaultValue: const Constant(false), ); static const VerificationMeta _sortOrderMeta = const VerificationMeta( 'sortOrder', ); @override late final GeneratedColumn sortOrder = GeneratedColumn( 'sort_order', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const Constant(0), ); @override List get $columns => [ variantId, habitId, label, doseText, contextTagsJson, conditionTagsJson, isMinimum, sortOrder, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'habit_dose_variants'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('variant_id')) { context.handle( _variantIdMeta, variantId.isAcceptableOrUnknown(data['variant_id']!, _variantIdMeta), ); } else if (isInserting) { context.missing(_variantIdMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('label')) { context.handle( _labelMeta, label.isAcceptableOrUnknown(data['label']!, _labelMeta), ); } else if (isInserting) { context.missing(_labelMeta); } if (data.containsKey('dose_text')) { context.handle( _doseTextMeta, doseText.isAcceptableOrUnknown(data['dose_text']!, _doseTextMeta), ); } else if (isInserting) { context.missing(_doseTextMeta); } if (data.containsKey('context_tags_json')) { context.handle( _contextTagsJsonMeta, contextTagsJson.isAcceptableOrUnknown( data['context_tags_json']!, _contextTagsJsonMeta, ), ); } if (data.containsKey('condition_tags_json')) { context.handle( _conditionTagsJsonMeta, conditionTagsJson.isAcceptableOrUnknown( data['condition_tags_json']!, _conditionTagsJsonMeta, ), ); } if (data.containsKey('is_minimum')) { context.handle( _isMinimumMeta, isMinimum.isAcceptableOrUnknown(data['is_minimum']!, _isMinimumMeta), ); } if (data.containsKey('sort_order')) { context.handle( _sortOrderMeta, sortOrder.isAcceptableOrUnknown(data['sort_order']!, _sortOrderMeta), ); } return context; } @override Set get $primaryKey => {variantId}; @override HabitDoseVariant map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return HabitDoseVariant( variantId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}variant_id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, label: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}label'], )!, doseText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}dose_text'], )!, contextTagsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}context_tags_json'], ), conditionTagsJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}condition_tags_json'], ), isMinimum: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}is_minimum'], )!, sortOrder: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}sort_order'], )!, ); } @override $HabitDoseVariantsTable createAlias(String alias) { return $HabitDoseVariantsTable(attachedDatabase, alias); } } class HabitDoseVariant extends DataClass implements Insertable { final String variantId; final String habitId; final String label; final String doseText; final String? contextTagsJson; final String? conditionTagsJson; final bool isMinimum; final int sortOrder; const HabitDoseVariant({ required this.variantId, required this.habitId, required this.label, required this.doseText, this.contextTagsJson, this.conditionTagsJson, required this.isMinimum, required this.sortOrder, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['variant_id'] = Variable(variantId); map['habit_id'] = Variable(habitId); map['label'] = Variable(label); map['dose_text'] = Variable(doseText); if (!nullToAbsent || contextTagsJson != null) { map['context_tags_json'] = Variable(contextTagsJson); } if (!nullToAbsent || conditionTagsJson != null) { map['condition_tags_json'] = Variable(conditionTagsJson); } map['is_minimum'] = Variable(isMinimum); map['sort_order'] = Variable(sortOrder); return map; } HabitDoseVariantsCompanion toCompanion(bool nullToAbsent) { return HabitDoseVariantsCompanion( variantId: Value(variantId), habitId: Value(habitId), label: Value(label), doseText: Value(doseText), contextTagsJson: contextTagsJson == null && nullToAbsent ? const Value.absent() : Value(contextTagsJson), conditionTagsJson: conditionTagsJson == null && nullToAbsent ? const Value.absent() : Value(conditionTagsJson), isMinimum: Value(isMinimum), sortOrder: Value(sortOrder), ); } factory HabitDoseVariant.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return HabitDoseVariant( variantId: serializer.fromJson(json['variantId']), habitId: serializer.fromJson(json['habitId']), label: serializer.fromJson(json['label']), doseText: serializer.fromJson(json['doseText']), contextTagsJson: serializer.fromJson(json['contextTagsJson']), conditionTagsJson: serializer.fromJson( json['conditionTagsJson'], ), isMinimum: serializer.fromJson(json['isMinimum']), sortOrder: serializer.fromJson(json['sortOrder']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'variantId': serializer.toJson(variantId), 'habitId': serializer.toJson(habitId), 'label': serializer.toJson(label), 'doseText': serializer.toJson(doseText), 'contextTagsJson': serializer.toJson(contextTagsJson), 'conditionTagsJson': serializer.toJson(conditionTagsJson), 'isMinimum': serializer.toJson(isMinimum), 'sortOrder': serializer.toJson(sortOrder), }; } HabitDoseVariant copyWith({ String? variantId, String? habitId, String? label, String? doseText, Value contextTagsJson = const Value.absent(), Value conditionTagsJson = const Value.absent(), bool? isMinimum, int? sortOrder, }) => HabitDoseVariant( variantId: variantId ?? this.variantId, habitId: habitId ?? this.habitId, label: label ?? this.label, doseText: doseText ?? this.doseText, contextTagsJson: contextTagsJson.present ? contextTagsJson.value : this.contextTagsJson, conditionTagsJson: conditionTagsJson.present ? conditionTagsJson.value : this.conditionTagsJson, isMinimum: isMinimum ?? this.isMinimum, sortOrder: sortOrder ?? this.sortOrder, ); HabitDoseVariant copyWithCompanion(HabitDoseVariantsCompanion data) { return HabitDoseVariant( variantId: data.variantId.present ? data.variantId.value : this.variantId, habitId: data.habitId.present ? data.habitId.value : this.habitId, label: data.label.present ? data.label.value : this.label, doseText: data.doseText.present ? data.doseText.value : this.doseText, contextTagsJson: data.contextTagsJson.present ? data.contextTagsJson.value : this.contextTagsJson, conditionTagsJson: data.conditionTagsJson.present ? data.conditionTagsJson.value : this.conditionTagsJson, isMinimum: data.isMinimum.present ? data.isMinimum.value : this.isMinimum, sortOrder: data.sortOrder.present ? data.sortOrder.value : this.sortOrder, ); } @override String toString() { return (StringBuffer('HabitDoseVariant(') ..write('variantId: $variantId, ') ..write('habitId: $habitId, ') ..write('label: $label, ') ..write('doseText: $doseText, ') ..write('contextTagsJson: $contextTagsJson, ') ..write('conditionTagsJson: $conditionTagsJson, ') ..write('isMinimum: $isMinimum, ') ..write('sortOrder: $sortOrder') ..write(')')) .toString(); } @override int get hashCode => Object.hash( variantId, habitId, label, doseText, contextTagsJson, conditionTagsJson, isMinimum, sortOrder, ); @override bool operator ==(Object other) => identical(this, other) || (other is HabitDoseVariant && other.variantId == this.variantId && other.habitId == this.habitId && other.label == this.label && other.doseText == this.doseText && other.contextTagsJson == this.contextTagsJson && other.conditionTagsJson == this.conditionTagsJson && other.isMinimum == this.isMinimum && other.sortOrder == this.sortOrder); } class HabitDoseVariantsCompanion extends UpdateCompanion { final Value variantId; final Value habitId; final Value label; final Value doseText; final Value contextTagsJson; final Value conditionTagsJson; final Value isMinimum; final Value sortOrder; final Value rowid; const HabitDoseVariantsCompanion({ this.variantId = const Value.absent(), this.habitId = const Value.absent(), this.label = const Value.absent(), this.doseText = const Value.absent(), this.contextTagsJson = const Value.absent(), this.conditionTagsJson = const Value.absent(), this.isMinimum = const Value.absent(), this.sortOrder = const Value.absent(), this.rowid = const Value.absent(), }); HabitDoseVariantsCompanion.insert({ required String variantId, required String habitId, required String label, required String doseText, this.contextTagsJson = const Value.absent(), this.conditionTagsJson = const Value.absent(), this.isMinimum = const Value.absent(), this.sortOrder = const Value.absent(), this.rowid = const Value.absent(), }) : variantId = Value(variantId), habitId = Value(habitId), label = Value(label), doseText = Value(doseText); static Insertable custom({ Expression? variantId, Expression? habitId, Expression? label, Expression? doseText, Expression? contextTagsJson, Expression? conditionTagsJson, Expression? isMinimum, Expression? sortOrder, Expression? rowid, }) { return RawValuesInsertable({ if (variantId != null) 'variant_id': variantId, if (habitId != null) 'habit_id': habitId, if (label != null) 'label': label, if (doseText != null) 'dose_text': doseText, if (contextTagsJson != null) 'context_tags_json': contextTagsJson, if (conditionTagsJson != null) 'condition_tags_json': conditionTagsJson, if (isMinimum != null) 'is_minimum': isMinimum, if (sortOrder != null) 'sort_order': sortOrder, if (rowid != null) 'rowid': rowid, }); } HabitDoseVariantsCompanion copyWith({ Value? variantId, Value? habitId, Value? label, Value? doseText, Value? contextTagsJson, Value? conditionTagsJson, Value? isMinimum, Value? sortOrder, Value? rowid, }) { return HabitDoseVariantsCompanion( variantId: variantId ?? this.variantId, habitId: habitId ?? this.habitId, label: label ?? this.label, doseText: doseText ?? this.doseText, contextTagsJson: contextTagsJson ?? this.contextTagsJson, conditionTagsJson: conditionTagsJson ?? this.conditionTagsJson, isMinimum: isMinimum ?? this.isMinimum, sortOrder: sortOrder ?? this.sortOrder, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (variantId.present) { map['variant_id'] = Variable(variantId.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (label.present) { map['label'] = Variable(label.value); } if (doseText.present) { map['dose_text'] = Variable(doseText.value); } if (contextTagsJson.present) { map['context_tags_json'] = Variable(contextTagsJson.value); } if (conditionTagsJson.present) { map['condition_tags_json'] = Variable(conditionTagsJson.value); } if (isMinimum.present) { map['is_minimum'] = Variable(isMinimum.value); } if (sortOrder.present) { map['sort_order'] = Variable(sortOrder.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('HabitDoseVariantsCompanion(') ..write('variantId: $variantId, ') ..write('habitId: $habitId, ') ..write('label: $label, ') ..write('doseText: $doseText, ') ..write('contextTagsJson: $contextTagsJson, ') ..write('conditionTagsJson: $conditionTagsJson, ') ..write('isMinimum: $isMinimum, ') ..write('sortOrder: $sortOrder, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $IfThenRulesTable extends IfThenRules with TableInfo<$IfThenRulesTable, IfThenRule> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $IfThenRulesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) ON DELETE CASCADE NOT NULL', ); static const VerificationMeta _ifConditionMeta = const VerificationMeta( 'ifCondition', ); @override late final GeneratedColumn ifCondition = GeneratedColumn( 'if_condition', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _thenActionMeta = const VerificationMeta( 'thenAction', ); @override late final GeneratedColumn thenAction = GeneratedColumn( 'then_action', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _triggerTypeMeta = const VerificationMeta( 'triggerType', ); @override late final GeneratedColumn triggerType = GeneratedColumn( 'trigger_type', aliasedName, true, check: () => const CustomExpression( "trigger_type IS NULL OR trigger_type IN ('time','location','emotion','preceding_action','urge')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _priorityMeta = const VerificationMeta( 'priority', ); @override late final GeneratedColumn priority = GeneratedColumn( 'priority', aliasedName, false, check: () => const CustomExpression("priority BETWEEN 1 AND 3"), type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const Constant(1), ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, habitId, ifCondition, thenAction, triggerType, priority, createdAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'if_then_rules'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('if_condition')) { context.handle( _ifConditionMeta, ifCondition.isAcceptableOrUnknown( data['if_condition']!, _ifConditionMeta, ), ); } else if (isInserting) { context.missing(_ifConditionMeta); } if (data.containsKey('then_action')) { context.handle( _thenActionMeta, thenAction.isAcceptableOrUnknown(data['then_action']!, _thenActionMeta), ); } else if (isInserting) { context.missing(_thenActionMeta); } if (data.containsKey('trigger_type')) { context.handle( _triggerTypeMeta, triggerType.isAcceptableOrUnknown( data['trigger_type']!, _triggerTypeMeta, ), ); } if (data.containsKey('priority')) { context.handle( _priorityMeta, priority.isAcceptableOrUnknown(data['priority']!, _priorityMeta), ); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } return context; } @override Set get $primaryKey => {id}; @override IfThenRule map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return IfThenRule( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, ifCondition: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}if_condition'], )!, thenAction: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}then_action'], )!, triggerType: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}trigger_type'], ), priority: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}priority'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}created_at'], ), ); } @override $IfThenRulesTable createAlias(String alias) { return $IfThenRulesTable(attachedDatabase, alias); } } class IfThenRule extends DataClass implements Insertable { final String id; final String habitId; final String ifCondition; final String thenAction; final String? triggerType; final int priority; final String? createdAt; const IfThenRule({ required this.id, required this.habitId, required this.ifCondition, required this.thenAction, this.triggerType, required this.priority, this.createdAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['habit_id'] = Variable(habitId); map['if_condition'] = Variable(ifCondition); map['then_action'] = Variable(thenAction); if (!nullToAbsent || triggerType != null) { map['trigger_type'] = Variable(triggerType); } map['priority'] = Variable(priority); if (!nullToAbsent || createdAt != null) { map['created_at'] = Variable(createdAt); } return map; } IfThenRulesCompanion toCompanion(bool nullToAbsent) { return IfThenRulesCompanion( id: Value(id), habitId: Value(habitId), ifCondition: Value(ifCondition), thenAction: Value(thenAction), triggerType: triggerType == null && nullToAbsent ? const Value.absent() : Value(triggerType), priority: Value(priority), createdAt: createdAt == null && nullToAbsent ? const Value.absent() : Value(createdAt), ); } factory IfThenRule.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return IfThenRule( id: serializer.fromJson(json['id']), habitId: serializer.fromJson(json['habitId']), ifCondition: serializer.fromJson(json['ifCondition']), thenAction: serializer.fromJson(json['thenAction']), triggerType: serializer.fromJson(json['triggerType']), priority: serializer.fromJson(json['priority']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'habitId': serializer.toJson(habitId), 'ifCondition': serializer.toJson(ifCondition), 'thenAction': serializer.toJson(thenAction), 'triggerType': serializer.toJson(triggerType), 'priority': serializer.toJson(priority), 'createdAt': serializer.toJson(createdAt), }; } IfThenRule copyWith({ String? id, String? habitId, String? ifCondition, String? thenAction, Value triggerType = const Value.absent(), int? priority, Value createdAt = const Value.absent(), }) => IfThenRule( id: id ?? this.id, habitId: habitId ?? this.habitId, ifCondition: ifCondition ?? this.ifCondition, thenAction: thenAction ?? this.thenAction, triggerType: triggerType.present ? triggerType.value : this.triggerType, priority: priority ?? this.priority, createdAt: createdAt.present ? createdAt.value : this.createdAt, ); IfThenRule copyWithCompanion(IfThenRulesCompanion data) { return IfThenRule( id: data.id.present ? data.id.value : this.id, habitId: data.habitId.present ? data.habitId.value : this.habitId, ifCondition: data.ifCondition.present ? data.ifCondition.value : this.ifCondition, thenAction: data.thenAction.present ? data.thenAction.value : this.thenAction, triggerType: data.triggerType.present ? data.triggerType.value : this.triggerType, priority: data.priority.present ? data.priority.value : this.priority, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('IfThenRule(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('ifCondition: $ifCondition, ') ..write('thenAction: $thenAction, ') ..write('triggerType: $triggerType, ') ..write('priority: $priority, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, habitId, ifCondition, thenAction, triggerType, priority, createdAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is IfThenRule && other.id == this.id && other.habitId == this.habitId && other.ifCondition == this.ifCondition && other.thenAction == this.thenAction && other.triggerType == this.triggerType && other.priority == this.priority && other.createdAt == this.createdAt); } class IfThenRulesCompanion extends UpdateCompanion { final Value id; final Value habitId; final Value ifCondition; final Value thenAction; final Value triggerType; final Value priority; final Value createdAt; final Value rowid; const IfThenRulesCompanion({ this.id = const Value.absent(), this.habitId = const Value.absent(), this.ifCondition = const Value.absent(), this.thenAction = const Value.absent(), this.triggerType = const Value.absent(), this.priority = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); IfThenRulesCompanion.insert({ required String id, required String habitId, required String ifCondition, required String thenAction, this.triggerType = const Value.absent(), this.priority = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), habitId = Value(habitId), ifCondition = Value(ifCondition), thenAction = Value(thenAction); static Insertable custom({ Expression? id, Expression? habitId, Expression? ifCondition, Expression? thenAction, Expression? triggerType, Expression? priority, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (habitId != null) 'habit_id': habitId, if (ifCondition != null) 'if_condition': ifCondition, if (thenAction != null) 'then_action': thenAction, if (triggerType != null) 'trigger_type': triggerType, if (priority != null) 'priority': priority, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } IfThenRulesCompanion copyWith({ Value? id, Value? habitId, Value? ifCondition, Value? thenAction, Value? triggerType, Value? priority, Value? createdAt, Value? rowid, }) { return IfThenRulesCompanion( id: id ?? this.id, habitId: habitId ?? this.habitId, ifCondition: ifCondition ?? this.ifCondition, thenAction: thenAction ?? this.thenAction, triggerType: triggerType ?? this.triggerType, priority: priority ?? this.priority, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (ifCondition.present) { map['if_condition'] = Variable(ifCondition.value); } if (thenAction.present) { map['then_action'] = Variable(thenAction.value); } if (triggerType.present) { map['trigger_type'] = Variable(triggerType.value); } if (priority.present) { map['priority'] = Variable(priority.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('IfThenRulesCompanion(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('ifCondition: $ifCondition, ') ..write('thenAction: $thenAction, ') ..write('triggerType: $triggerType, ') ..write('priority: $priority, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $TrackerEntriesTable extends TrackerEntries with TableInfo<$TrackerEntriesTable, TrackerEntry> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $TrackerEntriesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) ON DELETE RESTRICT NOT NULL', ); static const VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( 'date', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _valueMeta = const VerificationMeta('value'); @override late final GeneratedColumn value = GeneratedColumn( 'value', aliasedName, false, check: () => const CustomExpression("value IN ('done','blank')"), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _loggedAtMeta = const VerificationMeta( 'loggedAt', ); @override late final GeneratedColumn loggedAt = GeneratedColumn( 'logged_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _noteMeta = const VerificationMeta('note'); @override late final GeneratedColumn note = GeneratedColumn( 'note', aliasedName, true, check: () => const CustomExpression("note IS NULL OR length(note) <= 200"), type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _variantIdMeta = const VerificationMeta( 'variantId', ); @override late final GeneratedColumn variantId = GeneratedColumn( 'variant_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES habit_dose_variants(variant_id) ON DELETE SET NULL', ); static const VerificationMeta _ctxLocationMeta = const VerificationMeta( 'ctxLocation', ); @override late final GeneratedColumn ctxLocation = GeneratedColumn( 'ctx_location', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _ctxConditionMeta = const VerificationMeta( 'ctxCondition', ); @override late final GeneratedColumn ctxCondition = GeneratedColumn( 'ctx_condition', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, habitId, date, value, loggedAt, note, variantId, ctxLocation, ctxCondition, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'tracker_entries'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('date')) { context.handle( _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta), ); } else if (isInserting) { context.missing(_dateMeta); } if (data.containsKey('value')) { context.handle( _valueMeta, value.isAcceptableOrUnknown(data['value']!, _valueMeta), ); } else if (isInserting) { context.missing(_valueMeta); } if (data.containsKey('logged_at')) { context.handle( _loggedAtMeta, loggedAt.isAcceptableOrUnknown(data['logged_at']!, _loggedAtMeta), ); } if (data.containsKey('note')) { context.handle( _noteMeta, note.isAcceptableOrUnknown(data['note']!, _noteMeta), ); } if (data.containsKey('variant_id')) { context.handle( _variantIdMeta, variantId.isAcceptableOrUnknown(data['variant_id']!, _variantIdMeta), ); } if (data.containsKey('ctx_location')) { context.handle( _ctxLocationMeta, ctxLocation.isAcceptableOrUnknown( data['ctx_location']!, _ctxLocationMeta, ), ); } if (data.containsKey('ctx_condition')) { context.handle( _ctxConditionMeta, ctxCondition.isAcceptableOrUnknown( data['ctx_condition']!, _ctxConditionMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override TrackerEntry map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return TrackerEntry( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, date: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}date'], )!, value: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}value'], )!, loggedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}logged_at'], ), note: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}note'], ), variantId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}variant_id'], ), ctxLocation: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}ctx_location'], ), ctxCondition: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}ctx_condition'], ), ); } @override $TrackerEntriesTable createAlias(String alias) { return $TrackerEntriesTable(attachedDatabase, alias); } } class TrackerEntry extends DataClass implements Insertable { final String id; final String habitId; final String date; final String value; final String? loggedAt; final String? note; final String? variantId; final String? ctxLocation; final String? ctxCondition; const TrackerEntry({ required this.id, required this.habitId, required this.date, required this.value, this.loggedAt, this.note, this.variantId, this.ctxLocation, this.ctxCondition, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['habit_id'] = Variable(habitId); map['date'] = Variable(date); map['value'] = Variable(value); if (!nullToAbsent || loggedAt != null) { map['logged_at'] = Variable(loggedAt); } if (!nullToAbsent || note != null) { map['note'] = Variable(note); } if (!nullToAbsent || variantId != null) { map['variant_id'] = Variable(variantId); } if (!nullToAbsent || ctxLocation != null) { map['ctx_location'] = Variable(ctxLocation); } if (!nullToAbsent || ctxCondition != null) { map['ctx_condition'] = Variable(ctxCondition); } return map; } TrackerEntriesCompanion toCompanion(bool nullToAbsent) { return TrackerEntriesCompanion( id: Value(id), habitId: Value(habitId), date: Value(date), value: Value(value), loggedAt: loggedAt == null && nullToAbsent ? const Value.absent() : Value(loggedAt), note: note == null && nullToAbsent ? const Value.absent() : Value(note), variantId: variantId == null && nullToAbsent ? const Value.absent() : Value(variantId), ctxLocation: ctxLocation == null && nullToAbsent ? const Value.absent() : Value(ctxLocation), ctxCondition: ctxCondition == null && nullToAbsent ? const Value.absent() : Value(ctxCondition), ); } factory TrackerEntry.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return TrackerEntry( id: serializer.fromJson(json['id']), habitId: serializer.fromJson(json['habitId']), date: serializer.fromJson(json['date']), value: serializer.fromJson(json['value']), loggedAt: serializer.fromJson(json['loggedAt']), note: serializer.fromJson(json['note']), variantId: serializer.fromJson(json['variantId']), ctxLocation: serializer.fromJson(json['ctxLocation']), ctxCondition: serializer.fromJson(json['ctxCondition']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'habitId': serializer.toJson(habitId), 'date': serializer.toJson(date), 'value': serializer.toJson(value), 'loggedAt': serializer.toJson(loggedAt), 'note': serializer.toJson(note), 'variantId': serializer.toJson(variantId), 'ctxLocation': serializer.toJson(ctxLocation), 'ctxCondition': serializer.toJson(ctxCondition), }; } TrackerEntry copyWith({ String? id, String? habitId, String? date, String? value, Value loggedAt = const Value.absent(), Value note = const Value.absent(), Value variantId = const Value.absent(), Value ctxLocation = const Value.absent(), Value ctxCondition = const Value.absent(), }) => TrackerEntry( id: id ?? this.id, habitId: habitId ?? this.habitId, date: date ?? this.date, value: value ?? this.value, loggedAt: loggedAt.present ? loggedAt.value : this.loggedAt, note: note.present ? note.value : this.note, variantId: variantId.present ? variantId.value : this.variantId, ctxLocation: ctxLocation.present ? ctxLocation.value : this.ctxLocation, ctxCondition: ctxCondition.present ? ctxCondition.value : this.ctxCondition, ); TrackerEntry copyWithCompanion(TrackerEntriesCompanion data) { return TrackerEntry( id: data.id.present ? data.id.value : this.id, habitId: data.habitId.present ? data.habitId.value : this.habitId, date: data.date.present ? data.date.value : this.date, value: data.value.present ? data.value.value : this.value, loggedAt: data.loggedAt.present ? data.loggedAt.value : this.loggedAt, note: data.note.present ? data.note.value : this.note, variantId: data.variantId.present ? data.variantId.value : this.variantId, ctxLocation: data.ctxLocation.present ? data.ctxLocation.value : this.ctxLocation, ctxCondition: data.ctxCondition.present ? data.ctxCondition.value : this.ctxCondition, ); } @override String toString() { return (StringBuffer('TrackerEntry(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('date: $date, ') ..write('value: $value, ') ..write('loggedAt: $loggedAt, ') ..write('note: $note, ') ..write('variantId: $variantId, ') ..write('ctxLocation: $ctxLocation, ') ..write('ctxCondition: $ctxCondition') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, habitId, date, value, loggedAt, note, variantId, ctxLocation, ctxCondition, ); @override bool operator ==(Object other) => identical(this, other) || (other is TrackerEntry && other.id == this.id && other.habitId == this.habitId && other.date == this.date && other.value == this.value && other.loggedAt == this.loggedAt && other.note == this.note && other.variantId == this.variantId && other.ctxLocation == this.ctxLocation && other.ctxCondition == this.ctxCondition); } class TrackerEntriesCompanion extends UpdateCompanion { final Value id; final Value habitId; final Value date; final Value value; final Value loggedAt; final Value note; final Value variantId; final Value ctxLocation; final Value ctxCondition; final Value rowid; const TrackerEntriesCompanion({ this.id = const Value.absent(), this.habitId = const Value.absent(), this.date = const Value.absent(), this.value = const Value.absent(), this.loggedAt = const Value.absent(), this.note = const Value.absent(), this.variantId = const Value.absent(), this.ctxLocation = const Value.absent(), this.ctxCondition = const Value.absent(), this.rowid = const Value.absent(), }); TrackerEntriesCompanion.insert({ required String id, required String habitId, required String date, required String value, this.loggedAt = const Value.absent(), this.note = const Value.absent(), this.variantId = const Value.absent(), this.ctxLocation = const Value.absent(), this.ctxCondition = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), habitId = Value(habitId), date = Value(date), value = Value(value); static Insertable custom({ Expression? id, Expression? habitId, Expression? date, Expression? value, Expression? loggedAt, Expression? note, Expression? variantId, Expression? ctxLocation, Expression? ctxCondition, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (habitId != null) 'habit_id': habitId, if (date != null) 'date': date, if (value != null) 'value': value, if (loggedAt != null) 'logged_at': loggedAt, if (note != null) 'note': note, if (variantId != null) 'variant_id': variantId, if (ctxLocation != null) 'ctx_location': ctxLocation, if (ctxCondition != null) 'ctx_condition': ctxCondition, if (rowid != null) 'rowid': rowid, }); } TrackerEntriesCompanion copyWith({ Value? id, Value? habitId, Value? date, Value? value, Value? loggedAt, Value? note, Value? variantId, Value? ctxLocation, Value? ctxCondition, Value? rowid, }) { return TrackerEntriesCompanion( id: id ?? this.id, habitId: habitId ?? this.habitId, date: date ?? this.date, value: value ?? this.value, loggedAt: loggedAt ?? this.loggedAt, note: note ?? this.note, variantId: variantId ?? this.variantId, ctxLocation: ctxLocation ?? this.ctxLocation, ctxCondition: ctxCondition ?? this.ctxCondition, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (date.present) { map['date'] = Variable(date.value); } if (value.present) { map['value'] = Variable(value.value); } if (loggedAt.present) { map['logged_at'] = Variable(loggedAt.value); } if (note.present) { map['note'] = Variable(note.value); } if (variantId.present) { map['variant_id'] = Variable(variantId.value); } if (ctxLocation.present) { map['ctx_location'] = Variable(ctxLocation.value); } if (ctxCondition.present) { map['ctx_condition'] = Variable(ctxCondition.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('TrackerEntriesCompanion(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('date: $date, ') ..write('value: $value, ') ..write('loggedAt: $loggedAt, ') ..write('note: $note, ') ..write('variantId: $variantId, ') ..write('ctxLocation: $ctxLocation, ') ..write('ctxCondition: $ctxCondition, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $LapseLogsTable extends LapseLogs with TableInfo<$LapseLogsTable, LapseLog> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $LapseLogsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) NOT NULL', ); static const VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( 'date', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _labelTextMeta = const VerificationMeta( 'labelText', ); @override late final GeneratedColumn labelText = GeneratedColumn( 'label_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _examineHaltJsonMeta = const VerificationMeta( 'examineHaltJson', ); @override late final GeneratedColumn examineHaltJson = GeneratedColumn( 'examine_halt_json', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _antecedentJsonMeta = const VerificationMeta( 'antecedentJson', ); @override late final GeneratedColumn antecedentJson = GeneratedColumn( 'antecedent_json', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _replanMeta = const VerificationMeta('replan'); @override late final GeneratedColumn replan = GeneratedColumn( 'replan', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _nextActionMeta = const VerificationMeta( 'nextAction', ); @override late final GeneratedColumn nextAction = GeneratedColumn( 'next_action', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, habitId, date, labelText, examineHaltJson, antecedentJson, replan, nextAction, createdAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'lapse_logs'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('date')) { context.handle( _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta), ); } else if (isInserting) { context.missing(_dateMeta); } if (data.containsKey('label_text')) { context.handle( _labelTextMeta, labelText.isAcceptableOrUnknown(data['label_text']!, _labelTextMeta), ); } else if (isInserting) { context.missing(_labelTextMeta); } if (data.containsKey('examine_halt_json')) { context.handle( _examineHaltJsonMeta, examineHaltJson.isAcceptableOrUnknown( data['examine_halt_json']!, _examineHaltJsonMeta, ), ); } else if (isInserting) { context.missing(_examineHaltJsonMeta); } if (data.containsKey('antecedent_json')) { context.handle( _antecedentJsonMeta, antecedentJson.isAcceptableOrUnknown( data['antecedent_json']!, _antecedentJsonMeta, ), ); } else if (isInserting) { context.missing(_antecedentJsonMeta); } if (data.containsKey('replan')) { context.handle( _replanMeta, replan.isAcceptableOrUnknown(data['replan']!, _replanMeta), ); } else if (isInserting) { context.missing(_replanMeta); } if (data.containsKey('next_action')) { context.handle( _nextActionMeta, nextAction.isAcceptableOrUnknown(data['next_action']!, _nextActionMeta), ); } else if (isInserting) { context.missing(_nextActionMeta); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } return context; } @override Set get $primaryKey => {id}; @override LapseLog map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return LapseLog( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, date: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}date'], )!, labelText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}label_text'], )!, examineHaltJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}examine_halt_json'], )!, antecedentJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}antecedent_json'], )!, replan: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}replan'], )!, nextAction: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}next_action'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}created_at'], ), ); } @override $LapseLogsTable createAlias(String alias) { return $LapseLogsTable(attachedDatabase, alias); } } class LapseLog extends DataClass implements Insertable { final String id; final String habitId; final String date; final String labelText; final String examineHaltJson; final String antecedentJson; final String replan; final String nextAction; final String? createdAt; const LapseLog({ required this.id, required this.habitId, required this.date, required this.labelText, required this.examineHaltJson, required this.antecedentJson, required this.replan, required this.nextAction, this.createdAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['habit_id'] = Variable(habitId); map['date'] = Variable(date); map['label_text'] = Variable(labelText); map['examine_halt_json'] = Variable(examineHaltJson); map['antecedent_json'] = Variable(antecedentJson); map['replan'] = Variable(replan); map['next_action'] = Variable(nextAction); if (!nullToAbsent || createdAt != null) { map['created_at'] = Variable(createdAt); } return map; } LapseLogsCompanion toCompanion(bool nullToAbsent) { return LapseLogsCompanion( id: Value(id), habitId: Value(habitId), date: Value(date), labelText: Value(labelText), examineHaltJson: Value(examineHaltJson), antecedentJson: Value(antecedentJson), replan: Value(replan), nextAction: Value(nextAction), createdAt: createdAt == null && nullToAbsent ? const Value.absent() : Value(createdAt), ); } factory LapseLog.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return LapseLog( id: serializer.fromJson(json['id']), habitId: serializer.fromJson(json['habitId']), date: serializer.fromJson(json['date']), labelText: serializer.fromJson(json['labelText']), examineHaltJson: serializer.fromJson(json['examineHaltJson']), antecedentJson: serializer.fromJson(json['antecedentJson']), replan: serializer.fromJson(json['replan']), nextAction: serializer.fromJson(json['nextAction']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'habitId': serializer.toJson(habitId), 'date': serializer.toJson(date), 'labelText': serializer.toJson(labelText), 'examineHaltJson': serializer.toJson(examineHaltJson), 'antecedentJson': serializer.toJson(antecedentJson), 'replan': serializer.toJson(replan), 'nextAction': serializer.toJson(nextAction), 'createdAt': serializer.toJson(createdAt), }; } LapseLog copyWith({ String? id, String? habitId, String? date, String? labelText, String? examineHaltJson, String? antecedentJson, String? replan, String? nextAction, Value createdAt = const Value.absent(), }) => LapseLog( id: id ?? this.id, habitId: habitId ?? this.habitId, date: date ?? this.date, labelText: labelText ?? this.labelText, examineHaltJson: examineHaltJson ?? this.examineHaltJson, antecedentJson: antecedentJson ?? this.antecedentJson, replan: replan ?? this.replan, nextAction: nextAction ?? this.nextAction, createdAt: createdAt.present ? createdAt.value : this.createdAt, ); LapseLog copyWithCompanion(LapseLogsCompanion data) { return LapseLog( id: data.id.present ? data.id.value : this.id, habitId: data.habitId.present ? data.habitId.value : this.habitId, date: data.date.present ? data.date.value : this.date, labelText: data.labelText.present ? data.labelText.value : this.labelText, examineHaltJson: data.examineHaltJson.present ? data.examineHaltJson.value : this.examineHaltJson, antecedentJson: data.antecedentJson.present ? data.antecedentJson.value : this.antecedentJson, replan: data.replan.present ? data.replan.value : this.replan, nextAction: data.nextAction.present ? data.nextAction.value : this.nextAction, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('LapseLog(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('date: $date, ') ..write('labelText: $labelText, ') ..write('examineHaltJson: $examineHaltJson, ') ..write('antecedentJson: $antecedentJson, ') ..write('replan: $replan, ') ..write('nextAction: $nextAction, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, habitId, date, labelText, examineHaltJson, antecedentJson, replan, nextAction, createdAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is LapseLog && other.id == this.id && other.habitId == this.habitId && other.date == this.date && other.labelText == this.labelText && other.examineHaltJson == this.examineHaltJson && other.antecedentJson == this.antecedentJson && other.replan == this.replan && other.nextAction == this.nextAction && other.createdAt == this.createdAt); } class LapseLogsCompanion extends UpdateCompanion { final Value id; final Value habitId; final Value date; final Value labelText; final Value examineHaltJson; final Value antecedentJson; final Value replan; final Value nextAction; final Value createdAt; final Value rowid; const LapseLogsCompanion({ this.id = const Value.absent(), this.habitId = const Value.absent(), this.date = const Value.absent(), this.labelText = const Value.absent(), this.examineHaltJson = const Value.absent(), this.antecedentJson = const Value.absent(), this.replan = const Value.absent(), this.nextAction = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); LapseLogsCompanion.insert({ required String id, required String habitId, required String date, required String labelText, required String examineHaltJson, required String antecedentJson, required String replan, required String nextAction, this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), habitId = Value(habitId), date = Value(date), labelText = Value(labelText), examineHaltJson = Value(examineHaltJson), antecedentJson = Value(antecedentJson), replan = Value(replan), nextAction = Value(nextAction); static Insertable custom({ Expression? id, Expression? habitId, Expression? date, Expression? labelText, Expression? examineHaltJson, Expression? antecedentJson, Expression? replan, Expression? nextAction, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (habitId != null) 'habit_id': habitId, if (date != null) 'date': date, if (labelText != null) 'label_text': labelText, if (examineHaltJson != null) 'examine_halt_json': examineHaltJson, if (antecedentJson != null) 'antecedent_json': antecedentJson, if (replan != null) 'replan': replan, if (nextAction != null) 'next_action': nextAction, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } LapseLogsCompanion copyWith({ Value? id, Value? habitId, Value? date, Value? labelText, Value? examineHaltJson, Value? antecedentJson, Value? replan, Value? nextAction, Value? createdAt, Value? rowid, }) { return LapseLogsCompanion( id: id ?? this.id, habitId: habitId ?? this.habitId, date: date ?? this.date, labelText: labelText ?? this.labelText, examineHaltJson: examineHaltJson ?? this.examineHaltJson, antecedentJson: antecedentJson ?? this.antecedentJson, replan: replan ?? this.replan, nextAction: nextAction ?? this.nextAction, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (date.present) { map['date'] = Variable(date.value); } if (labelText.present) { map['label_text'] = Variable(labelText.value); } if (examineHaltJson.present) { map['examine_halt_json'] = Variable(examineHaltJson.value); } if (antecedentJson.present) { map['antecedent_json'] = Variable(antecedentJson.value); } if (replan.present) { map['replan'] = Variable(replan.value); } if (nextAction.present) { map['next_action'] = Variable(nextAction.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('LapseLogsCompanion(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('date: $date, ') ..write('labelText: $labelText, ') ..write('examineHaltJson: $examineHaltJson, ') ..write('antecedentJson: $antecedentJson, ') ..write('replan: $replan, ') ..write('nextAction: $nextAction, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $UrgeLogsTable extends UrgeLogs with TableInfo<$UrgeLogsTable, UrgeLog> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $UrgeLogsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) NOT NULL', ); static const VerificationMeta _occurredAtMeta = const VerificationMeta( 'occurredAt', ); @override late final GeneratedColumn occurredAt = GeneratedColumn( 'occurred_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _intensityBeforeMeta = const VerificationMeta( 'intensityBefore', ); @override late final GeneratedColumn intensityBefore = GeneratedColumn( 'intensity_before', aliasedName, true, check: () => const CustomExpression( "intensity_before IS NULL OR intensity_before BETWEEN 0 AND 10", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _intensityAfterMeta = const VerificationMeta( 'intensityAfter', ); @override late final GeneratedColumn intensityAfter = GeneratedColumn( 'intensity_after', aliasedName, true, check: () => const CustomExpression( "intensity_after IS NULL OR intensity_after BETWEEN 0 AND 10", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _durationSecondsMeta = const VerificationMeta( 'durationSeconds', ); @override late final GeneratedColumn durationSeconds = GeneratedColumn( 'duration_seconds', aliasedName, true, check: () => const CustomExpression( "duration_seconds IS NULL OR duration_seconds >= 0", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _bodyLocationJsonMeta = const VerificationMeta( 'bodyLocationJson', ); @override late final GeneratedColumn bodyLocationJson = GeneratedColumn( 'body_location_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _passedMeta = const VerificationMeta('passed'); @override late final GeneratedColumn passed = GeneratedColumn( 'passed', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("passed" IN (0, 1))', ), ); static const VerificationMeta _methodUsedMeta = const VerificationMeta( 'methodUsed', ); @override late final GeneratedColumn methodUsed = GeneratedColumn( 'method_used', aliasedName, true, check: () => const CustomExpression( "method_used IS NULL OR method_used IN ('cyclic_sighing','walk','water','social_contact','if_then_action','other')", ), type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, habitId, occurredAt, intensityBefore, intensityAfter, durationSeconds, bodyLocationJson, passed, methodUsed, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'urge_logs'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('occurred_at')) { context.handle( _occurredAtMeta, occurredAt.isAcceptableOrUnknown(data['occurred_at']!, _occurredAtMeta), ); } else if (isInserting) { context.missing(_occurredAtMeta); } if (data.containsKey('intensity_before')) { context.handle( _intensityBeforeMeta, intensityBefore.isAcceptableOrUnknown( data['intensity_before']!, _intensityBeforeMeta, ), ); } if (data.containsKey('intensity_after')) { context.handle( _intensityAfterMeta, intensityAfter.isAcceptableOrUnknown( data['intensity_after']!, _intensityAfterMeta, ), ); } if (data.containsKey('duration_seconds')) { context.handle( _durationSecondsMeta, durationSeconds.isAcceptableOrUnknown( data['duration_seconds']!, _durationSecondsMeta, ), ); } if (data.containsKey('body_location_json')) { context.handle( _bodyLocationJsonMeta, bodyLocationJson.isAcceptableOrUnknown( data['body_location_json']!, _bodyLocationJsonMeta, ), ); } if (data.containsKey('passed')) { context.handle( _passedMeta, passed.isAcceptableOrUnknown(data['passed']!, _passedMeta), ); } else if (isInserting) { context.missing(_passedMeta); } if (data.containsKey('method_used')) { context.handle( _methodUsedMeta, methodUsed.isAcceptableOrUnknown(data['method_used']!, _methodUsedMeta), ); } return context; } @override Set get $primaryKey => {id}; @override UrgeLog map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return UrgeLog( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, occurredAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}occurred_at'], )!, intensityBefore: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}intensity_before'], ), intensityAfter: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}intensity_after'], ), durationSeconds: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}duration_seconds'], ), bodyLocationJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}body_location_json'], ), passed: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}passed'], )!, methodUsed: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}method_used'], ), ); } @override $UrgeLogsTable createAlias(String alias) { return $UrgeLogsTable(attachedDatabase, alias); } } class UrgeLog extends DataClass implements Insertable { final String id; final String habitId; final String occurredAt; final int? intensityBefore; final int? intensityAfter; final int? durationSeconds; final String? bodyLocationJson; final bool passed; final String? methodUsed; const UrgeLog({ required this.id, required this.habitId, required this.occurredAt, this.intensityBefore, this.intensityAfter, this.durationSeconds, this.bodyLocationJson, required this.passed, this.methodUsed, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['habit_id'] = Variable(habitId); map['occurred_at'] = Variable(occurredAt); if (!nullToAbsent || intensityBefore != null) { map['intensity_before'] = Variable(intensityBefore); } if (!nullToAbsent || intensityAfter != null) { map['intensity_after'] = Variable(intensityAfter); } if (!nullToAbsent || durationSeconds != null) { map['duration_seconds'] = Variable(durationSeconds); } if (!nullToAbsent || bodyLocationJson != null) { map['body_location_json'] = Variable(bodyLocationJson); } map['passed'] = Variable(passed); if (!nullToAbsent || methodUsed != null) { map['method_used'] = Variable(methodUsed); } return map; } UrgeLogsCompanion toCompanion(bool nullToAbsent) { return UrgeLogsCompanion( id: Value(id), habitId: Value(habitId), occurredAt: Value(occurredAt), intensityBefore: intensityBefore == null && nullToAbsent ? const Value.absent() : Value(intensityBefore), intensityAfter: intensityAfter == null && nullToAbsent ? const Value.absent() : Value(intensityAfter), durationSeconds: durationSeconds == null && nullToAbsent ? const Value.absent() : Value(durationSeconds), bodyLocationJson: bodyLocationJson == null && nullToAbsent ? const Value.absent() : Value(bodyLocationJson), passed: Value(passed), methodUsed: methodUsed == null && nullToAbsent ? const Value.absent() : Value(methodUsed), ); } factory UrgeLog.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return UrgeLog( id: serializer.fromJson(json['id']), habitId: serializer.fromJson(json['habitId']), occurredAt: serializer.fromJson(json['occurredAt']), intensityBefore: serializer.fromJson(json['intensityBefore']), intensityAfter: serializer.fromJson(json['intensityAfter']), durationSeconds: serializer.fromJson(json['durationSeconds']), bodyLocationJson: serializer.fromJson(json['bodyLocationJson']), passed: serializer.fromJson(json['passed']), methodUsed: serializer.fromJson(json['methodUsed']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'habitId': serializer.toJson(habitId), 'occurredAt': serializer.toJson(occurredAt), 'intensityBefore': serializer.toJson(intensityBefore), 'intensityAfter': serializer.toJson(intensityAfter), 'durationSeconds': serializer.toJson(durationSeconds), 'bodyLocationJson': serializer.toJson(bodyLocationJson), 'passed': serializer.toJson(passed), 'methodUsed': serializer.toJson(methodUsed), }; } UrgeLog copyWith({ String? id, String? habitId, String? occurredAt, Value intensityBefore = const Value.absent(), Value intensityAfter = const Value.absent(), Value durationSeconds = const Value.absent(), Value bodyLocationJson = const Value.absent(), bool? passed, Value methodUsed = const Value.absent(), }) => UrgeLog( id: id ?? this.id, habitId: habitId ?? this.habitId, occurredAt: occurredAt ?? this.occurredAt, intensityBefore: intensityBefore.present ? intensityBefore.value : this.intensityBefore, intensityAfter: intensityAfter.present ? intensityAfter.value : this.intensityAfter, durationSeconds: durationSeconds.present ? durationSeconds.value : this.durationSeconds, bodyLocationJson: bodyLocationJson.present ? bodyLocationJson.value : this.bodyLocationJson, passed: passed ?? this.passed, methodUsed: methodUsed.present ? methodUsed.value : this.methodUsed, ); UrgeLog copyWithCompanion(UrgeLogsCompanion data) { return UrgeLog( id: data.id.present ? data.id.value : this.id, habitId: data.habitId.present ? data.habitId.value : this.habitId, occurredAt: data.occurredAt.present ? data.occurredAt.value : this.occurredAt, intensityBefore: data.intensityBefore.present ? data.intensityBefore.value : this.intensityBefore, intensityAfter: data.intensityAfter.present ? data.intensityAfter.value : this.intensityAfter, durationSeconds: data.durationSeconds.present ? data.durationSeconds.value : this.durationSeconds, bodyLocationJson: data.bodyLocationJson.present ? data.bodyLocationJson.value : this.bodyLocationJson, passed: data.passed.present ? data.passed.value : this.passed, methodUsed: data.methodUsed.present ? data.methodUsed.value : this.methodUsed, ); } @override String toString() { return (StringBuffer('UrgeLog(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('occurredAt: $occurredAt, ') ..write('intensityBefore: $intensityBefore, ') ..write('intensityAfter: $intensityAfter, ') ..write('durationSeconds: $durationSeconds, ') ..write('bodyLocationJson: $bodyLocationJson, ') ..write('passed: $passed, ') ..write('methodUsed: $methodUsed') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, habitId, occurredAt, intensityBefore, intensityAfter, durationSeconds, bodyLocationJson, passed, methodUsed, ); @override bool operator ==(Object other) => identical(this, other) || (other is UrgeLog && other.id == this.id && other.habitId == this.habitId && other.occurredAt == this.occurredAt && other.intensityBefore == this.intensityBefore && other.intensityAfter == this.intensityAfter && other.durationSeconds == this.durationSeconds && other.bodyLocationJson == this.bodyLocationJson && other.passed == this.passed && other.methodUsed == this.methodUsed); } class UrgeLogsCompanion extends UpdateCompanion { final Value id; final Value habitId; final Value occurredAt; final Value intensityBefore; final Value intensityAfter; final Value durationSeconds; final Value bodyLocationJson; final Value passed; final Value methodUsed; final Value rowid; const UrgeLogsCompanion({ this.id = const Value.absent(), this.habitId = const Value.absent(), this.occurredAt = const Value.absent(), this.intensityBefore = const Value.absent(), this.intensityAfter = const Value.absent(), this.durationSeconds = const Value.absent(), this.bodyLocationJson = const Value.absent(), this.passed = const Value.absent(), this.methodUsed = const Value.absent(), this.rowid = const Value.absent(), }); UrgeLogsCompanion.insert({ required String id, required String habitId, required String occurredAt, this.intensityBefore = const Value.absent(), this.intensityAfter = const Value.absent(), this.durationSeconds = const Value.absent(), this.bodyLocationJson = const Value.absent(), required bool passed, this.methodUsed = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), habitId = Value(habitId), occurredAt = Value(occurredAt), passed = Value(passed); static Insertable custom({ Expression? id, Expression? habitId, Expression? occurredAt, Expression? intensityBefore, Expression? intensityAfter, Expression? durationSeconds, Expression? bodyLocationJson, Expression? passed, Expression? methodUsed, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (habitId != null) 'habit_id': habitId, if (occurredAt != null) 'occurred_at': occurredAt, if (intensityBefore != null) 'intensity_before': intensityBefore, if (intensityAfter != null) 'intensity_after': intensityAfter, if (durationSeconds != null) 'duration_seconds': durationSeconds, if (bodyLocationJson != null) 'body_location_json': bodyLocationJson, if (passed != null) 'passed': passed, if (methodUsed != null) 'method_used': methodUsed, if (rowid != null) 'rowid': rowid, }); } UrgeLogsCompanion copyWith({ Value? id, Value? habitId, Value? occurredAt, Value? intensityBefore, Value? intensityAfter, Value? durationSeconds, Value? bodyLocationJson, Value? passed, Value? methodUsed, Value? rowid, }) { return UrgeLogsCompanion( id: id ?? this.id, habitId: habitId ?? this.habitId, occurredAt: occurredAt ?? this.occurredAt, intensityBefore: intensityBefore ?? this.intensityBefore, intensityAfter: intensityAfter ?? this.intensityAfter, durationSeconds: durationSeconds ?? this.durationSeconds, bodyLocationJson: bodyLocationJson ?? this.bodyLocationJson, passed: passed ?? this.passed, methodUsed: methodUsed ?? this.methodUsed, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (occurredAt.present) { map['occurred_at'] = Variable(occurredAt.value); } if (intensityBefore.present) { map['intensity_before'] = Variable(intensityBefore.value); } if (intensityAfter.present) { map['intensity_after'] = Variable(intensityAfter.value); } if (durationSeconds.present) { map['duration_seconds'] = Variable(durationSeconds.value); } if (bodyLocationJson.present) { map['body_location_json'] = Variable(bodyLocationJson.value); } if (passed.present) { map['passed'] = Variable(passed.value); } if (methodUsed.present) { map['method_used'] = Variable(methodUsed.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('UrgeLogsCompanion(') ..write('id: $id, ') ..write('habitId: $habitId, ') ..write('occurredAt: $occurredAt, ') ..write('intensityBefore: $intensityBefore, ') ..write('intensityAfter: $intensityAfter, ') ..write('durationSeconds: $durationSeconds, ') ..write('bodyLocationJson: $bodyLocationJson, ') ..write('passed: $passed, ') ..write('methodUsed: $methodUsed, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $RewardDeclarationsTable extends RewardDeclarations with TableInfo<$RewardDeclarationsTable, RewardDeclaration> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $RewardDeclarationsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _phaseIdMeta = const VerificationMeta( 'phaseId', ); @override late final GeneratedColumn phaseId = GeneratedColumn( 'phase_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES phases(id) NOT NULL', ); static const VerificationMeta _habitIdMeta = const VerificationMeta( 'habitId', ); @override late final GeneratedColumn habitId = GeneratedColumn( 'habit_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES habits(id) NOT NULL', ); static const VerificationMeta _tierMeta = const VerificationMeta('tier'); @override late final GeneratedColumn tier = GeneratedColumn( 'tier', aliasedName, false, check: () => const CustomExpression("tier IN ('T0','T1','T2','T3','T4')"), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _milestoneRuleMeta = const VerificationMeta( 'milestoneRule', ); @override late final GeneratedColumn milestoneRule = GeneratedColumn( 'milestone_rule', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _milestoneMachineRuleJsonMeta = const VerificationMeta('milestoneMachineRuleJson'); @override late final GeneratedColumn milestoneMachineRuleJson = GeneratedColumn( 'milestone_machine_rule_json', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _rewardTextMeta = const VerificationMeta( 'rewardText', ); @override late final GeneratedColumn rewardText = GeneratedColumn( 'reward_text', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _rewardMenuItemIdMeta = const VerificationMeta( 'rewardMenuItemId', ); @override late final GeneratedColumn rewardMenuItemId = GeneratedColumn( 'reward_menu_item_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES reward_menu_items(id)', ); static const VerificationMeta _estimatedCostKrwMeta = const VerificationMeta( 'estimatedCostKrw', ); @override late final GeneratedColumn estimatedCostKrw = GeneratedColumn( 'estimated_cost_krw', aliasedName, true, check: () => const CustomExpression( "estimated_cost_krw IS NULL OR estimated_cost_krw >= 0", ), type: DriftSqlType.int, requiredDuringInsert: false, ); static const VerificationMeta _isEffortTiedMeta = const VerificationMeta( 'isEffortTied', ); @override late final GeneratedColumn isEffortTied = GeneratedColumn( 'is_effort_tied', aliasedName, true, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_effort_tied" IN (0, 1))', ), ); static const VerificationMeta _declaredAtMeta = const VerificationMeta( 'declaredAt', ); @override late final GeneratedColumn declaredAt = GeneratedColumn( 'declared_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); @override List get $columns => [ id, phaseId, habitId, tier, milestoneRule, milestoneMachineRuleJson, rewardText, rewardMenuItemId, estimatedCostKrw, isEffortTied, declaredAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'reward_declarations'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('phase_id')) { context.handle( _phaseIdMeta, phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta), ); } else if (isInserting) { context.missing(_phaseIdMeta); } if (data.containsKey('habit_id')) { context.handle( _habitIdMeta, habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta), ); } else if (isInserting) { context.missing(_habitIdMeta); } if (data.containsKey('tier')) { context.handle( _tierMeta, tier.isAcceptableOrUnknown(data['tier']!, _tierMeta), ); } else if (isInserting) { context.missing(_tierMeta); } if (data.containsKey('milestone_rule')) { context.handle( _milestoneRuleMeta, milestoneRule.isAcceptableOrUnknown( data['milestone_rule']!, _milestoneRuleMeta, ), ); } else if (isInserting) { context.missing(_milestoneRuleMeta); } if (data.containsKey('milestone_machine_rule_json')) { context.handle( _milestoneMachineRuleJsonMeta, milestoneMachineRuleJson.isAcceptableOrUnknown( data['milestone_machine_rule_json']!, _milestoneMachineRuleJsonMeta, ), ); } if (data.containsKey('reward_text')) { context.handle( _rewardTextMeta, rewardText.isAcceptableOrUnknown(data['reward_text']!, _rewardTextMeta), ); } else if (isInserting) { context.missing(_rewardTextMeta); } if (data.containsKey('reward_menu_item_id')) { context.handle( _rewardMenuItemIdMeta, rewardMenuItemId.isAcceptableOrUnknown( data['reward_menu_item_id']!, _rewardMenuItemIdMeta, ), ); } if (data.containsKey('estimated_cost_krw')) { context.handle( _estimatedCostKrwMeta, estimatedCostKrw.isAcceptableOrUnknown( data['estimated_cost_krw']!, _estimatedCostKrwMeta, ), ); } if (data.containsKey('is_effort_tied')) { context.handle( _isEffortTiedMeta, isEffortTied.isAcceptableOrUnknown( data['is_effort_tied']!, _isEffortTiedMeta, ), ); } if (data.containsKey('declared_at')) { context.handle( _declaredAtMeta, declaredAt.isAcceptableOrUnknown(data['declared_at']!, _declaredAtMeta), ); } else if (isInserting) { context.missing(_declaredAtMeta); } return context; } @override Set get $primaryKey => {id}; @override RewardDeclaration map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return RewardDeclaration( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, phaseId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}phase_id'], )!, habitId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}habit_id'], )!, tier: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tier'], )!, milestoneRule: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}milestone_rule'], )!, milestoneMachineRuleJson: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}milestone_machine_rule_json'], ), rewardText: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reward_text'], )!, rewardMenuItemId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reward_menu_item_id'], ), estimatedCostKrw: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}estimated_cost_krw'], ), isEffortTied: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}is_effort_tied'], ), declaredAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}declared_at'], )!, ); } @override $RewardDeclarationsTable createAlias(String alias) { return $RewardDeclarationsTable(attachedDatabase, alias); } } class RewardDeclaration extends DataClass implements Insertable { final String id; final String phaseId; final String habitId; final String tier; final String milestoneRule; final String? milestoneMachineRuleJson; final String rewardText; final String? rewardMenuItemId; final int? estimatedCostKrw; final bool? isEffortTied; final String declaredAt; const RewardDeclaration({ required this.id, required this.phaseId, required this.habitId, required this.tier, required this.milestoneRule, this.milestoneMachineRuleJson, required this.rewardText, this.rewardMenuItemId, this.estimatedCostKrw, this.isEffortTied, required this.declaredAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['phase_id'] = Variable(phaseId); map['habit_id'] = Variable(habitId); map['tier'] = Variable(tier); map['milestone_rule'] = Variable(milestoneRule); if (!nullToAbsent || milestoneMachineRuleJson != null) { map['milestone_machine_rule_json'] = Variable( milestoneMachineRuleJson, ); } map['reward_text'] = Variable(rewardText); if (!nullToAbsent || rewardMenuItemId != null) { map['reward_menu_item_id'] = Variable(rewardMenuItemId); } if (!nullToAbsent || estimatedCostKrw != null) { map['estimated_cost_krw'] = Variable(estimatedCostKrw); } if (!nullToAbsent || isEffortTied != null) { map['is_effort_tied'] = Variable(isEffortTied); } map['declared_at'] = Variable(declaredAt); return map; } RewardDeclarationsCompanion toCompanion(bool nullToAbsent) { return RewardDeclarationsCompanion( id: Value(id), phaseId: Value(phaseId), habitId: Value(habitId), tier: Value(tier), milestoneRule: Value(milestoneRule), milestoneMachineRuleJson: milestoneMachineRuleJson == null && nullToAbsent ? const Value.absent() : Value(milestoneMachineRuleJson), rewardText: Value(rewardText), rewardMenuItemId: rewardMenuItemId == null && nullToAbsent ? const Value.absent() : Value(rewardMenuItemId), estimatedCostKrw: estimatedCostKrw == null && nullToAbsent ? const Value.absent() : Value(estimatedCostKrw), isEffortTied: isEffortTied == null && nullToAbsent ? const Value.absent() : Value(isEffortTied), declaredAt: Value(declaredAt), ); } factory RewardDeclaration.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return RewardDeclaration( id: serializer.fromJson(json['id']), phaseId: serializer.fromJson(json['phaseId']), habitId: serializer.fromJson(json['habitId']), tier: serializer.fromJson(json['tier']), milestoneRule: serializer.fromJson(json['milestoneRule']), milestoneMachineRuleJson: serializer.fromJson( json['milestoneMachineRuleJson'], ), rewardText: serializer.fromJson(json['rewardText']), rewardMenuItemId: serializer.fromJson(json['rewardMenuItemId']), estimatedCostKrw: serializer.fromJson(json['estimatedCostKrw']), isEffortTied: serializer.fromJson(json['isEffortTied']), declaredAt: serializer.fromJson(json['declaredAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'phaseId': serializer.toJson(phaseId), 'habitId': serializer.toJson(habitId), 'tier': serializer.toJson(tier), 'milestoneRule': serializer.toJson(milestoneRule), 'milestoneMachineRuleJson': serializer.toJson( milestoneMachineRuleJson, ), 'rewardText': serializer.toJson(rewardText), 'rewardMenuItemId': serializer.toJson(rewardMenuItemId), 'estimatedCostKrw': serializer.toJson(estimatedCostKrw), 'isEffortTied': serializer.toJson(isEffortTied), 'declaredAt': serializer.toJson(declaredAt), }; } RewardDeclaration copyWith({ String? id, String? phaseId, String? habitId, String? tier, String? milestoneRule, Value milestoneMachineRuleJson = const Value.absent(), String? rewardText, Value rewardMenuItemId = const Value.absent(), Value estimatedCostKrw = const Value.absent(), Value isEffortTied = const Value.absent(), String? declaredAt, }) => RewardDeclaration( id: id ?? this.id, phaseId: phaseId ?? this.phaseId, habitId: habitId ?? this.habitId, tier: tier ?? this.tier, milestoneRule: milestoneRule ?? this.milestoneRule, milestoneMachineRuleJson: milestoneMachineRuleJson.present ? milestoneMachineRuleJson.value : this.milestoneMachineRuleJson, rewardText: rewardText ?? this.rewardText, rewardMenuItemId: rewardMenuItemId.present ? rewardMenuItemId.value : this.rewardMenuItemId, estimatedCostKrw: estimatedCostKrw.present ? estimatedCostKrw.value : this.estimatedCostKrw, isEffortTied: isEffortTied.present ? isEffortTied.value : this.isEffortTied, declaredAt: declaredAt ?? this.declaredAt, ); RewardDeclaration copyWithCompanion(RewardDeclarationsCompanion data) { return RewardDeclaration( id: data.id.present ? data.id.value : this.id, phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId, habitId: data.habitId.present ? data.habitId.value : this.habitId, tier: data.tier.present ? data.tier.value : this.tier, milestoneRule: data.milestoneRule.present ? data.milestoneRule.value : this.milestoneRule, milestoneMachineRuleJson: data.milestoneMachineRuleJson.present ? data.milestoneMachineRuleJson.value : this.milestoneMachineRuleJson, rewardText: data.rewardText.present ? data.rewardText.value : this.rewardText, rewardMenuItemId: data.rewardMenuItemId.present ? data.rewardMenuItemId.value : this.rewardMenuItemId, estimatedCostKrw: data.estimatedCostKrw.present ? data.estimatedCostKrw.value : this.estimatedCostKrw, isEffortTied: data.isEffortTied.present ? data.isEffortTied.value : this.isEffortTied, declaredAt: data.declaredAt.present ? data.declaredAt.value : this.declaredAt, ); } @override String toString() { return (StringBuffer('RewardDeclaration(') ..write('id: $id, ') ..write('phaseId: $phaseId, ') ..write('habitId: $habitId, ') ..write('tier: $tier, ') ..write('milestoneRule: $milestoneRule, ') ..write('milestoneMachineRuleJson: $milestoneMachineRuleJson, ') ..write('rewardText: $rewardText, ') ..write('rewardMenuItemId: $rewardMenuItemId, ') ..write('estimatedCostKrw: $estimatedCostKrw, ') ..write('isEffortTied: $isEffortTied, ') ..write('declaredAt: $declaredAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, phaseId, habitId, tier, milestoneRule, milestoneMachineRuleJson, rewardText, rewardMenuItemId, estimatedCostKrw, isEffortTied, declaredAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is RewardDeclaration && other.id == this.id && other.phaseId == this.phaseId && other.habitId == this.habitId && other.tier == this.tier && other.milestoneRule == this.milestoneRule && other.milestoneMachineRuleJson == this.milestoneMachineRuleJson && other.rewardText == this.rewardText && other.rewardMenuItemId == this.rewardMenuItemId && other.estimatedCostKrw == this.estimatedCostKrw && other.isEffortTied == this.isEffortTied && other.declaredAt == this.declaredAt); } class RewardDeclarationsCompanion extends UpdateCompanion { final Value id; final Value phaseId; final Value habitId; final Value tier; final Value milestoneRule; final Value milestoneMachineRuleJson; final Value rewardText; final Value rewardMenuItemId; final Value estimatedCostKrw; final Value isEffortTied; final Value declaredAt; final Value rowid; const RewardDeclarationsCompanion({ this.id = const Value.absent(), this.phaseId = const Value.absent(), this.habitId = const Value.absent(), this.tier = const Value.absent(), this.milestoneRule = const Value.absent(), this.milestoneMachineRuleJson = const Value.absent(), this.rewardText = const Value.absent(), this.rewardMenuItemId = const Value.absent(), this.estimatedCostKrw = const Value.absent(), this.isEffortTied = const Value.absent(), this.declaredAt = const Value.absent(), this.rowid = const Value.absent(), }); RewardDeclarationsCompanion.insert({ required String id, required String phaseId, required String habitId, required String tier, required String milestoneRule, this.milestoneMachineRuleJson = const Value.absent(), required String rewardText, this.rewardMenuItemId = const Value.absent(), this.estimatedCostKrw = const Value.absent(), this.isEffortTied = const Value.absent(), required String declaredAt, this.rowid = const Value.absent(), }) : id = Value(id), phaseId = Value(phaseId), habitId = Value(habitId), tier = Value(tier), milestoneRule = Value(milestoneRule), rewardText = Value(rewardText), declaredAt = Value(declaredAt); static Insertable custom({ Expression? id, Expression? phaseId, Expression? habitId, Expression? tier, Expression? milestoneRule, Expression? milestoneMachineRuleJson, Expression? rewardText, Expression? rewardMenuItemId, Expression? estimatedCostKrw, Expression? isEffortTied, Expression? declaredAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (phaseId != null) 'phase_id': phaseId, if (habitId != null) 'habit_id': habitId, if (tier != null) 'tier': tier, if (milestoneRule != null) 'milestone_rule': milestoneRule, if (milestoneMachineRuleJson != null) 'milestone_machine_rule_json': milestoneMachineRuleJson, if (rewardText != null) 'reward_text': rewardText, if (rewardMenuItemId != null) 'reward_menu_item_id': rewardMenuItemId, if (estimatedCostKrw != null) 'estimated_cost_krw': estimatedCostKrw, if (isEffortTied != null) 'is_effort_tied': isEffortTied, if (declaredAt != null) 'declared_at': declaredAt, if (rowid != null) 'rowid': rowid, }); } RewardDeclarationsCompanion copyWith({ Value? id, Value? phaseId, Value? habitId, Value? tier, Value? milestoneRule, Value? milestoneMachineRuleJson, Value? rewardText, Value? rewardMenuItemId, Value? estimatedCostKrw, Value? isEffortTied, Value? declaredAt, Value? rowid, }) { return RewardDeclarationsCompanion( id: id ?? this.id, phaseId: phaseId ?? this.phaseId, habitId: habitId ?? this.habitId, tier: tier ?? this.tier, milestoneRule: milestoneRule ?? this.milestoneRule, milestoneMachineRuleJson: milestoneMachineRuleJson ?? this.milestoneMachineRuleJson, rewardText: rewardText ?? this.rewardText, rewardMenuItemId: rewardMenuItemId ?? this.rewardMenuItemId, estimatedCostKrw: estimatedCostKrw ?? this.estimatedCostKrw, isEffortTied: isEffortTied ?? this.isEffortTied, declaredAt: declaredAt ?? this.declaredAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (phaseId.present) { map['phase_id'] = Variable(phaseId.value); } if (habitId.present) { map['habit_id'] = Variable(habitId.value); } if (tier.present) { map['tier'] = Variable(tier.value); } if (milestoneRule.present) { map['milestone_rule'] = Variable(milestoneRule.value); } if (milestoneMachineRuleJson.present) { map['milestone_machine_rule_json'] = Variable( milestoneMachineRuleJson.value, ); } if (rewardText.present) { map['reward_text'] = Variable(rewardText.value); } if (rewardMenuItemId.present) { map['reward_menu_item_id'] = Variable(rewardMenuItemId.value); } if (estimatedCostKrw.present) { map['estimated_cost_krw'] = Variable(estimatedCostKrw.value); } if (isEffortTied.present) { map['is_effort_tied'] = Variable(isEffortTied.value); } if (declaredAt.present) { map['declared_at'] = Variable(declaredAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('RewardDeclarationsCompanion(') ..write('id: $id, ') ..write('phaseId: $phaseId, ') ..write('habitId: $habitId, ') ..write('tier: $tier, ') ..write('milestoneRule: $milestoneRule, ') ..write('milestoneMachineRuleJson: $milestoneMachineRuleJson, ') ..write('rewardText: $rewardText, ') ..write('rewardMenuItemId: $rewardMenuItemId, ') ..write('estimatedCostKrw: $estimatedCostKrw, ') ..write('isEffortTied: $isEffortTied, ') ..write('declaredAt: $declaredAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $RewardClaimsTable extends RewardClaims with TableInfo<$RewardClaimsTable, RewardClaim> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $RewardClaimsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _declarationIdMeta = const VerificationMeta( 'declarationId', ); @override late final GeneratedColumn declarationId = GeneratedColumn( 'declaration_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES reward_declarations(id) NOT NULL', ); static const VerificationMeta _milestoneReachedAtMeta = const VerificationMeta('milestoneReachedAt'); @override late final GeneratedColumn milestoneReachedAt = GeneratedColumn( 'milestone_reached_at', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _fulfilledMeta = const VerificationMeta( 'fulfilled', ); @override late final GeneratedColumn fulfilled = GeneratedColumn( 'fulfilled', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("fulfilled" IN (0, 1))', ), ); static const VerificationMeta _fulfilledAtMeta = const VerificationMeta( 'fulfilledAt', ); @override late final GeneratedColumn fulfilledAt = GeneratedColumn( 'fulfilled_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _reflectionMeta = const VerificationMeta( 'reflection', ); @override late final GeneratedColumn reflection = GeneratedColumn( 'reflection', aliasedName, true, check: () => const CustomExpression( "reflection IS NULL OR length(reflection) <= 500", ), type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, declarationId, milestoneReachedAt, fulfilled, fulfilledAt, reflection, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'reward_claims'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('declaration_id')) { context.handle( _declarationIdMeta, declarationId.isAcceptableOrUnknown( data['declaration_id']!, _declarationIdMeta, ), ); } else if (isInserting) { context.missing(_declarationIdMeta); } if (data.containsKey('milestone_reached_at')) { context.handle( _milestoneReachedAtMeta, milestoneReachedAt.isAcceptableOrUnknown( data['milestone_reached_at']!, _milestoneReachedAtMeta, ), ); } else if (isInserting) { context.missing(_milestoneReachedAtMeta); } if (data.containsKey('fulfilled')) { context.handle( _fulfilledMeta, fulfilled.isAcceptableOrUnknown(data['fulfilled']!, _fulfilledMeta), ); } else if (isInserting) { context.missing(_fulfilledMeta); } if (data.containsKey('fulfilled_at')) { context.handle( _fulfilledAtMeta, fulfilledAt.isAcceptableOrUnknown( data['fulfilled_at']!, _fulfilledAtMeta, ), ); } if (data.containsKey('reflection')) { context.handle( _reflectionMeta, reflection.isAcceptableOrUnknown(data['reflection']!, _reflectionMeta), ); } return context; } @override Set get $primaryKey => {id}; @override RewardClaim map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return RewardClaim( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, declarationId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}declaration_id'], )!, milestoneReachedAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}milestone_reached_at'], )!, fulfilled: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}fulfilled'], )!, fulfilledAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}fulfilled_at'], ), reflection: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}reflection'], ), ); } @override $RewardClaimsTable createAlias(String alias) { return $RewardClaimsTable(attachedDatabase, alias); } } class RewardClaim extends DataClass implements Insertable { final String id; final String declarationId; final String milestoneReachedAt; final bool fulfilled; final String? fulfilledAt; final String? reflection; const RewardClaim({ required this.id, required this.declarationId, required this.milestoneReachedAt, required this.fulfilled, this.fulfilledAt, this.reflection, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['declaration_id'] = Variable(declarationId); map['milestone_reached_at'] = Variable(milestoneReachedAt); map['fulfilled'] = Variable(fulfilled); if (!nullToAbsent || fulfilledAt != null) { map['fulfilled_at'] = Variable(fulfilledAt); } if (!nullToAbsent || reflection != null) { map['reflection'] = Variable(reflection); } return map; } RewardClaimsCompanion toCompanion(bool nullToAbsent) { return RewardClaimsCompanion( id: Value(id), declarationId: Value(declarationId), milestoneReachedAt: Value(milestoneReachedAt), fulfilled: Value(fulfilled), fulfilledAt: fulfilledAt == null && nullToAbsent ? const Value.absent() : Value(fulfilledAt), reflection: reflection == null && nullToAbsent ? const Value.absent() : Value(reflection), ); } factory RewardClaim.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return RewardClaim( id: serializer.fromJson(json['id']), declarationId: serializer.fromJson(json['declarationId']), milestoneReachedAt: serializer.fromJson( json['milestoneReachedAt'], ), fulfilled: serializer.fromJson(json['fulfilled']), fulfilledAt: serializer.fromJson(json['fulfilledAt']), reflection: serializer.fromJson(json['reflection']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'declarationId': serializer.toJson(declarationId), 'milestoneReachedAt': serializer.toJson(milestoneReachedAt), 'fulfilled': serializer.toJson(fulfilled), 'fulfilledAt': serializer.toJson(fulfilledAt), 'reflection': serializer.toJson(reflection), }; } RewardClaim copyWith({ String? id, String? declarationId, String? milestoneReachedAt, bool? fulfilled, Value fulfilledAt = const Value.absent(), Value reflection = const Value.absent(), }) => RewardClaim( id: id ?? this.id, declarationId: declarationId ?? this.declarationId, milestoneReachedAt: milestoneReachedAt ?? this.milestoneReachedAt, fulfilled: fulfilled ?? this.fulfilled, fulfilledAt: fulfilledAt.present ? fulfilledAt.value : this.fulfilledAt, reflection: reflection.present ? reflection.value : this.reflection, ); RewardClaim copyWithCompanion(RewardClaimsCompanion data) { return RewardClaim( id: data.id.present ? data.id.value : this.id, declarationId: data.declarationId.present ? data.declarationId.value : this.declarationId, milestoneReachedAt: data.milestoneReachedAt.present ? data.milestoneReachedAt.value : this.milestoneReachedAt, fulfilled: data.fulfilled.present ? data.fulfilled.value : this.fulfilled, fulfilledAt: data.fulfilledAt.present ? data.fulfilledAt.value : this.fulfilledAt, reflection: data.reflection.present ? data.reflection.value : this.reflection, ); } @override String toString() { return (StringBuffer('RewardClaim(') ..write('id: $id, ') ..write('declarationId: $declarationId, ') ..write('milestoneReachedAt: $milestoneReachedAt, ') ..write('fulfilled: $fulfilled, ') ..write('fulfilledAt: $fulfilledAt, ') ..write('reflection: $reflection') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, declarationId, milestoneReachedAt, fulfilled, fulfilledAt, reflection, ); @override bool operator ==(Object other) => identical(this, other) || (other is RewardClaim && other.id == this.id && other.declarationId == this.declarationId && other.milestoneReachedAt == this.milestoneReachedAt && other.fulfilled == this.fulfilled && other.fulfilledAt == this.fulfilledAt && other.reflection == this.reflection); } class RewardClaimsCompanion extends UpdateCompanion { final Value id; final Value declarationId; final Value milestoneReachedAt; final Value fulfilled; final Value fulfilledAt; final Value reflection; final Value rowid; const RewardClaimsCompanion({ this.id = const Value.absent(), this.declarationId = const Value.absent(), this.milestoneReachedAt = const Value.absent(), this.fulfilled = const Value.absent(), this.fulfilledAt = const Value.absent(), this.reflection = const Value.absent(), this.rowid = const Value.absent(), }); RewardClaimsCompanion.insert({ required String id, required String declarationId, required String milestoneReachedAt, required bool fulfilled, this.fulfilledAt = const Value.absent(), this.reflection = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), declarationId = Value(declarationId), milestoneReachedAt = Value(milestoneReachedAt), fulfilled = Value(fulfilled); static Insertable custom({ Expression? id, Expression? declarationId, Expression? milestoneReachedAt, Expression? fulfilled, Expression? fulfilledAt, Expression? reflection, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (declarationId != null) 'declaration_id': declarationId, if (milestoneReachedAt != null) 'milestone_reached_at': milestoneReachedAt, if (fulfilled != null) 'fulfilled': fulfilled, if (fulfilledAt != null) 'fulfilled_at': fulfilledAt, if (reflection != null) 'reflection': reflection, if (rowid != null) 'rowid': rowid, }); } RewardClaimsCompanion copyWith({ Value? id, Value? declarationId, Value? milestoneReachedAt, Value? fulfilled, Value? fulfilledAt, Value? reflection, Value? rowid, }) { return RewardClaimsCompanion( id: id ?? this.id, declarationId: declarationId ?? this.declarationId, milestoneReachedAt: milestoneReachedAt ?? this.milestoneReachedAt, fulfilled: fulfilled ?? this.fulfilled, fulfilledAt: fulfilledAt ?? this.fulfilledAt, reflection: reflection ?? this.reflection, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (declarationId.present) { map['declaration_id'] = Variable(declarationId.value); } if (milestoneReachedAt.present) { map['milestone_reached_at'] = Variable(milestoneReachedAt.value); } if (fulfilled.present) { map['fulfilled'] = Variable(fulfilled.value); } if (fulfilledAt.present) { map['fulfilled_at'] = Variable(fulfilledAt.value); } if (reflection.present) { map['reflection'] = Variable(reflection.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('RewardClaimsCompanion(') ..write('id: $id, ') ..write('declarationId: $declarationId, ') ..write('milestoneReachedAt: $milestoneReachedAt, ') ..write('fulfilled: $fulfilled, ') ..write('fulfilledAt: $fulfilledAt, ') ..write('reflection: $reflection, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $ReflectionsTable extends Reflections with TableInfo<$ReflectionsTable, Reflection> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ReflectionsTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _userIdMeta = const VerificationMeta('userId'); @override late final GeneratedColumn userId = GeneratedColumn( 'user_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'REFERENCES users(id) NOT NULL', ); static const VerificationMeta _scopeMeta = const VerificationMeta('scope'); @override late final GeneratedColumn scope = GeneratedColumn( 'scope', aliasedName, false, check: () => const CustomExpression( "scope IN ('weekly','monthly','phase_end')", ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _periodStartMeta = const VerificationMeta( 'periodStart', ); @override late final GeneratedColumn periodStart = GeneratedColumn( 'period_start', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _periodEndMeta = const VerificationMeta( 'periodEnd', ); @override late final GeneratedColumn periodEnd = GeneratedColumn( 'period_end', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _phaseIdMeta = const VerificationMeta( 'phaseId', ); @override late final GeneratedColumn phaseId = GeneratedColumn( 'phase_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NULL REFERENCES phases(id) ON DELETE SET NULL', ); static const VerificationMeta _keptMeta = const VerificationMeta('kept'); @override late final GeneratedColumn kept = GeneratedColumn( 'kept', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _missedMeta = const VerificationMeta('missed'); @override late final GeneratedColumn missed = GeneratedColumn( 'missed', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _adjustMeta = const VerificationMeta('adjust'); @override late final GeneratedColumn adjust = GeneratedColumn( 'adjust', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _identityNoteMeta = const VerificationMeta( 'identityNote', ); @override late final GeneratedColumn identityNote = GeneratedColumn( 'identity_note', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _minimumRatioMeta = const VerificationMeta( 'minimumRatio', ); @override late final GeneratedColumn minimumRatio = GeneratedColumn( 'minimum_ratio', aliasedName, true, check: () => const CustomExpression( "minimum_ratio IS NULL OR (minimum_ratio BETWEEN 0 AND 1)", ), type: DriftSqlType.double, requiredDuringInsert: false, ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [ id, userId, scope, periodStart, periodEnd, phaseId, kept, missed, adjust, identityNote, minimumRatio, createdAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'reflections'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('user_id')) { context.handle( _userIdMeta, userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta), ); } else if (isInserting) { context.missing(_userIdMeta); } if (data.containsKey('scope')) { context.handle( _scopeMeta, scope.isAcceptableOrUnknown(data['scope']!, _scopeMeta), ); } else if (isInserting) { context.missing(_scopeMeta); } if (data.containsKey('period_start')) { context.handle( _periodStartMeta, periodStart.isAcceptableOrUnknown( data['period_start']!, _periodStartMeta, ), ); } else if (isInserting) { context.missing(_periodStartMeta); } if (data.containsKey('period_end')) { context.handle( _periodEndMeta, periodEnd.isAcceptableOrUnknown(data['period_end']!, _periodEndMeta), ); } else if (isInserting) { context.missing(_periodEndMeta); } if (data.containsKey('phase_id')) { context.handle( _phaseIdMeta, phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta), ); } if (data.containsKey('kept')) { context.handle( _keptMeta, kept.isAcceptableOrUnknown(data['kept']!, _keptMeta), ); } if (data.containsKey('missed')) { context.handle( _missedMeta, missed.isAcceptableOrUnknown(data['missed']!, _missedMeta), ); } if (data.containsKey('adjust')) { context.handle( _adjustMeta, adjust.isAcceptableOrUnknown(data['adjust']!, _adjustMeta), ); } if (data.containsKey('identity_note')) { context.handle( _identityNoteMeta, identityNote.isAcceptableOrUnknown( data['identity_note']!, _identityNoteMeta, ), ); } if (data.containsKey('minimum_ratio')) { context.handle( _minimumRatioMeta, minimumRatio.isAcceptableOrUnknown( data['minimum_ratio']!, _minimumRatioMeta, ), ); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } return context; } @override Set get $primaryKey => {id}; @override Reflection map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Reflection( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, userId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}user_id'], )!, scope: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}scope'], )!, periodStart: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}period_start'], )!, periodEnd: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}period_end'], )!, phaseId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}phase_id'], ), kept: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}kept'], ), missed: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}missed'], ), adjust: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}adjust'], ), identityNote: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}identity_note'], ), minimumRatio: attachedDatabase.typeMapping.read( DriftSqlType.double, data['${effectivePrefix}minimum_ratio'], ), createdAt: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}created_at'], ), ); } @override $ReflectionsTable createAlias(String alias) { return $ReflectionsTable(attachedDatabase, alias); } } class Reflection extends DataClass implements Insertable { final String id; final String userId; final String scope; final String periodStart; final String periodEnd; final String? phaseId; final String? kept; final String? missed; final String? adjust; final String? identityNote; final double? minimumRatio; final String? createdAt; const Reflection({ required this.id, required this.userId, required this.scope, required this.periodStart, required this.periodEnd, this.phaseId, this.kept, this.missed, this.adjust, this.identityNote, this.minimumRatio, this.createdAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['user_id'] = Variable(userId); map['scope'] = Variable(scope); map['period_start'] = Variable(periodStart); map['period_end'] = Variable(periodEnd); if (!nullToAbsent || phaseId != null) { map['phase_id'] = Variable(phaseId); } if (!nullToAbsent || kept != null) { map['kept'] = Variable(kept); } if (!nullToAbsent || missed != null) { map['missed'] = Variable(missed); } if (!nullToAbsent || adjust != null) { map['adjust'] = Variable(adjust); } if (!nullToAbsent || identityNote != null) { map['identity_note'] = Variable(identityNote); } if (!nullToAbsent || minimumRatio != null) { map['minimum_ratio'] = Variable(minimumRatio); } if (!nullToAbsent || createdAt != null) { map['created_at'] = Variable(createdAt); } return map; } ReflectionsCompanion toCompanion(bool nullToAbsent) { return ReflectionsCompanion( id: Value(id), userId: Value(userId), scope: Value(scope), periodStart: Value(periodStart), periodEnd: Value(periodEnd), phaseId: phaseId == null && nullToAbsent ? const Value.absent() : Value(phaseId), kept: kept == null && nullToAbsent ? const Value.absent() : Value(kept), missed: missed == null && nullToAbsent ? const Value.absent() : Value(missed), adjust: adjust == null && nullToAbsent ? const Value.absent() : Value(adjust), identityNote: identityNote == null && nullToAbsent ? const Value.absent() : Value(identityNote), minimumRatio: minimumRatio == null && nullToAbsent ? const Value.absent() : Value(minimumRatio), createdAt: createdAt == null && nullToAbsent ? const Value.absent() : Value(createdAt), ); } factory Reflection.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Reflection( id: serializer.fromJson(json['id']), userId: serializer.fromJson(json['userId']), scope: serializer.fromJson(json['scope']), periodStart: serializer.fromJson(json['periodStart']), periodEnd: serializer.fromJson(json['periodEnd']), phaseId: serializer.fromJson(json['phaseId']), kept: serializer.fromJson(json['kept']), missed: serializer.fromJson(json['missed']), adjust: serializer.fromJson(json['adjust']), identityNote: serializer.fromJson(json['identityNote']), minimumRatio: serializer.fromJson(json['minimumRatio']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'userId': serializer.toJson(userId), 'scope': serializer.toJson(scope), 'periodStart': serializer.toJson(periodStart), 'periodEnd': serializer.toJson(periodEnd), 'phaseId': serializer.toJson(phaseId), 'kept': serializer.toJson(kept), 'missed': serializer.toJson(missed), 'adjust': serializer.toJson(adjust), 'identityNote': serializer.toJson(identityNote), 'minimumRatio': serializer.toJson(minimumRatio), 'createdAt': serializer.toJson(createdAt), }; } Reflection copyWith({ String? id, String? userId, String? scope, String? periodStart, String? periodEnd, Value phaseId = const Value.absent(), Value kept = const Value.absent(), Value missed = const Value.absent(), Value adjust = const Value.absent(), Value identityNote = const Value.absent(), Value minimumRatio = const Value.absent(), Value createdAt = const Value.absent(), }) => Reflection( id: id ?? this.id, userId: userId ?? this.userId, scope: scope ?? this.scope, periodStart: periodStart ?? this.periodStart, periodEnd: periodEnd ?? this.periodEnd, phaseId: phaseId.present ? phaseId.value : this.phaseId, kept: kept.present ? kept.value : this.kept, missed: missed.present ? missed.value : this.missed, adjust: adjust.present ? adjust.value : this.adjust, identityNote: identityNote.present ? identityNote.value : this.identityNote, minimumRatio: minimumRatio.present ? minimumRatio.value : this.minimumRatio, createdAt: createdAt.present ? createdAt.value : this.createdAt, ); Reflection copyWithCompanion(ReflectionsCompanion data) { return Reflection( id: data.id.present ? data.id.value : this.id, userId: data.userId.present ? data.userId.value : this.userId, scope: data.scope.present ? data.scope.value : this.scope, periodStart: data.periodStart.present ? data.periodStart.value : this.periodStart, periodEnd: data.periodEnd.present ? data.periodEnd.value : this.periodEnd, phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId, kept: data.kept.present ? data.kept.value : this.kept, missed: data.missed.present ? data.missed.value : this.missed, adjust: data.adjust.present ? data.adjust.value : this.adjust, identityNote: data.identityNote.present ? data.identityNote.value : this.identityNote, minimumRatio: data.minimumRatio.present ? data.minimumRatio.value : this.minimumRatio, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('Reflection(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('scope: $scope, ') ..write('periodStart: $periodStart, ') ..write('periodEnd: $periodEnd, ') ..write('phaseId: $phaseId, ') ..write('kept: $kept, ') ..write('missed: $missed, ') ..write('adjust: $adjust, ') ..write('identityNote: $identityNote, ') ..write('minimumRatio: $minimumRatio, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, userId, scope, periodStart, periodEnd, phaseId, kept, missed, adjust, identityNote, minimumRatio, createdAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is Reflection && other.id == this.id && other.userId == this.userId && other.scope == this.scope && other.periodStart == this.periodStart && other.periodEnd == this.periodEnd && other.phaseId == this.phaseId && other.kept == this.kept && other.missed == this.missed && other.adjust == this.adjust && other.identityNote == this.identityNote && other.minimumRatio == this.minimumRatio && other.createdAt == this.createdAt); } class ReflectionsCompanion extends UpdateCompanion { final Value id; final Value userId; final Value scope; final Value periodStart; final Value periodEnd; final Value phaseId; final Value kept; final Value missed; final Value adjust; final Value identityNote; final Value minimumRatio; final Value createdAt; final Value rowid; const ReflectionsCompanion({ this.id = const Value.absent(), this.userId = const Value.absent(), this.scope = const Value.absent(), this.periodStart = const Value.absent(), this.periodEnd = const Value.absent(), this.phaseId = const Value.absent(), this.kept = const Value.absent(), this.missed = const Value.absent(), this.adjust = const Value.absent(), this.identityNote = const Value.absent(), this.minimumRatio = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); ReflectionsCompanion.insert({ required String id, required String userId, required String scope, required String periodStart, required String periodEnd, this.phaseId = const Value.absent(), this.kept = const Value.absent(), this.missed = const Value.absent(), this.adjust = const Value.absent(), this.identityNote = const Value.absent(), this.minimumRatio = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), userId = Value(userId), scope = Value(scope), periodStart = Value(periodStart), periodEnd = Value(periodEnd); static Insertable custom({ Expression? id, Expression? userId, Expression? scope, Expression? periodStart, Expression? periodEnd, Expression? phaseId, Expression? kept, Expression? missed, Expression? adjust, Expression? identityNote, Expression? minimumRatio, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (userId != null) 'user_id': userId, if (scope != null) 'scope': scope, if (periodStart != null) 'period_start': periodStart, if (periodEnd != null) 'period_end': periodEnd, if (phaseId != null) 'phase_id': phaseId, if (kept != null) 'kept': kept, if (missed != null) 'missed': missed, if (adjust != null) 'adjust': adjust, if (identityNote != null) 'identity_note': identityNote, if (minimumRatio != null) 'minimum_ratio': minimumRatio, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } ReflectionsCompanion copyWith({ Value? id, Value? userId, Value? scope, Value? periodStart, Value? periodEnd, Value? phaseId, Value? kept, Value? missed, Value? adjust, Value? identityNote, Value? minimumRatio, Value? createdAt, Value? rowid, }) { return ReflectionsCompanion( id: id ?? this.id, userId: userId ?? this.userId, scope: scope ?? this.scope, periodStart: periodStart ?? this.periodStart, periodEnd: periodEnd ?? this.periodEnd, phaseId: phaseId ?? this.phaseId, kept: kept ?? this.kept, missed: missed ?? this.missed, adjust: adjust ?? this.adjust, identityNote: identityNote ?? this.identityNote, minimumRatio: minimumRatio ?? this.minimumRatio, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (userId.present) { map['user_id'] = Variable(userId.value); } if (scope.present) { map['scope'] = Variable(scope.value); } if (periodStart.present) { map['period_start'] = Variable(periodStart.value); } if (periodEnd.present) { map['period_end'] = Variable(periodEnd.value); } if (phaseId.present) { map['phase_id'] = Variable(phaseId.value); } if (kept.present) { map['kept'] = Variable(kept.value); } if (missed.present) { map['missed'] = Variable(missed.value); } if (adjust.present) { map['adjust'] = Variable(adjust.value); } if (identityNote.present) { map['identity_note'] = Variable(identityNote.value); } if (minimumRatio.present) { map['minimum_ratio'] = Variable(minimumRatio.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ReflectionsCompanion(') ..write('id: $id, ') ..write('userId: $userId, ') ..write('scope: $scope, ') ..write('periodStart: $periodStart, ') ..write('periodEnd: $periodEnd, ') ..write('phaseId: $phaseId, ') ..write('kept: $kept, ') ..write('missed: $missed, ') ..write('adjust: $adjust, ') ..write('identityNote: $identityNote, ') ..write('minimumRatio: $minimumRatio, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $MetaKvTable extends MetaKv with TableInfo<$MetaKvTable, MetaKvData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $MetaKvTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _keyMeta = const VerificationMeta('key'); @override late final GeneratedColumn key = GeneratedColumn( 'key', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _valueMeta = const VerificationMeta('value'); @override late final GeneratedColumn value = GeneratedColumn( 'value', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); @override List get $columns => [key, value]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'meta_kv'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('key')) { context.handle( _keyMeta, key.isAcceptableOrUnknown(data['key']!, _keyMeta), ); } else if (isInserting) { context.missing(_keyMeta); } if (data.containsKey('value')) { context.handle( _valueMeta, value.isAcceptableOrUnknown(data['value']!, _valueMeta), ); } else if (isInserting) { context.missing(_valueMeta); } return context; } @override Set get $primaryKey => {key}; @override MetaKvData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return MetaKvData( key: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}key'], )!, value: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}value'], )!, ); } @override $MetaKvTable createAlias(String alias) { return $MetaKvTable(attachedDatabase, alias); } } class MetaKvData extends DataClass implements Insertable { final String key; final String value; const MetaKvData({required this.key, required this.value}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['key'] = Variable(key); map['value'] = Variable(value); return map; } MetaKvCompanion toCompanion(bool nullToAbsent) { return MetaKvCompanion(key: Value(key), value: Value(value)); } factory MetaKvData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return MetaKvData( key: serializer.fromJson(json['key']), value: serializer.fromJson(json['value']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'key': serializer.toJson(key), 'value': serializer.toJson(value), }; } MetaKvData copyWith({String? key, String? value}) => MetaKvData(key: key ?? this.key, value: value ?? this.value); MetaKvData copyWithCompanion(MetaKvCompanion data) { return MetaKvData( key: data.key.present ? data.key.value : this.key, value: data.value.present ? data.value.value : this.value, ); } @override String toString() { return (StringBuffer('MetaKvData(') ..write('key: $key, ') ..write('value: $value') ..write(')')) .toString(); } @override int get hashCode => Object.hash(key, value); @override bool operator ==(Object other) => identical(this, other) || (other is MetaKvData && other.key == this.key && other.value == this.value); } class MetaKvCompanion extends UpdateCompanion { final Value key; final Value value; final Value rowid; const MetaKvCompanion({ this.key = const Value.absent(), this.value = const Value.absent(), this.rowid = const Value.absent(), }); MetaKvCompanion.insert({ required String key, required String value, this.rowid = const Value.absent(), }) : key = Value(key), value = Value(value); static Insertable custom({ Expression? key, Expression? value, Expression? rowid, }) { return RawValuesInsertable({ if (key != null) 'key': key, if (value != null) 'value': value, if (rowid != null) 'rowid': rowid, }); } MetaKvCompanion copyWith({ Value? key, Value? value, Value? rowid, }) { return MetaKvCompanion( key: key ?? this.key, value: value ?? this.value, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (key.present) { map['key'] = Variable(key.value); } if (value.present) { map['value'] = Variable(value.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('MetaKvCompanion(') ..write('key: $key, ') ..write('value: $value, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $ProtocolsTable protocols = $ProtocolsTable(this); late final $BreakProtocolsTable breakProtocols = $BreakProtocolsTable(this); late final $CommonFramesTable commonFrames = $CommonFramesTable(this); late final $MethodologiesTable methodologies = $MethodologiesTable(this); late final $FramePatternsTable framePatterns = $FramePatternsTable(this); late final $RewardMenuItemsTable rewardMenuItems = $RewardMenuItemsTable( this, ); late final $ReferencesTable references = $ReferencesTable(this); late final $DietPatternsTable dietPatterns = $DietPatternsTable(this); late final $UsersTable users = $UsersTable(this); late final $PhasesTable phases = $PhasesTable(this); late final $HabitsTable habits = $HabitsTable(this); late final $HabitDoseVariantsTable habitDoseVariants = $HabitDoseVariantsTable(this); late final $IfThenRulesTable ifThenRules = $IfThenRulesTable(this); late final $TrackerEntriesTable trackerEntries = $TrackerEntriesTable(this); late final $LapseLogsTable lapseLogs = $LapseLogsTable(this); late final $UrgeLogsTable urgeLogs = $UrgeLogsTable(this); late final $RewardDeclarationsTable rewardDeclarations = $RewardDeclarationsTable(this); late final $RewardClaimsTable rewardClaims = $RewardClaimsTable(this); late final $ReflectionsTable reflections = $ReflectionsTable(this); late final $MetaKvTable metaKv = $MetaKvTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ protocols, breakProtocols, commonFrames, methodologies, framePatterns, rewardMenuItems, references, dietPatterns, users, phases, habits, habitDoseVariants, ifThenRules, trackerEntries, lapseLogs, urgeLogs, rewardDeclarations, rewardClaims, reflections, metaKv, ]; @override StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ WritePropagation( on: TableUpdateQuery.onTableName( 'phases', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('habits', kind: UpdateKind.update)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'habits', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('habit_dose_variants', kind: UpdateKind.delete)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'habits', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('if_then_rules', kind: UpdateKind.delete)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'habit_dose_variants', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('tracker_entries', kind: UpdateKind.update)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'phases', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('reflections', kind: UpdateKind.update)], ), ]); } typedef $$ProtocolsTableCreateCompanionBuilder = ProtocolsCompanion Function({ required String id, required String category, required String title, Value titleEn, required String what, required String whenText, required String dose, required String why, required String howJson, required String checkText, Value caution, Value defaultAnchorJson, Value minDoseForStart, Value referenceIdsJson, Value evidenceStrength, Value sourceDoc, Value rowid, }); typedef $$ProtocolsTableUpdateCompanionBuilder = ProtocolsCompanion Function({ Value id, Value category, Value title, Value titleEn, Value what, Value whenText, Value dose, Value why, Value howJson, Value checkText, Value caution, Value defaultAnchorJson, Value minDoseForStart, Value referenceIdsJson, Value evidenceStrength, Value sourceDoc, Value rowid, }); class $$ProtocolsTableFilterComposer extends Composer<_$AppDatabase, $ProtocolsTable> { $$ProtocolsTableFilterComposer({ 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 category => $composableBuilder( column: $table.category, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get titleEn => $composableBuilder( column: $table.titleEn, builder: (column) => ColumnFilters(column), ); ColumnFilters get what => $composableBuilder( column: $table.what, builder: (column) => ColumnFilters(column), ); ColumnFilters get whenText => $composableBuilder( column: $table.whenText, builder: (column) => ColumnFilters(column), ); ColumnFilters get dose => $composableBuilder( column: $table.dose, builder: (column) => ColumnFilters(column), ); ColumnFilters get why => $composableBuilder( column: $table.why, builder: (column) => ColumnFilters(column), ); ColumnFilters get howJson => $composableBuilder( column: $table.howJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get checkText => $composableBuilder( column: $table.checkText, builder: (column) => ColumnFilters(column), ); ColumnFilters get caution => $composableBuilder( column: $table.caution, builder: (column) => ColumnFilters(column), ); ColumnFilters get defaultAnchorJson => $composableBuilder( column: $table.defaultAnchorJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get minDoseForStart => $composableBuilder( column: $table.minDoseForStart, builder: (column) => ColumnFilters(column), ); ColumnFilters get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnFilters(column), ); ColumnFilters get sourceDoc => $composableBuilder( column: $table.sourceDoc, builder: (column) => ColumnFilters(column), ); } class $$ProtocolsTableOrderingComposer extends Composer<_$AppDatabase, $ProtocolsTable> { $$ProtocolsTableOrderingComposer({ 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 category => $composableBuilder( column: $table.category, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get titleEn => $composableBuilder( column: $table.titleEn, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get what => $composableBuilder( column: $table.what, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get whenText => $composableBuilder( column: $table.whenText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get dose => $composableBuilder( column: $table.dose, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get why => $composableBuilder( column: $table.why, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get howJson => $composableBuilder( column: $table.howJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get checkText => $composableBuilder( column: $table.checkText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get caution => $composableBuilder( column: $table.caution, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get defaultAnchorJson => $composableBuilder( column: $table.defaultAnchorJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get minDoseForStart => $composableBuilder( column: $table.minDoseForStart, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get sourceDoc => $composableBuilder( column: $table.sourceDoc, builder: (column) => ColumnOrderings(column), ); } class $$ProtocolsTableAnnotationComposer extends Composer<_$AppDatabase, $ProtocolsTable> { $$ProtocolsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get category => $composableBuilder(column: $table.category, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get titleEn => $composableBuilder(column: $table.titleEn, builder: (column) => column); GeneratedColumn get what => $composableBuilder(column: $table.what, builder: (column) => column); GeneratedColumn get whenText => $composableBuilder(column: $table.whenText, builder: (column) => column); GeneratedColumn get dose => $composableBuilder(column: $table.dose, builder: (column) => column); GeneratedColumn get why => $composableBuilder(column: $table.why, builder: (column) => column); GeneratedColumn get howJson => $composableBuilder(column: $table.howJson, builder: (column) => column); GeneratedColumn get checkText => $composableBuilder(column: $table.checkText, builder: (column) => column); GeneratedColumn get caution => $composableBuilder(column: $table.caution, builder: (column) => column); GeneratedColumn get defaultAnchorJson => $composableBuilder( column: $table.defaultAnchorJson, builder: (column) => column, ); GeneratedColumn get minDoseForStart => $composableBuilder( column: $table.minDoseForStart, builder: (column) => column, ); GeneratedColumn get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => column, ); GeneratedColumn get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => column, ); GeneratedColumn get sourceDoc => $composableBuilder(column: $table.sourceDoc, builder: (column) => column); } class $$ProtocolsTableTableManager extends RootTableManager< _$AppDatabase, $ProtocolsTable, Protocol, $$ProtocolsTableFilterComposer, $$ProtocolsTableOrderingComposer, $$ProtocolsTableAnnotationComposer, $$ProtocolsTableCreateCompanionBuilder, $$ProtocolsTableUpdateCompanionBuilder, (Protocol, BaseReferences<_$AppDatabase, $ProtocolsTable, Protocol>), Protocol, PrefetchHooks Function() > { $$ProtocolsTableTableManager(_$AppDatabase db, $ProtocolsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$ProtocolsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ProtocolsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ProtocolsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value category = const Value.absent(), Value title = const Value.absent(), Value titleEn = const Value.absent(), Value what = const Value.absent(), Value whenText = const Value.absent(), Value dose = const Value.absent(), Value why = const Value.absent(), Value howJson = const Value.absent(), Value checkText = const Value.absent(), Value caution = const Value.absent(), Value defaultAnchorJson = const Value.absent(), Value minDoseForStart = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value evidenceStrength = const Value.absent(), Value sourceDoc = const Value.absent(), Value rowid = const Value.absent(), }) => ProtocolsCompanion( id: id, category: category, title: title, titleEn: titleEn, what: what, whenText: whenText, dose: dose, why: why, howJson: howJson, checkText: checkText, caution: caution, defaultAnchorJson: defaultAnchorJson, minDoseForStart: minDoseForStart, referenceIdsJson: referenceIdsJson, evidenceStrength: evidenceStrength, sourceDoc: sourceDoc, rowid: rowid, ), createCompanionCallback: ({ required String id, required String category, required String title, Value titleEn = const Value.absent(), required String what, required String whenText, required String dose, required String why, required String howJson, required String checkText, Value caution = const Value.absent(), Value defaultAnchorJson = const Value.absent(), Value minDoseForStart = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value evidenceStrength = const Value.absent(), Value sourceDoc = const Value.absent(), Value rowid = const Value.absent(), }) => ProtocolsCompanion.insert( id: id, category: category, title: title, titleEn: titleEn, what: what, whenText: whenText, dose: dose, why: why, howJson: howJson, checkText: checkText, caution: caution, defaultAnchorJson: defaultAnchorJson, minDoseForStart: minDoseForStart, referenceIdsJson: referenceIdsJson, evidenceStrength: evidenceStrength, sourceDoc: sourceDoc, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$ProtocolsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ProtocolsTable, Protocol, $$ProtocolsTableFilterComposer, $$ProtocolsTableOrderingComposer, $$ProtocolsTableAnnotationComposer, $$ProtocolsTableCreateCompanionBuilder, $$ProtocolsTableUpdateCompanionBuilder, (Protocol, BaseReferences<_$AppDatabase, $ProtocolsTable, Protocol>), Protocol, PrefetchHooks Function() >; typedef $$BreakProtocolsTableCreateCompanionBuilder = BreakProtocolsCompanion Function({ required String id, required String category, required String title, required String hubermanSummary, Value frameExamplesJson, required String phasesJson, required String defaultCommonFramesJson, Value toolsJson, Value medicalWarning, Value referenceIdsJson, Value rowid, }); typedef $$BreakProtocolsTableUpdateCompanionBuilder = BreakProtocolsCompanion Function({ Value id, Value category, Value title, Value hubermanSummary, Value frameExamplesJson, Value phasesJson, Value defaultCommonFramesJson, Value toolsJson, Value medicalWarning, Value referenceIdsJson, Value rowid, }); class $$BreakProtocolsTableFilterComposer extends Composer<_$AppDatabase, $BreakProtocolsTable> { $$BreakProtocolsTableFilterComposer({ 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 category => $composableBuilder( column: $table.category, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get hubermanSummary => $composableBuilder( column: $table.hubermanSummary, builder: (column) => ColumnFilters(column), ); ColumnFilters get frameExamplesJson => $composableBuilder( column: $table.frameExamplesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get phasesJson => $composableBuilder( column: $table.phasesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get defaultCommonFramesJson => $composableBuilder( column: $table.defaultCommonFramesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get toolsJson => $composableBuilder( column: $table.toolsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => ColumnFilters(column), ); ColumnFilters get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnFilters(column), ); } class $$BreakProtocolsTableOrderingComposer extends Composer<_$AppDatabase, $BreakProtocolsTable> { $$BreakProtocolsTableOrderingComposer({ 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 category => $composableBuilder( column: $table.category, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get hubermanSummary => $composableBuilder( column: $table.hubermanSummary, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get frameExamplesJson => $composableBuilder( column: $table.frameExamplesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get phasesJson => $composableBuilder( column: $table.phasesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get defaultCommonFramesJson => $composableBuilder( column: $table.defaultCommonFramesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get toolsJson => $composableBuilder( column: $table.toolsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnOrderings(column), ); } class $$BreakProtocolsTableAnnotationComposer extends Composer<_$AppDatabase, $BreakProtocolsTable> { $$BreakProtocolsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get category => $composableBuilder(column: $table.category, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get hubermanSummary => $composableBuilder( column: $table.hubermanSummary, builder: (column) => column, ); GeneratedColumn get frameExamplesJson => $composableBuilder( column: $table.frameExamplesJson, builder: (column) => column, ); GeneratedColumn get phasesJson => $composableBuilder( column: $table.phasesJson, builder: (column) => column, ); GeneratedColumn get defaultCommonFramesJson => $composableBuilder( column: $table.defaultCommonFramesJson, builder: (column) => column, ); GeneratedColumn get toolsJson => $composableBuilder(column: $table.toolsJson, builder: (column) => column); GeneratedColumn get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => column, ); GeneratedColumn get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => column, ); } class $$BreakProtocolsTableTableManager extends RootTableManager< _$AppDatabase, $BreakProtocolsTable, BreakProtocol, $$BreakProtocolsTableFilterComposer, $$BreakProtocolsTableOrderingComposer, $$BreakProtocolsTableAnnotationComposer, $$BreakProtocolsTableCreateCompanionBuilder, $$BreakProtocolsTableUpdateCompanionBuilder, ( BreakProtocol, BaseReferences<_$AppDatabase, $BreakProtocolsTable, BreakProtocol>, ), BreakProtocol, PrefetchHooks Function() > { $$BreakProtocolsTableTableManager( _$AppDatabase db, $BreakProtocolsTable table, ) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$BreakProtocolsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$BreakProtocolsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$BreakProtocolsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value category = const Value.absent(), Value title = const Value.absent(), Value hubermanSummary = const Value.absent(), Value frameExamplesJson = const Value.absent(), Value phasesJson = const Value.absent(), Value defaultCommonFramesJson = const Value.absent(), Value toolsJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => BreakProtocolsCompanion( id: id, category: category, title: title, hubermanSummary: hubermanSummary, frameExamplesJson: frameExamplesJson, phasesJson: phasesJson, defaultCommonFramesJson: defaultCommonFramesJson, toolsJson: toolsJson, medicalWarning: medicalWarning, referenceIdsJson: referenceIdsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String category, required String title, required String hubermanSummary, Value frameExamplesJson = const Value.absent(), required String phasesJson, required String defaultCommonFramesJson, Value toolsJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => BreakProtocolsCompanion.insert( id: id, category: category, title: title, hubermanSummary: hubermanSummary, frameExamplesJson: frameExamplesJson, phasesJson: phasesJson, defaultCommonFramesJson: defaultCommonFramesJson, toolsJson: toolsJson, medicalWarning: medicalWarning, referenceIdsJson: referenceIdsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$BreakProtocolsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $BreakProtocolsTable, BreakProtocol, $$BreakProtocolsTableFilterComposer, $$BreakProtocolsTableOrderingComposer, $$BreakProtocolsTableAnnotationComposer, $$BreakProtocolsTableCreateCompanionBuilder, $$BreakProtocolsTableUpdateCompanionBuilder, ( BreakProtocol, BaseReferences<_$AppDatabase, $BreakProtocolsTable, BreakProtocol>, ), BreakProtocol, PrefetchHooks Function() >; typedef $$CommonFramesTableCreateCompanionBuilder = CommonFramesCompanion Function({ required String id, required String title, required String what, required String why, Value dose, Value howJson, required String checkText, Value applicableBreakCategoriesJson, Value referenceIdsJson, Value rowid, }); typedef $$CommonFramesTableUpdateCompanionBuilder = CommonFramesCompanion Function({ Value id, Value title, Value what, Value why, Value dose, Value howJson, Value checkText, Value applicableBreakCategoriesJson, Value referenceIdsJson, Value rowid, }); class $$CommonFramesTableFilterComposer extends Composer<_$AppDatabase, $CommonFramesTable> { $$CommonFramesTableFilterComposer({ 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 title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get what => $composableBuilder( column: $table.what, builder: (column) => ColumnFilters(column), ); ColumnFilters get why => $composableBuilder( column: $table.why, builder: (column) => ColumnFilters(column), ); ColumnFilters get dose => $composableBuilder( column: $table.dose, builder: (column) => ColumnFilters(column), ); ColumnFilters get howJson => $composableBuilder( column: $table.howJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get checkText => $composableBuilder( column: $table.checkText, builder: (column) => ColumnFilters(column), ); ColumnFilters get applicableBreakCategoriesJson => $composableBuilder( column: $table.applicableBreakCategoriesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnFilters(column), ); } class $$CommonFramesTableOrderingComposer extends Composer<_$AppDatabase, $CommonFramesTable> { $$CommonFramesTableOrderingComposer({ 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 title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get what => $composableBuilder( column: $table.what, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get why => $composableBuilder( column: $table.why, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get dose => $composableBuilder( column: $table.dose, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get howJson => $composableBuilder( column: $table.howJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get checkText => $composableBuilder( column: $table.checkText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get applicableBreakCategoriesJson => $composableBuilder( column: $table.applicableBreakCategoriesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnOrderings(column), ); } class $$CommonFramesTableAnnotationComposer extends Composer<_$AppDatabase, $CommonFramesTable> { $$CommonFramesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get what => $composableBuilder(column: $table.what, builder: (column) => column); GeneratedColumn get why => $composableBuilder(column: $table.why, builder: (column) => column); GeneratedColumn get dose => $composableBuilder(column: $table.dose, builder: (column) => column); GeneratedColumn get howJson => $composableBuilder(column: $table.howJson, builder: (column) => column); GeneratedColumn get checkText => $composableBuilder(column: $table.checkText, builder: (column) => column); GeneratedColumn get applicableBreakCategoriesJson => $composableBuilder( column: $table.applicableBreakCategoriesJson, builder: (column) => column, ); GeneratedColumn get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => column, ); } class $$CommonFramesTableTableManager extends RootTableManager< _$AppDatabase, $CommonFramesTable, CommonFrame, $$CommonFramesTableFilterComposer, $$CommonFramesTableOrderingComposer, $$CommonFramesTableAnnotationComposer, $$CommonFramesTableCreateCompanionBuilder, $$CommonFramesTableUpdateCompanionBuilder, ( CommonFrame, BaseReferences<_$AppDatabase, $CommonFramesTable, CommonFrame>, ), CommonFrame, PrefetchHooks Function() > { $$CommonFramesTableTableManager(_$AppDatabase db, $CommonFramesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$CommonFramesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$CommonFramesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$CommonFramesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value title = const Value.absent(), Value what = const Value.absent(), Value why = const Value.absent(), Value dose = const Value.absent(), Value howJson = const Value.absent(), Value checkText = const Value.absent(), Value applicableBreakCategoriesJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => CommonFramesCompanion( id: id, title: title, what: what, why: why, dose: dose, howJson: howJson, checkText: checkText, applicableBreakCategoriesJson: applicableBreakCategoriesJson, referenceIdsJson: referenceIdsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String title, required String what, required String why, Value dose = const Value.absent(), Value howJson = const Value.absent(), required String checkText, Value applicableBreakCategoriesJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => CommonFramesCompanion.insert( id: id, title: title, what: what, why: why, dose: dose, howJson: howJson, checkText: checkText, applicableBreakCategoriesJson: applicableBreakCategoriesJson, referenceIdsJson: referenceIdsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$CommonFramesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $CommonFramesTable, CommonFrame, $$CommonFramesTableFilterComposer, $$CommonFramesTableOrderingComposer, $$CommonFramesTableAnnotationComposer, $$CommonFramesTableCreateCompanionBuilder, $$CommonFramesTableUpdateCompanionBuilder, ( CommonFrame, BaseReferences<_$AppDatabase, $CommonFramesTable, CommonFrame>, ), CommonFrame, PrefetchHooks Function() >; typedef $$MethodologiesTableCreateCompanionBuilder = MethodologiesCompanion Function({ required String id, required String name, required String originator, required String oneLineDefinition, required String coreUnit, Value procedureJson, Value toolsJson, Value strengthsJson, Value weaknessesJson, Value goodFor, required int hubermanFitScore, Value isCoreEngine, Value referenceIdsJson, Value rowid, }); typedef $$MethodologiesTableUpdateCompanionBuilder = MethodologiesCompanion Function({ Value id, Value name, Value originator, Value oneLineDefinition, Value coreUnit, Value procedureJson, Value toolsJson, Value strengthsJson, Value weaknessesJson, Value goodFor, Value hubermanFitScore, Value isCoreEngine, Value referenceIdsJson, Value rowid, }); class $$MethodologiesTableFilterComposer extends Composer<_$AppDatabase, $MethodologiesTable> { $$MethodologiesTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column), ); ColumnFilters get originator => $composableBuilder( column: $table.originator, builder: (column) => ColumnFilters(column), ); ColumnFilters get oneLineDefinition => $composableBuilder( column: $table.oneLineDefinition, builder: (column) => ColumnFilters(column), ); ColumnFilters get coreUnit => $composableBuilder( column: $table.coreUnit, builder: (column) => ColumnFilters(column), ); ColumnFilters get procedureJson => $composableBuilder( column: $table.procedureJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get toolsJson => $composableBuilder( column: $table.toolsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get goodFor => $composableBuilder( column: $table.goodFor, builder: (column) => ColumnFilters(column), ); ColumnFilters get hubermanFitScore => $composableBuilder( column: $table.hubermanFitScore, builder: (column) => ColumnFilters(column), ); ColumnFilters get isCoreEngine => $composableBuilder( column: $table.isCoreEngine, builder: (column) => ColumnFilters(column), ); ColumnFilters get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnFilters(column), ); } class $$MethodologiesTableOrderingComposer extends Composer<_$AppDatabase, $MethodologiesTable> { $$MethodologiesTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get originator => $composableBuilder( column: $table.originator, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get oneLineDefinition => $composableBuilder( column: $table.oneLineDefinition, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get coreUnit => $composableBuilder( column: $table.coreUnit, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get procedureJson => $composableBuilder( column: $table.procedureJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get toolsJson => $composableBuilder( column: $table.toolsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get goodFor => $composableBuilder( column: $table.goodFor, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get hubermanFitScore => $composableBuilder( column: $table.hubermanFitScore, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get isCoreEngine => $composableBuilder( column: $table.isCoreEngine, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnOrderings(column), ); } class $$MethodologiesTableAnnotationComposer extends Composer<_$AppDatabase, $MethodologiesTable> { $$MethodologiesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get originator => $composableBuilder( column: $table.originator, builder: (column) => column, ); GeneratedColumn get oneLineDefinition => $composableBuilder( column: $table.oneLineDefinition, builder: (column) => column, ); GeneratedColumn get coreUnit => $composableBuilder(column: $table.coreUnit, builder: (column) => column); GeneratedColumn get procedureJson => $composableBuilder( column: $table.procedureJson, builder: (column) => column, ); GeneratedColumn get toolsJson => $composableBuilder(column: $table.toolsJson, builder: (column) => column); GeneratedColumn get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => column, ); GeneratedColumn get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => column, ); GeneratedColumn get goodFor => $composableBuilder(column: $table.goodFor, builder: (column) => column); GeneratedColumn get hubermanFitScore => $composableBuilder( column: $table.hubermanFitScore, builder: (column) => column, ); GeneratedColumn get isCoreEngine => $composableBuilder( column: $table.isCoreEngine, builder: (column) => column, ); GeneratedColumn get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => column, ); } class $$MethodologiesTableTableManager extends RootTableManager< _$AppDatabase, $MethodologiesTable, Methodology, $$MethodologiesTableFilterComposer, $$MethodologiesTableOrderingComposer, $$MethodologiesTableAnnotationComposer, $$MethodologiesTableCreateCompanionBuilder, $$MethodologiesTableUpdateCompanionBuilder, ( Methodology, BaseReferences<_$AppDatabase, $MethodologiesTable, Methodology>, ), Methodology, PrefetchHooks Function() > { $$MethodologiesTableTableManager(_$AppDatabase db, $MethodologiesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$MethodologiesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$MethodologiesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$MethodologiesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value originator = const Value.absent(), Value oneLineDefinition = const Value.absent(), Value coreUnit = const Value.absent(), Value procedureJson = const Value.absent(), Value toolsJson = const Value.absent(), Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), Value goodFor = const Value.absent(), Value hubermanFitScore = const Value.absent(), Value isCoreEngine = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => MethodologiesCompanion( id: id, name: name, originator: originator, oneLineDefinition: oneLineDefinition, coreUnit: coreUnit, procedureJson: procedureJson, toolsJson: toolsJson, strengthsJson: strengthsJson, weaknessesJson: weaknessesJson, goodFor: goodFor, hubermanFitScore: hubermanFitScore, isCoreEngine: isCoreEngine, referenceIdsJson: referenceIdsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String name, required String originator, required String oneLineDefinition, required String coreUnit, Value procedureJson = const Value.absent(), Value toolsJson = const Value.absent(), Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), Value goodFor = const Value.absent(), required int hubermanFitScore, Value isCoreEngine = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => MethodologiesCompanion.insert( id: id, name: name, originator: originator, oneLineDefinition: oneLineDefinition, coreUnit: coreUnit, procedureJson: procedureJson, toolsJson: toolsJson, strengthsJson: strengthsJson, weaknessesJson: weaknessesJson, goodFor: goodFor, hubermanFitScore: hubermanFitScore, isCoreEngine: isCoreEngine, referenceIdsJson: referenceIdsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$MethodologiesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $MethodologiesTable, Methodology, $$MethodologiesTableFilterComposer, $$MethodologiesTableOrderingComposer, $$MethodologiesTableAnnotationComposer, $$MethodologiesTableCreateCompanionBuilder, $$MethodologiesTableUpdateCompanionBuilder, ( Methodology, BaseReferences<_$AppDatabase, $MethodologiesTable, Methodology>, ), Methodology, PrefetchHooks Function() >; typedef $$FramePatternsTableCreateCompanionBuilder = FramePatternsCompanion Function({ required String id, Value domain, required String avoidanceKeyword, required String l0Example, Value l1SimpleReplace, required String l2Suggestion, Value l3Identity, Value rowid, }); typedef $$FramePatternsTableUpdateCompanionBuilder = FramePatternsCompanion Function({ Value id, Value domain, Value avoidanceKeyword, Value l0Example, Value l1SimpleReplace, Value l2Suggestion, Value l3Identity, Value rowid, }); class $$FramePatternsTableFilterComposer extends Composer<_$AppDatabase, $FramePatternsTable> { $$FramePatternsTableFilterComposer({ 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 domain => $composableBuilder( column: $table.domain, builder: (column) => ColumnFilters(column), ); ColumnFilters get avoidanceKeyword => $composableBuilder( column: $table.avoidanceKeyword, builder: (column) => ColumnFilters(column), ); ColumnFilters get l0Example => $composableBuilder( column: $table.l0Example, builder: (column) => ColumnFilters(column), ); ColumnFilters get l1SimpleReplace => $composableBuilder( column: $table.l1SimpleReplace, builder: (column) => ColumnFilters(column), ); ColumnFilters get l2Suggestion => $composableBuilder( column: $table.l2Suggestion, builder: (column) => ColumnFilters(column), ); ColumnFilters get l3Identity => $composableBuilder( column: $table.l3Identity, builder: (column) => ColumnFilters(column), ); } class $$FramePatternsTableOrderingComposer extends Composer<_$AppDatabase, $FramePatternsTable> { $$FramePatternsTableOrderingComposer({ 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 domain => $composableBuilder( column: $table.domain, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get avoidanceKeyword => $composableBuilder( column: $table.avoidanceKeyword, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get l0Example => $composableBuilder( column: $table.l0Example, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get l1SimpleReplace => $composableBuilder( column: $table.l1SimpleReplace, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get l2Suggestion => $composableBuilder( column: $table.l2Suggestion, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get l3Identity => $composableBuilder( column: $table.l3Identity, builder: (column) => ColumnOrderings(column), ); } class $$FramePatternsTableAnnotationComposer extends Composer<_$AppDatabase, $FramePatternsTable> { $$FramePatternsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get domain => $composableBuilder(column: $table.domain, builder: (column) => column); GeneratedColumn get avoidanceKeyword => $composableBuilder( column: $table.avoidanceKeyword, builder: (column) => column, ); GeneratedColumn get l0Example => $composableBuilder(column: $table.l0Example, builder: (column) => column); GeneratedColumn get l1SimpleReplace => $composableBuilder( column: $table.l1SimpleReplace, builder: (column) => column, ); GeneratedColumn get l2Suggestion => $composableBuilder( column: $table.l2Suggestion, builder: (column) => column, ); GeneratedColumn get l3Identity => $composableBuilder( column: $table.l3Identity, builder: (column) => column, ); } class $$FramePatternsTableTableManager extends RootTableManager< _$AppDatabase, $FramePatternsTable, FramePattern, $$FramePatternsTableFilterComposer, $$FramePatternsTableOrderingComposer, $$FramePatternsTableAnnotationComposer, $$FramePatternsTableCreateCompanionBuilder, $$FramePatternsTableUpdateCompanionBuilder, ( FramePattern, BaseReferences<_$AppDatabase, $FramePatternsTable, FramePattern>, ), FramePattern, PrefetchHooks Function() > { $$FramePatternsTableTableManager(_$AppDatabase db, $FramePatternsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$FramePatternsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$FramePatternsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$FramePatternsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value domain = const Value.absent(), Value avoidanceKeyword = const Value.absent(), Value l0Example = const Value.absent(), Value l1SimpleReplace = const Value.absent(), Value l2Suggestion = const Value.absent(), Value l3Identity = const Value.absent(), Value rowid = const Value.absent(), }) => FramePatternsCompanion( id: id, domain: domain, avoidanceKeyword: avoidanceKeyword, l0Example: l0Example, l1SimpleReplace: l1SimpleReplace, l2Suggestion: l2Suggestion, l3Identity: l3Identity, rowid: rowid, ), createCompanionCallback: ({ required String id, Value domain = const Value.absent(), required String avoidanceKeyword, required String l0Example, Value l1SimpleReplace = const Value.absent(), required String l2Suggestion, Value l3Identity = const Value.absent(), Value rowid = const Value.absent(), }) => FramePatternsCompanion.insert( id: id, domain: domain, avoidanceKeyword: avoidanceKeyword, l0Example: l0Example, l1SimpleReplace: l1SimpleReplace, l2Suggestion: l2Suggestion, l3Identity: l3Identity, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$FramePatternsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $FramePatternsTable, FramePattern, $$FramePatternsTableFilterComposer, $$FramePatternsTableOrderingComposer, $$FramePatternsTableAnnotationComposer, $$FramePatternsTableCreateCompanionBuilder, $$FramePatternsTableUpdateCompanionBuilder, ( FramePattern, BaseReferences<_$AppDatabase, $FramePatternsTable, FramePattern>, ), FramePattern, PrefetchHooks Function() >; typedef $$RewardMenuItemsTableCreateCompanionBuilder = RewardMenuItemsCompanion Function({ required String id, required String tierRecommended, required String title, Value description, Value estimatedCostKrwMin, Value estimatedCostKrwMax, Value isEffortTied, Value tagsJson, Value avoidForBreakHabitsJson, Value rowid, }); typedef $$RewardMenuItemsTableUpdateCompanionBuilder = RewardMenuItemsCompanion Function({ Value id, Value tierRecommended, Value title, Value description, Value estimatedCostKrwMin, Value estimatedCostKrwMax, Value isEffortTied, Value tagsJson, Value avoidForBreakHabitsJson, Value rowid, }); class $$RewardMenuItemsTableFilterComposer extends Composer<_$AppDatabase, $RewardMenuItemsTable> { $$RewardMenuItemsTableFilterComposer({ 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 tierRecommended => $composableBuilder( column: $table.tierRecommended, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get description => $composableBuilder( column: $table.description, builder: (column) => ColumnFilters(column), ); ColumnFilters get estimatedCostKrwMin => $composableBuilder( column: $table.estimatedCostKrwMin, builder: (column) => ColumnFilters(column), ); ColumnFilters get estimatedCostKrwMax => $composableBuilder( column: $table.estimatedCostKrwMax, builder: (column) => ColumnFilters(column), ); ColumnFilters get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => ColumnFilters(column), ); ColumnFilters get tagsJson => $composableBuilder( column: $table.tagsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get avoidForBreakHabitsJson => $composableBuilder( column: $table.avoidForBreakHabitsJson, builder: (column) => ColumnFilters(column), ); } class $$RewardMenuItemsTableOrderingComposer extends Composer<_$AppDatabase, $RewardMenuItemsTable> { $$RewardMenuItemsTableOrderingComposer({ 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 tierRecommended => $composableBuilder( column: $table.tierRecommended, 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 estimatedCostKrwMin => $composableBuilder( column: $table.estimatedCostKrwMin, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get estimatedCostKrwMax => $composableBuilder( column: $table.estimatedCostKrwMax, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get tagsJson => $composableBuilder( column: $table.tagsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get avoidForBreakHabitsJson => $composableBuilder( column: $table.avoidForBreakHabitsJson, builder: (column) => ColumnOrderings(column), ); } class $$RewardMenuItemsTableAnnotationComposer extends Composer<_$AppDatabase, $RewardMenuItemsTable> { $$RewardMenuItemsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get tierRecommended => $composableBuilder( column: $table.tierRecommended, builder: (column) => column, ); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get description => $composableBuilder( column: $table.description, builder: (column) => column, ); GeneratedColumn get estimatedCostKrwMin => $composableBuilder( column: $table.estimatedCostKrwMin, builder: (column) => column, ); GeneratedColumn get estimatedCostKrwMax => $composableBuilder( column: $table.estimatedCostKrwMax, builder: (column) => column, ); GeneratedColumn get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => column, ); GeneratedColumn get tagsJson => $composableBuilder(column: $table.tagsJson, builder: (column) => column); GeneratedColumn get avoidForBreakHabitsJson => $composableBuilder( column: $table.avoidForBreakHabitsJson, builder: (column) => column, ); } class $$RewardMenuItemsTableTableManager extends RootTableManager< _$AppDatabase, $RewardMenuItemsTable, RewardMenuItem, $$RewardMenuItemsTableFilterComposer, $$RewardMenuItemsTableOrderingComposer, $$RewardMenuItemsTableAnnotationComposer, $$RewardMenuItemsTableCreateCompanionBuilder, $$RewardMenuItemsTableUpdateCompanionBuilder, ( RewardMenuItem, BaseReferences< _$AppDatabase, $RewardMenuItemsTable, RewardMenuItem >, ), RewardMenuItem, PrefetchHooks Function() > { $$RewardMenuItemsTableTableManager( _$AppDatabase db, $RewardMenuItemsTable table, ) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$RewardMenuItemsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$RewardMenuItemsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$RewardMenuItemsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value tierRecommended = const Value.absent(), Value title = const Value.absent(), Value description = const Value.absent(), Value estimatedCostKrwMin = const Value.absent(), Value estimatedCostKrwMax = const Value.absent(), Value isEffortTied = const Value.absent(), Value tagsJson = const Value.absent(), Value avoidForBreakHabitsJson = const Value.absent(), Value rowid = const Value.absent(), }) => RewardMenuItemsCompanion( id: id, tierRecommended: tierRecommended, title: title, description: description, estimatedCostKrwMin: estimatedCostKrwMin, estimatedCostKrwMax: estimatedCostKrwMax, isEffortTied: isEffortTied, tagsJson: tagsJson, avoidForBreakHabitsJson: avoidForBreakHabitsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String tierRecommended, required String title, Value description = const Value.absent(), Value estimatedCostKrwMin = const Value.absent(), Value estimatedCostKrwMax = const Value.absent(), Value isEffortTied = const Value.absent(), Value tagsJson = const Value.absent(), Value avoidForBreakHabitsJson = const Value.absent(), Value rowid = const Value.absent(), }) => RewardMenuItemsCompanion.insert( id: id, tierRecommended: tierRecommended, title: title, description: description, estimatedCostKrwMin: estimatedCostKrwMin, estimatedCostKrwMax: estimatedCostKrwMax, isEffortTied: isEffortTied, tagsJson: tagsJson, avoidForBreakHabitsJson: avoidForBreakHabitsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$RewardMenuItemsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $RewardMenuItemsTable, RewardMenuItem, $$RewardMenuItemsTableFilterComposer, $$RewardMenuItemsTableOrderingComposer, $$RewardMenuItemsTableAnnotationComposer, $$RewardMenuItemsTableCreateCompanionBuilder, $$RewardMenuItemsTableUpdateCompanionBuilder, ( RewardMenuItem, BaseReferences<_$AppDatabase, $RewardMenuItemsTable, RewardMenuItem>, ), RewardMenuItem, PrefetchHooks Function() >; typedef $$ReferencesTableCreateCompanionBuilder = ReferencesCompanion Function({ required String id, required String kind, required String title, Value authorsJson, Value year, Value journal, Value doi, Value url, Value episodeNumber, Value publisher, Value evidenceStrength, Value verified, Value note, Value rowid, }); typedef $$ReferencesTableUpdateCompanionBuilder = ReferencesCompanion Function({ Value id, Value kind, Value title, Value authorsJson, Value year, Value journal, Value doi, Value url, Value episodeNumber, Value publisher, Value evidenceStrength, Value verified, Value note, Value rowid, }); class $$ReferencesTableFilterComposer extends Composer<_$AppDatabase, $ReferencesTable> { $$ReferencesTableFilterComposer({ 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 kind => $composableBuilder( column: $table.kind, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get authorsJson => $composableBuilder( column: $table.authorsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get year => $composableBuilder( column: $table.year, builder: (column) => ColumnFilters(column), ); ColumnFilters get journal => $composableBuilder( column: $table.journal, builder: (column) => ColumnFilters(column), ); ColumnFilters get doi => $composableBuilder( column: $table.doi, builder: (column) => ColumnFilters(column), ); ColumnFilters get url => $composableBuilder( column: $table.url, builder: (column) => ColumnFilters(column), ); ColumnFilters get episodeNumber => $composableBuilder( column: $table.episodeNumber, builder: (column) => ColumnFilters(column), ); ColumnFilters get publisher => $composableBuilder( column: $table.publisher, builder: (column) => ColumnFilters(column), ); ColumnFilters get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnFilters(column), ); ColumnFilters get verified => $composableBuilder( column: $table.verified, builder: (column) => ColumnFilters(column), ); ColumnFilters get note => $composableBuilder( column: $table.note, builder: (column) => ColumnFilters(column), ); } class $$ReferencesTableOrderingComposer extends Composer<_$AppDatabase, $ReferencesTable> { $$ReferencesTableOrderingComposer({ 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 kind => $composableBuilder( column: $table.kind, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get authorsJson => $composableBuilder( column: $table.authorsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get year => $composableBuilder( column: $table.year, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get journal => $composableBuilder( column: $table.journal, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get doi => $composableBuilder( column: $table.doi, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get url => $composableBuilder( column: $table.url, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get episodeNumber => $composableBuilder( column: $table.episodeNumber, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get publisher => $composableBuilder( column: $table.publisher, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get verified => $composableBuilder( column: $table.verified, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get note => $composableBuilder( column: $table.note, builder: (column) => ColumnOrderings(column), ); } class $$ReferencesTableAnnotationComposer extends Composer<_$AppDatabase, $ReferencesTable> { $$ReferencesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get kind => $composableBuilder(column: $table.kind, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get authorsJson => $composableBuilder( column: $table.authorsJson, builder: (column) => column, ); GeneratedColumn get year => $composableBuilder(column: $table.year, builder: (column) => column); GeneratedColumn get journal => $composableBuilder(column: $table.journal, builder: (column) => column); GeneratedColumn get doi => $composableBuilder(column: $table.doi, builder: (column) => column); GeneratedColumn get url => $composableBuilder(column: $table.url, builder: (column) => column); GeneratedColumn get episodeNumber => $composableBuilder( column: $table.episodeNumber, builder: (column) => column, ); GeneratedColumn get publisher => $composableBuilder(column: $table.publisher, builder: (column) => column); GeneratedColumn get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => column, ); GeneratedColumn get verified => $composableBuilder(column: $table.verified, builder: (column) => column); GeneratedColumn get note => $composableBuilder(column: $table.note, builder: (column) => column); } class $$ReferencesTableTableManager extends RootTableManager< _$AppDatabase, $ReferencesTable, ReferenceRow, $$ReferencesTableFilterComposer, $$ReferencesTableOrderingComposer, $$ReferencesTableAnnotationComposer, $$ReferencesTableCreateCompanionBuilder, $$ReferencesTableUpdateCompanionBuilder, ( ReferenceRow, BaseReferences<_$AppDatabase, $ReferencesTable, ReferenceRow>, ), ReferenceRow, PrefetchHooks Function() > { $$ReferencesTableTableManager(_$AppDatabase db, $ReferencesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$ReferencesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ReferencesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ReferencesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value kind = const Value.absent(), Value title = const Value.absent(), Value authorsJson = const Value.absent(), Value year = const Value.absent(), Value journal = const Value.absent(), Value doi = const Value.absent(), Value url = const Value.absent(), Value episodeNumber = const Value.absent(), Value publisher = const Value.absent(), Value evidenceStrength = const Value.absent(), Value verified = const Value.absent(), Value note = const Value.absent(), Value rowid = const Value.absent(), }) => ReferencesCompanion( id: id, kind: kind, title: title, authorsJson: authorsJson, year: year, journal: journal, doi: doi, url: url, episodeNumber: episodeNumber, publisher: publisher, evidenceStrength: evidenceStrength, verified: verified, note: note, rowid: rowid, ), createCompanionCallback: ({ required String id, required String kind, required String title, Value authorsJson = const Value.absent(), Value year = const Value.absent(), Value journal = const Value.absent(), Value doi = const Value.absent(), Value url = const Value.absent(), Value episodeNumber = const Value.absent(), Value publisher = const Value.absent(), Value evidenceStrength = const Value.absent(), Value verified = const Value.absent(), Value note = const Value.absent(), Value rowid = const Value.absent(), }) => ReferencesCompanion.insert( id: id, kind: kind, title: title, authorsJson: authorsJson, year: year, journal: journal, doi: doi, url: url, episodeNumber: episodeNumber, publisher: publisher, evidenceStrength: evidenceStrength, verified: verified, note: note, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$ReferencesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ReferencesTable, ReferenceRow, $$ReferencesTableFilterComposer, $$ReferencesTableOrderingComposer, $$ReferencesTableAnnotationComposer, $$ReferencesTableCreateCompanionBuilder, $$ReferencesTableUpdateCompanionBuilder, ( ReferenceRow, BaseReferences<_$AppDatabase, $ReferencesTable, ReferenceRow>, ), ReferenceRow, PrefetchHooks Function() >; typedef $$DietPatternsTableCreateCompanionBuilder = DietPatternsCompanion Function({ required String id, required String name, required String core, Value strengthsJson, Value weaknessesJson, required String evidenceStrength, Value koreanContextFit, Value starterLeversJson, Value medicalWarning, Value linkedProtocolIdsJson, Value referenceIdsJson, Value rowid, }); typedef $$DietPatternsTableUpdateCompanionBuilder = DietPatternsCompanion Function({ Value id, Value name, Value core, Value strengthsJson, Value weaknessesJson, Value evidenceStrength, Value koreanContextFit, Value starterLeversJson, Value medicalWarning, Value linkedProtocolIdsJson, Value referenceIdsJson, Value rowid, }); class $$DietPatternsTableFilterComposer extends Composer<_$AppDatabase, $DietPatternsTable> { $$DietPatternsTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column), ); ColumnFilters get core => $composableBuilder( column: $table.core, builder: (column) => ColumnFilters(column), ); ColumnFilters get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnFilters(column), ); ColumnFilters get koreanContextFit => $composableBuilder( column: $table.koreanContextFit, builder: (column) => ColumnFilters(column), ); ColumnFilters get starterLeversJson => $composableBuilder( column: $table.starterLeversJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => ColumnFilters(column), ); ColumnFilters get linkedProtocolIdsJson => $composableBuilder( column: $table.linkedProtocolIdsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnFilters(column), ); } class $$DietPatternsTableOrderingComposer extends Composer<_$AppDatabase, $DietPatternsTable> { $$DietPatternsTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get core => $composableBuilder( column: $table.core, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get koreanContextFit => $composableBuilder( column: $table.koreanContextFit, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get starterLeversJson => $composableBuilder( column: $table.starterLeversJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get linkedProtocolIdsJson => $composableBuilder( column: $table.linkedProtocolIdsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => ColumnOrderings(column), ); } class $$DietPatternsTableAnnotationComposer extends Composer<_$AppDatabase, $DietPatternsTable> { $$DietPatternsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get core => $composableBuilder(column: $table.core, builder: (column) => column); GeneratedColumn get strengthsJson => $composableBuilder( column: $table.strengthsJson, builder: (column) => column, ); GeneratedColumn get weaknessesJson => $composableBuilder( column: $table.weaknessesJson, builder: (column) => column, ); GeneratedColumn get evidenceStrength => $composableBuilder( column: $table.evidenceStrength, builder: (column) => column, ); GeneratedColumn get koreanContextFit => $composableBuilder( column: $table.koreanContextFit, builder: (column) => column, ); GeneratedColumn get starterLeversJson => $composableBuilder( column: $table.starterLeversJson, builder: (column) => column, ); GeneratedColumn get medicalWarning => $composableBuilder( column: $table.medicalWarning, builder: (column) => column, ); GeneratedColumn get linkedProtocolIdsJson => $composableBuilder( column: $table.linkedProtocolIdsJson, builder: (column) => column, ); GeneratedColumn get referenceIdsJson => $composableBuilder( column: $table.referenceIdsJson, builder: (column) => column, ); } class $$DietPatternsTableTableManager extends RootTableManager< _$AppDatabase, $DietPatternsTable, DietPattern, $$DietPatternsTableFilterComposer, $$DietPatternsTableOrderingComposer, $$DietPatternsTableAnnotationComposer, $$DietPatternsTableCreateCompanionBuilder, $$DietPatternsTableUpdateCompanionBuilder, ( DietPattern, BaseReferences<_$AppDatabase, $DietPatternsTable, DietPattern>, ), DietPattern, PrefetchHooks Function() > { $$DietPatternsTableTableManager(_$AppDatabase db, $DietPatternsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$DietPatternsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$DietPatternsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$DietPatternsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value core = const Value.absent(), Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), Value evidenceStrength = const Value.absent(), Value koreanContextFit = const Value.absent(), Value starterLeversJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value linkedProtocolIdsJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => DietPatternsCompanion( id: id, name: name, core: core, strengthsJson: strengthsJson, weaknessesJson: weaknessesJson, evidenceStrength: evidenceStrength, koreanContextFit: koreanContextFit, starterLeversJson: starterLeversJson, medicalWarning: medicalWarning, linkedProtocolIdsJson: linkedProtocolIdsJson, referenceIdsJson: referenceIdsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String name, required String core, Value strengthsJson = const Value.absent(), Value weaknessesJson = const Value.absent(), required String evidenceStrength, Value koreanContextFit = const Value.absent(), Value starterLeversJson = const Value.absent(), Value medicalWarning = const Value.absent(), Value linkedProtocolIdsJson = const Value.absent(), Value referenceIdsJson = const Value.absent(), Value rowid = const Value.absent(), }) => DietPatternsCompanion.insert( id: id, name: name, core: core, strengthsJson: strengthsJson, weaknessesJson: weaknessesJson, evidenceStrength: evidenceStrength, koreanContextFit: koreanContextFit, starterLeversJson: starterLeversJson, medicalWarning: medicalWarning, linkedProtocolIdsJson: linkedProtocolIdsJson, referenceIdsJson: referenceIdsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$DietPatternsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $DietPatternsTable, DietPattern, $$DietPatternsTableFilterComposer, $$DietPatternsTableOrderingComposer, $$DietPatternsTableAnnotationComposer, $$DietPatternsTableCreateCompanionBuilder, $$DietPatternsTableUpdateCompanionBuilder, ( DietPattern, BaseReferences<_$AppDatabase, $DietPatternsTable, DietPattern>, ), DietPattern, PrefetchHooks Function() >; typedef $$UsersTableCreateCompanionBuilder = UsersCompanion Function({ required String id, Value displayName, Value locale, Value timezone, required String createdAt, Value preferencesJson, Value rowid, }); typedef $$UsersTableUpdateCompanionBuilder = UsersCompanion Function({ Value id, Value displayName, Value locale, Value timezone, Value createdAt, Value preferencesJson, Value rowid, }); final class $$UsersTableReferences extends BaseReferences<_$AppDatabase, $UsersTable, User> { $$UsersTableReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$PhasesTable, List> _phasesRefsTable( _$AppDatabase db, ) => MultiTypedResultKey.fromTable( db.phases, aliasName: $_aliasNameGenerator(db.users.id, db.phases.userId), ); $$PhasesTableProcessedTableManager get phasesRefs { final manager = $$PhasesTableTableManager( $_db, $_db.phases, ).filter((f) => f.userId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_phasesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$HabitsTable, List> _habitsRefsTable( _$AppDatabase db, ) => MultiTypedResultKey.fromTable( db.habits, aliasName: $_aliasNameGenerator(db.users.id, db.habits.userId), ); $$HabitsTableProcessedTableManager get habitsRefs { final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.userId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_habitsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$ReflectionsTable, List> _reflectionsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.reflections, aliasName: $_aliasNameGenerator(db.users.id, db.reflections.userId), ); $$ReflectionsTableProcessedTableManager get reflectionsRefs { final manager = $$ReflectionsTableTableManager( $_db, $_db.reflections, ).filter((f) => f.userId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_reflectionsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$UsersTableFilterComposer extends Composer<_$AppDatabase, $UsersTable> { $$UsersTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnFilters(column), ); ColumnFilters get locale => $composableBuilder( column: $table.locale, builder: (column) => ColumnFilters(column), ); ColumnFilters get timezone => $composableBuilder( column: $table.timezone, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get preferencesJson => $composableBuilder( column: $table.preferencesJson, builder: (column) => ColumnFilters(column), ); Expression phasesRefs( Expression Function($$PhasesTableFilterComposer f) f, ) { final $$PhasesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.phases, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableFilterComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression habitsRefs( Expression Function($$HabitsTableFilterComposer f) f, ) { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habits, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression reflectionsRefs( Expression Function($$ReflectionsTableFilterComposer f) f, ) { final $$ReflectionsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.reflections, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$ReflectionsTableFilterComposer( $db: $db, $table: $db.reflections, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$UsersTableOrderingComposer extends Composer<_$AppDatabase, $UsersTable> { $$UsersTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get locale => $composableBuilder( column: $table.locale, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get timezone => $composableBuilder( column: $table.timezone, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get preferencesJson => $composableBuilder( column: $table.preferencesJson, builder: (column) => ColumnOrderings(column), ); } class $$UsersTableAnnotationComposer extends Composer<_$AppDatabase, $UsersTable> { $$UsersTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get displayName => $composableBuilder( column: $table.displayName, builder: (column) => column, ); GeneratedColumn get locale => $composableBuilder(column: $table.locale, builder: (column) => column); GeneratedColumn get timezone => $composableBuilder(column: $table.timezone, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); GeneratedColumn get preferencesJson => $composableBuilder( column: $table.preferencesJson, builder: (column) => column, ); Expression phasesRefs( Expression Function($$PhasesTableAnnotationComposer a) f, ) { final $$PhasesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.phases, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableAnnotationComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression habitsRefs( Expression Function($$HabitsTableAnnotationComposer a) f, ) { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habits, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression reflectionsRefs( Expression Function($$ReflectionsTableAnnotationComposer a) f, ) { final $$ReflectionsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.reflections, getReferencedColumn: (t) => t.userId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$ReflectionsTableAnnotationComposer( $db: $db, $table: $db.reflections, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$UsersTableTableManager extends RootTableManager< _$AppDatabase, $UsersTable, User, $$UsersTableFilterComposer, $$UsersTableOrderingComposer, $$UsersTableAnnotationComposer, $$UsersTableCreateCompanionBuilder, $$UsersTableUpdateCompanionBuilder, (User, $$UsersTableReferences), User, PrefetchHooks Function({ bool phasesRefs, bool habitsRefs, bool reflectionsRefs, }) > { $$UsersTableTableManager(_$AppDatabase db, $UsersTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$UsersTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$UsersTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$UsersTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value displayName = const Value.absent(), Value locale = const Value.absent(), Value timezone = const Value.absent(), Value createdAt = const Value.absent(), Value preferencesJson = const Value.absent(), Value rowid = const Value.absent(), }) => UsersCompanion( id: id, displayName: displayName, locale: locale, timezone: timezone, createdAt: createdAt, preferencesJson: preferencesJson, rowid: rowid, ), createCompanionCallback: ({ required String id, Value displayName = const Value.absent(), Value locale = const Value.absent(), Value timezone = const Value.absent(), required String createdAt, Value preferencesJson = const Value.absent(), Value rowid = const Value.absent(), }) => UsersCompanion.insert( id: id, displayName: displayName, locale: locale, timezone: timezone, createdAt: createdAt, preferencesJson: preferencesJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => (e.readTable(table), $$UsersTableReferences(db, table, e)), ) .toList(), prefetchHooksCallback: ({ phasesRefs = false, habitsRefs = false, reflectionsRefs = false, }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (phasesRefs) db.phases, if (habitsRefs) db.habits, if (reflectionsRefs) db.reflections, ], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (phasesRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$UsersTableReferences ._phasesRefsTable(db), managerFromTypedResult: (p0) => $$UsersTableReferences(db, table, p0).phasesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.userId == item.id, ), typedResults: items, ), if (habitsRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$UsersTableReferences ._habitsRefsTable(db), managerFromTypedResult: (p0) => $$UsersTableReferences(db, table, p0).habitsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.userId == item.id, ), typedResults: items, ), if (reflectionsRefs) await $_getPrefetchedData< User, $UsersTable, Reflection >( currentTable: table, referencedTable: $$UsersTableReferences ._reflectionsRefsTable(db), managerFromTypedResult: (p0) => $$UsersTableReferences( db, table, p0, ).reflectionsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.userId == item.id, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$UsersTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $UsersTable, User, $$UsersTableFilterComposer, $$UsersTableOrderingComposer, $$UsersTableAnnotationComposer, $$UsersTableCreateCompanionBuilder, $$UsersTableUpdateCompanionBuilder, (User, $$UsersTableReferences), User, PrefetchHooks Function({ bool phasesRefs, bool habitsRefs, bool reflectionsRefs, }) >; typedef $$PhasesTableCreateCompanionBuilder = PhasesCompanion Function({ required String id, required String userId, Value title, required String startedAt, Value endedAt, Value durationWeeks, required String status, Value intentionText, Value rewardDeclarationsLocked, Value rowid, }); typedef $$PhasesTableUpdateCompanionBuilder = PhasesCompanion Function({ Value id, Value userId, Value title, Value startedAt, Value endedAt, Value durationWeeks, Value status, Value intentionText, Value rewardDeclarationsLocked, Value rowid, }); final class $$PhasesTableReferences extends BaseReferences<_$AppDatabase, $PhasesTable, Phase> { $$PhasesTableReferences(super.$_db, super.$_table, super.$_typedResult); static $UsersTable _userIdTable(_$AppDatabase db) => db.users.createAlias($_aliasNameGenerator(db.phases.userId, db.users.id)); $$UsersTableProcessedTableManager get userId { final $_column = $_itemColumn('user_id')!; final manager = $$UsersTableTableManager( $_db, $_db.users, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_userIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static MultiTypedResultKey<$HabitsTable, List> _habitsRefsTable( _$AppDatabase db, ) => MultiTypedResultKey.fromTable( db.habits, aliasName: $_aliasNameGenerator(db.phases.id, db.habits.phaseId), ); $$HabitsTableProcessedTableManager get habitsRefs { final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.phaseId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_habitsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$RewardDeclarationsTable, List> _rewardDeclarationsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.rewardDeclarations, aliasName: $_aliasNameGenerator( db.phases.id, db.rewardDeclarations.phaseId, ), ); $$RewardDeclarationsTableProcessedTableManager get rewardDeclarationsRefs { final manager = $$RewardDeclarationsTableTableManager( $_db, $_db.rewardDeclarations, ).filter((f) => f.phaseId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull( _rewardDeclarationsRefsTable($_db), ); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$ReflectionsTable, List> _reflectionsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.reflections, aliasName: $_aliasNameGenerator(db.phases.id, db.reflections.phaseId), ); $$ReflectionsTableProcessedTableManager get reflectionsRefs { final manager = $$ReflectionsTableTableManager( $_db, $_db.reflections, ).filter((f) => f.phaseId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_reflectionsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$PhasesTableFilterComposer extends Composer<_$AppDatabase, $PhasesTable> { $$PhasesTableFilterComposer({ 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 title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get startedAt => $composableBuilder( column: $table.startedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get endedAt => $composableBuilder( column: $table.endedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get durationWeeks => $composableBuilder( column: $table.durationWeeks, builder: (column) => ColumnFilters(column), ); ColumnFilters get status => $composableBuilder( column: $table.status, builder: (column) => ColumnFilters(column), ); ColumnFilters get intentionText => $composableBuilder( column: $table.intentionText, builder: (column) => ColumnFilters(column), ); ColumnFilters get rewardDeclarationsLocked => $composableBuilder( column: $table.rewardDeclarationsLocked, builder: (column) => ColumnFilters(column), ); $$UsersTableFilterComposer get userId { final $$UsersTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableFilterComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression habitsRefs( Expression Function($$HabitsTableFilterComposer f) f, ) { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habits, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression rewardDeclarationsRefs( Expression Function($$RewardDeclarationsTableFilterComposer f) f, ) { final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableFilterComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression reflectionsRefs( Expression Function($$ReflectionsTableFilterComposer f) f, ) { final $$ReflectionsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.reflections, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$ReflectionsTableFilterComposer( $db: $db, $table: $db.reflections, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$PhasesTableOrderingComposer extends Composer<_$AppDatabase, $PhasesTable> { $$PhasesTableOrderingComposer({ 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 title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get startedAt => $composableBuilder( column: $table.startedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get endedAt => $composableBuilder( column: $table.endedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get durationWeeks => $composableBuilder( column: $table.durationWeeks, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get status => $composableBuilder( column: $table.status, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get intentionText => $composableBuilder( column: $table.intentionText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get rewardDeclarationsLocked => $composableBuilder( column: $table.rewardDeclarationsLocked, builder: (column) => ColumnOrderings(column), ); $$UsersTableOrderingComposer get userId { final $$UsersTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableOrderingComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$PhasesTableAnnotationComposer extends Composer<_$AppDatabase, $PhasesTable> { $$PhasesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get startedAt => $composableBuilder(column: $table.startedAt, builder: (column) => column); GeneratedColumn get endedAt => $composableBuilder(column: $table.endedAt, builder: (column) => column); GeneratedColumn get durationWeeks => $composableBuilder( column: $table.durationWeeks, builder: (column) => column, ); GeneratedColumn get status => $composableBuilder(column: $table.status, builder: (column) => column); GeneratedColumn get intentionText => $composableBuilder( column: $table.intentionText, builder: (column) => column, ); GeneratedColumn get rewardDeclarationsLocked => $composableBuilder( column: $table.rewardDeclarationsLocked, builder: (column) => column, ); $$UsersTableAnnotationComposer get userId { final $$UsersTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableAnnotationComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression habitsRefs( Expression Function($$HabitsTableAnnotationComposer a) f, ) { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habits, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression rewardDeclarationsRefs( Expression Function($$RewardDeclarationsTableAnnotationComposer a) f, ) { final $$RewardDeclarationsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableAnnotationComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression reflectionsRefs( Expression Function($$ReflectionsTableAnnotationComposer a) f, ) { final $$ReflectionsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.reflections, getReferencedColumn: (t) => t.phaseId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$ReflectionsTableAnnotationComposer( $db: $db, $table: $db.reflections, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$PhasesTableTableManager extends RootTableManager< _$AppDatabase, $PhasesTable, Phase, $$PhasesTableFilterComposer, $$PhasesTableOrderingComposer, $$PhasesTableAnnotationComposer, $$PhasesTableCreateCompanionBuilder, $$PhasesTableUpdateCompanionBuilder, (Phase, $$PhasesTableReferences), Phase, PrefetchHooks Function({ bool userId, bool habitsRefs, bool rewardDeclarationsRefs, bool reflectionsRefs, }) > { $$PhasesTableTableManager(_$AppDatabase db, $PhasesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$PhasesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$PhasesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$PhasesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value userId = const Value.absent(), Value title = const Value.absent(), Value startedAt = const Value.absent(), Value endedAt = const Value.absent(), Value durationWeeks = const Value.absent(), Value status = const Value.absent(), Value intentionText = const Value.absent(), Value rewardDeclarationsLocked = const Value.absent(), Value rowid = const Value.absent(), }) => PhasesCompanion( id: id, userId: userId, title: title, startedAt: startedAt, endedAt: endedAt, durationWeeks: durationWeeks, status: status, intentionText: intentionText, rewardDeclarationsLocked: rewardDeclarationsLocked, rowid: rowid, ), createCompanionCallback: ({ required String id, required String userId, Value title = const Value.absent(), required String startedAt, Value endedAt = const Value.absent(), Value durationWeeks = const Value.absent(), required String status, Value intentionText = const Value.absent(), Value rewardDeclarationsLocked = const Value.absent(), Value rowid = const Value.absent(), }) => PhasesCompanion.insert( id: id, userId: userId, title: title, startedAt: startedAt, endedAt: endedAt, durationWeeks: durationWeeks, status: status, intentionText: intentionText, rewardDeclarationsLocked: rewardDeclarationsLocked, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => (e.readTable(table), $$PhasesTableReferences(db, table, e)), ) .toList(), prefetchHooksCallback: ({ userId = false, habitsRefs = false, rewardDeclarationsRefs = false, reflectionsRefs = false, }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (habitsRefs) db.habits, if (rewardDeclarationsRefs) db.rewardDeclarations, if (reflectionsRefs) db.reflections, ], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (userId) { state = state.withJoin( currentTable: table, currentColumn: table.userId, referencedTable: $$PhasesTableReferences ._userIdTable(db), referencedColumn: $$PhasesTableReferences ._userIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return [ if (habitsRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$PhasesTableReferences ._habitsRefsTable(db), managerFromTypedResult: (p0) => $$PhasesTableReferences(db, table, p0).habitsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.phaseId == item.id, ), typedResults: items, ), if (rewardDeclarationsRefs) await $_getPrefetchedData< Phase, $PhasesTable, RewardDeclaration >( currentTable: table, referencedTable: $$PhasesTableReferences ._rewardDeclarationsRefsTable(db), managerFromTypedResult: (p0) => $$PhasesTableReferences( db, table, p0, ).rewardDeclarationsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.phaseId == item.id, ), typedResults: items, ), if (reflectionsRefs) await $_getPrefetchedData< Phase, $PhasesTable, Reflection >( currentTable: table, referencedTable: $$PhasesTableReferences ._reflectionsRefsTable(db), managerFromTypedResult: (p0) => $$PhasesTableReferences( db, table, p0, ).reflectionsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.phaseId == item.id, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$PhasesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $PhasesTable, Phase, $$PhasesTableFilterComposer, $$PhasesTableOrderingComposer, $$PhasesTableAnnotationComposer, $$PhasesTableCreateCompanionBuilder, $$PhasesTableUpdateCompanionBuilder, (Phase, $$PhasesTableReferences), Phase, PrefetchHooks Function({ bool userId, bool habitsRefs, bool rewardDeclarationsRefs, bool reflectionsRefs, }) >; typedef $$HabitsTableCreateCompanionBuilder = HabitsCompanion Function({ required String id, required String userId, Value phaseId, required String type, required String status, required String title, Value protocolId, Value breakProtocolId, Value commonFrameIdsJson, required String frameLevel, Value frameOriginalText, required String frameFramedText, Value anchorWhen, Value anchorAfterWhat, Value anchorWhere, Value stackPosition, Value minDose, Value targetDose, required String startedAt, Value endedAt, Value tagsJson, Value rowid, }); typedef $$HabitsTableUpdateCompanionBuilder = HabitsCompanion Function({ Value id, Value userId, Value phaseId, Value type, Value status, Value title, Value protocolId, Value breakProtocolId, Value commonFrameIdsJson, Value frameLevel, Value frameOriginalText, Value frameFramedText, Value anchorWhen, Value anchorAfterWhat, Value anchorWhere, Value stackPosition, Value minDose, Value targetDose, Value startedAt, Value endedAt, Value tagsJson, Value rowid, }); final class $$HabitsTableReferences extends BaseReferences<_$AppDatabase, $HabitsTable, Habit> { $$HabitsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $UsersTable _userIdTable(_$AppDatabase db) => db.users.createAlias($_aliasNameGenerator(db.habits.userId, db.users.id)); $$UsersTableProcessedTableManager get userId { final $_column = $_itemColumn('user_id')!; final manager = $$UsersTableTableManager( $_db, $_db.users, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_userIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias( $_aliasNameGenerator(db.habits.phaseId, db.phases.id), ); $$PhasesTableProcessedTableManager? get phaseId { final $_column = $_itemColumn('phase_id'); if ($_column == null) return null; final manager = $$PhasesTableTableManager( $_db, $_db.phases, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_phaseIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static MultiTypedResultKey<$HabitDoseVariantsTable, List> _habitDoseVariantsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.habitDoseVariants, aliasName: $_aliasNameGenerator( db.habits.id, db.habitDoseVariants.habitId, ), ); $$HabitDoseVariantsTableProcessedTableManager get habitDoseVariantsRefs { final manager = $$HabitDoseVariantsTableTableManager( $_db, $_db.habitDoseVariants, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull( _habitDoseVariantsRefsTable($_db), ); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$IfThenRulesTable, List> _ifThenRulesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.ifThenRules, aliasName: $_aliasNameGenerator(db.habits.id, db.ifThenRules.habitId), ); $$IfThenRulesTableProcessedTableManager get ifThenRulesRefs { final manager = $$IfThenRulesTableTableManager( $_db, $_db.ifThenRules, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_ifThenRulesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$TrackerEntriesTable, List> _trackerEntriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.trackerEntries, aliasName: $_aliasNameGenerator(db.habits.id, db.trackerEntries.habitId), ); $$TrackerEntriesTableProcessedTableManager get trackerEntriesRefs { final manager = $$TrackerEntriesTableTableManager( $_db, $_db.trackerEntries, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_trackerEntriesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$LapseLogsTable, List> _lapseLogsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.lapseLogs, aliasName: $_aliasNameGenerator(db.habits.id, db.lapseLogs.habitId), ); $$LapseLogsTableProcessedTableManager get lapseLogsRefs { final manager = $$LapseLogsTableTableManager( $_db, $_db.lapseLogs, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_lapseLogsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$UrgeLogsTable, List> _urgeLogsRefsTable( _$AppDatabase db, ) => MultiTypedResultKey.fromTable( db.urgeLogs, aliasName: $_aliasNameGenerator(db.habits.id, db.urgeLogs.habitId), ); $$UrgeLogsTableProcessedTableManager get urgeLogsRefs { final manager = $$UrgeLogsTableTableManager( $_db, $_db.urgeLogs, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_urgeLogsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } static MultiTypedResultKey<$RewardDeclarationsTable, List> _rewardDeclarationsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.rewardDeclarations, aliasName: $_aliasNameGenerator( db.habits.id, db.rewardDeclarations.habitId, ), ); $$RewardDeclarationsTableProcessedTableManager get rewardDeclarationsRefs { final manager = $$RewardDeclarationsTableTableManager( $_db, $_db.rewardDeclarations, ).filter((f) => f.habitId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull( _rewardDeclarationsRefsTable($_db), ); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$HabitsTableFilterComposer extends Composer<_$AppDatabase, $HabitsTable> { $$HabitsTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get type => $composableBuilder( column: $table.type, builder: (column) => ColumnFilters(column), ); ColumnFilters get status => $composableBuilder( column: $table.status, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get protocolId => $composableBuilder( column: $table.protocolId, builder: (column) => ColumnFilters(column), ); ColumnFilters get breakProtocolId => $composableBuilder( column: $table.breakProtocolId, builder: (column) => ColumnFilters(column), ); ColumnFilters get commonFrameIdsJson => $composableBuilder( column: $table.commonFrameIdsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get frameLevel => $composableBuilder( column: $table.frameLevel, builder: (column) => ColumnFilters(column), ); ColumnFilters get frameOriginalText => $composableBuilder( column: $table.frameOriginalText, builder: (column) => ColumnFilters(column), ); ColumnFilters get frameFramedText => $composableBuilder( column: $table.frameFramedText, builder: (column) => ColumnFilters(column), ); ColumnFilters get anchorWhen => $composableBuilder( column: $table.anchorWhen, builder: (column) => ColumnFilters(column), ); ColumnFilters get anchorAfterWhat => $composableBuilder( column: $table.anchorAfterWhat, builder: (column) => ColumnFilters(column), ); ColumnFilters get anchorWhere => $composableBuilder( column: $table.anchorWhere, builder: (column) => ColumnFilters(column), ); ColumnFilters get stackPosition => $composableBuilder( column: $table.stackPosition, builder: (column) => ColumnFilters(column), ); ColumnFilters get minDose => $composableBuilder( column: $table.minDose, builder: (column) => ColumnFilters(column), ); ColumnFilters get targetDose => $composableBuilder( column: $table.targetDose, builder: (column) => ColumnFilters(column), ); ColumnFilters get startedAt => $composableBuilder( column: $table.startedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get endedAt => $composableBuilder( column: $table.endedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get tagsJson => $composableBuilder( column: $table.tagsJson, builder: (column) => ColumnFilters(column), ); $$UsersTableFilterComposer get userId { final $$UsersTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableFilterComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableFilterComposer get phaseId { final $$PhasesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableFilterComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression habitDoseVariantsRefs( Expression Function($$HabitDoseVariantsTableFilterComposer f) f, ) { final $$HabitDoseVariantsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habitDoseVariants, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitDoseVariantsTableFilterComposer( $db: $db, $table: $db.habitDoseVariants, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression ifThenRulesRefs( Expression Function($$IfThenRulesTableFilterComposer f) f, ) { final $$IfThenRulesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.ifThenRules, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$IfThenRulesTableFilterComposer( $db: $db, $table: $db.ifThenRules, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression trackerEntriesRefs( Expression Function($$TrackerEntriesTableFilterComposer f) f, ) { final $$TrackerEntriesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.trackerEntries, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$TrackerEntriesTableFilterComposer( $db: $db, $table: $db.trackerEntries, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression lapseLogsRefs( Expression Function($$LapseLogsTableFilterComposer f) f, ) { final $$LapseLogsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.lapseLogs, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$LapseLogsTableFilterComposer( $db: $db, $table: $db.lapseLogs, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression urgeLogsRefs( Expression Function($$UrgeLogsTableFilterComposer f) f, ) { final $$UrgeLogsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.urgeLogs, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UrgeLogsTableFilterComposer( $db: $db, $table: $db.urgeLogs, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression rewardDeclarationsRefs( Expression Function($$RewardDeclarationsTableFilterComposer f) f, ) { final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableFilterComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$HabitsTableOrderingComposer extends Composer<_$AppDatabase, $HabitsTable> { $$HabitsTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get type => $composableBuilder( column: $table.type, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get status => $composableBuilder( column: $table.status, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get protocolId => $composableBuilder( column: $table.protocolId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get breakProtocolId => $composableBuilder( column: $table.breakProtocolId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get commonFrameIdsJson => $composableBuilder( column: $table.commonFrameIdsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get frameLevel => $composableBuilder( column: $table.frameLevel, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get frameOriginalText => $composableBuilder( column: $table.frameOriginalText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get frameFramedText => $composableBuilder( column: $table.frameFramedText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get anchorWhen => $composableBuilder( column: $table.anchorWhen, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get anchorAfterWhat => $composableBuilder( column: $table.anchorAfterWhat, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get anchorWhere => $composableBuilder( column: $table.anchorWhere, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get stackPosition => $composableBuilder( column: $table.stackPosition, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get minDose => $composableBuilder( column: $table.minDose, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get targetDose => $composableBuilder( column: $table.targetDose, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get startedAt => $composableBuilder( column: $table.startedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get endedAt => $composableBuilder( column: $table.endedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get tagsJson => $composableBuilder( column: $table.tagsJson, builder: (column) => ColumnOrderings(column), ); $$UsersTableOrderingComposer get userId { final $$UsersTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableOrderingComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableOrderingComposer get phaseId { final $$PhasesTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableOrderingComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$HabitsTableAnnotationComposer extends Composer<_$AppDatabase, $HabitsTable> { $$HabitsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get type => $composableBuilder(column: $table.type, builder: (column) => column); GeneratedColumn get status => $composableBuilder(column: $table.status, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get protocolId => $composableBuilder( column: $table.protocolId, builder: (column) => column, ); GeneratedColumn get breakProtocolId => $composableBuilder( column: $table.breakProtocolId, builder: (column) => column, ); GeneratedColumn get commonFrameIdsJson => $composableBuilder( column: $table.commonFrameIdsJson, builder: (column) => column, ); GeneratedColumn get frameLevel => $composableBuilder( column: $table.frameLevel, builder: (column) => column, ); GeneratedColumn get frameOriginalText => $composableBuilder( column: $table.frameOriginalText, builder: (column) => column, ); GeneratedColumn get frameFramedText => $composableBuilder( column: $table.frameFramedText, builder: (column) => column, ); GeneratedColumn get anchorWhen => $composableBuilder( column: $table.anchorWhen, builder: (column) => column, ); GeneratedColumn get anchorAfterWhat => $composableBuilder( column: $table.anchorAfterWhat, builder: (column) => column, ); GeneratedColumn get anchorWhere => $composableBuilder( column: $table.anchorWhere, builder: (column) => column, ); GeneratedColumn get stackPosition => $composableBuilder( column: $table.stackPosition, builder: (column) => column, ); GeneratedColumn get minDose => $composableBuilder(column: $table.minDose, builder: (column) => column); GeneratedColumn get targetDose => $composableBuilder( column: $table.targetDose, builder: (column) => column, ); GeneratedColumn get startedAt => $composableBuilder(column: $table.startedAt, builder: (column) => column); GeneratedColumn get endedAt => $composableBuilder(column: $table.endedAt, builder: (column) => column); GeneratedColumn get tagsJson => $composableBuilder(column: $table.tagsJson, builder: (column) => column); $$UsersTableAnnotationComposer get userId { final $$UsersTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableAnnotationComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableAnnotationComposer get phaseId { final $$PhasesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableAnnotationComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression habitDoseVariantsRefs( Expression Function($$HabitDoseVariantsTableAnnotationComposer a) f, ) { final $$HabitDoseVariantsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.habitDoseVariants, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitDoseVariantsTableAnnotationComposer( $db: $db, $table: $db.habitDoseVariants, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression ifThenRulesRefs( Expression Function($$IfThenRulesTableAnnotationComposer a) f, ) { final $$IfThenRulesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.ifThenRules, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$IfThenRulesTableAnnotationComposer( $db: $db, $table: $db.ifThenRules, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression trackerEntriesRefs( Expression Function($$TrackerEntriesTableAnnotationComposer a) f, ) { final $$TrackerEntriesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.trackerEntries, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$TrackerEntriesTableAnnotationComposer( $db: $db, $table: $db.trackerEntries, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression lapseLogsRefs( Expression Function($$LapseLogsTableAnnotationComposer a) f, ) { final $$LapseLogsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.lapseLogs, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$LapseLogsTableAnnotationComposer( $db: $db, $table: $db.lapseLogs, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression urgeLogsRefs( Expression Function($$UrgeLogsTableAnnotationComposer a) f, ) { final $$UrgeLogsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.urgeLogs, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UrgeLogsTableAnnotationComposer( $db: $db, $table: $db.urgeLogs, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } Expression rewardDeclarationsRefs( Expression Function($$RewardDeclarationsTableAnnotationComposer a) f, ) { final $$RewardDeclarationsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.habitId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableAnnotationComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$HabitsTableTableManager extends RootTableManager< _$AppDatabase, $HabitsTable, Habit, $$HabitsTableFilterComposer, $$HabitsTableOrderingComposer, $$HabitsTableAnnotationComposer, $$HabitsTableCreateCompanionBuilder, $$HabitsTableUpdateCompanionBuilder, (Habit, $$HabitsTableReferences), Habit, PrefetchHooks Function({ bool userId, bool phaseId, bool habitDoseVariantsRefs, bool ifThenRulesRefs, bool trackerEntriesRefs, bool lapseLogsRefs, bool urgeLogsRefs, bool rewardDeclarationsRefs, }) > { $$HabitsTableTableManager(_$AppDatabase db, $HabitsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$HabitsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$HabitsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$HabitsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value userId = const Value.absent(), Value phaseId = const Value.absent(), Value type = const Value.absent(), Value status = const Value.absent(), Value title = const Value.absent(), Value protocolId = const Value.absent(), Value breakProtocolId = const Value.absent(), Value commonFrameIdsJson = const Value.absent(), Value frameLevel = const Value.absent(), Value frameOriginalText = const Value.absent(), Value frameFramedText = const Value.absent(), Value anchorWhen = const Value.absent(), Value anchorAfterWhat = const Value.absent(), Value anchorWhere = const Value.absent(), Value stackPosition = const Value.absent(), Value minDose = const Value.absent(), Value targetDose = const Value.absent(), Value startedAt = const Value.absent(), Value endedAt = const Value.absent(), Value tagsJson = const Value.absent(), Value rowid = const Value.absent(), }) => HabitsCompanion( id: id, userId: userId, phaseId: phaseId, type: type, status: status, title: title, protocolId: protocolId, breakProtocolId: breakProtocolId, commonFrameIdsJson: commonFrameIdsJson, frameLevel: frameLevel, frameOriginalText: frameOriginalText, frameFramedText: frameFramedText, anchorWhen: anchorWhen, anchorAfterWhat: anchorAfterWhat, anchorWhere: anchorWhere, stackPosition: stackPosition, minDose: minDose, targetDose: targetDose, startedAt: startedAt, endedAt: endedAt, tagsJson: tagsJson, rowid: rowid, ), createCompanionCallback: ({ required String id, required String userId, Value phaseId = const Value.absent(), required String type, required String status, required String title, Value protocolId = const Value.absent(), Value breakProtocolId = const Value.absent(), Value commonFrameIdsJson = const Value.absent(), required String frameLevel, Value frameOriginalText = const Value.absent(), required String frameFramedText, Value anchorWhen = const Value.absent(), Value anchorAfterWhat = const Value.absent(), Value anchorWhere = const Value.absent(), Value stackPosition = const Value.absent(), Value minDose = const Value.absent(), Value targetDose = const Value.absent(), required String startedAt, Value endedAt = const Value.absent(), Value tagsJson = const Value.absent(), Value rowid = const Value.absent(), }) => HabitsCompanion.insert( id: id, userId: userId, phaseId: phaseId, type: type, status: status, title: title, protocolId: protocolId, breakProtocolId: breakProtocolId, commonFrameIdsJson: commonFrameIdsJson, frameLevel: frameLevel, frameOriginalText: frameOriginalText, frameFramedText: frameFramedText, anchorWhen: anchorWhen, anchorAfterWhat: anchorAfterWhat, anchorWhere: anchorWhere, stackPosition: stackPosition, minDose: minDose, targetDose: targetDose, startedAt: startedAt, endedAt: endedAt, tagsJson: tagsJson, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => (e.readTable(table), $$HabitsTableReferences(db, table, e)), ) .toList(), prefetchHooksCallback: ({ userId = false, phaseId = false, habitDoseVariantsRefs = false, ifThenRulesRefs = false, trackerEntriesRefs = false, lapseLogsRefs = false, urgeLogsRefs = false, rewardDeclarationsRefs = false, }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (habitDoseVariantsRefs) db.habitDoseVariants, if (ifThenRulesRefs) db.ifThenRules, if (trackerEntriesRefs) db.trackerEntries, if (lapseLogsRefs) db.lapseLogs, if (urgeLogsRefs) db.urgeLogs, if (rewardDeclarationsRefs) db.rewardDeclarations, ], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (userId) { state = state.withJoin( currentTable: table, currentColumn: table.userId, referencedTable: $$HabitsTableReferences ._userIdTable(db), referencedColumn: $$HabitsTableReferences ._userIdTable(db) .id, ) as T; } if (phaseId) { state = state.withJoin( currentTable: table, currentColumn: table.phaseId, referencedTable: $$HabitsTableReferences ._phaseIdTable(db), referencedColumn: $$HabitsTableReferences ._phaseIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return [ if (habitDoseVariantsRefs) await $_getPrefetchedData< Habit, $HabitsTable, HabitDoseVariant >( currentTable: table, referencedTable: $$HabitsTableReferences ._habitDoseVariantsRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).habitDoseVariantsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), if (ifThenRulesRefs) await $_getPrefetchedData< Habit, $HabitsTable, IfThenRule >( currentTable: table, referencedTable: $$HabitsTableReferences ._ifThenRulesRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).ifThenRulesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), if (trackerEntriesRefs) await $_getPrefetchedData< Habit, $HabitsTable, TrackerEntry >( currentTable: table, referencedTable: $$HabitsTableReferences ._trackerEntriesRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).trackerEntriesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), if (lapseLogsRefs) await $_getPrefetchedData< Habit, $HabitsTable, LapseLog >( currentTable: table, referencedTable: $$HabitsTableReferences ._lapseLogsRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).lapseLogsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), if (urgeLogsRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$HabitsTableReferences ._urgeLogsRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).urgeLogsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), if (rewardDeclarationsRefs) await $_getPrefetchedData< Habit, $HabitsTable, RewardDeclaration >( currentTable: table, referencedTable: $$HabitsTableReferences ._rewardDeclarationsRefsTable(db), managerFromTypedResult: (p0) => $$HabitsTableReferences( db, table, p0, ).rewardDeclarationsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.habitId == item.id, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$HabitsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $HabitsTable, Habit, $$HabitsTableFilterComposer, $$HabitsTableOrderingComposer, $$HabitsTableAnnotationComposer, $$HabitsTableCreateCompanionBuilder, $$HabitsTableUpdateCompanionBuilder, (Habit, $$HabitsTableReferences), Habit, PrefetchHooks Function({ bool userId, bool phaseId, bool habitDoseVariantsRefs, bool ifThenRulesRefs, bool trackerEntriesRefs, bool lapseLogsRefs, bool urgeLogsRefs, bool rewardDeclarationsRefs, }) >; typedef $$HabitDoseVariantsTableCreateCompanionBuilder = HabitDoseVariantsCompanion Function({ required String variantId, required String habitId, required String label, required String doseText, Value contextTagsJson, Value conditionTagsJson, Value isMinimum, Value sortOrder, Value rowid, }); typedef $$HabitDoseVariantsTableUpdateCompanionBuilder = HabitDoseVariantsCompanion Function({ Value variantId, Value habitId, Value label, Value doseText, Value contextTagsJson, Value conditionTagsJson, Value isMinimum, Value sortOrder, Value rowid, }); final class $$HabitDoseVariantsTableReferences extends BaseReferences< _$AppDatabase, $HabitDoseVariantsTable, HabitDoseVariant > { $$HabitDoseVariantsTableReferences( super.$_db, super.$_table, super.$_typedResult, ); static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.habitDoseVariants.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static MultiTypedResultKey<$TrackerEntriesTable, List> _trackerEntriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.trackerEntries, aliasName: $_aliasNameGenerator( db.habitDoseVariants.variantId, db.trackerEntries.variantId, ), ); $$TrackerEntriesTableProcessedTableManager get trackerEntriesRefs { final manager = $$TrackerEntriesTableTableManager($_db, $_db.trackerEntries) .filter( (f) => f.variantId.variantId.sqlEquals( $_itemColumn('variant_id')!, ), ); final cache = $_typedResult.readTableOrNull(_trackerEntriesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$HabitDoseVariantsTableFilterComposer extends Composer<_$AppDatabase, $HabitDoseVariantsTable> { $$HabitDoseVariantsTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get variantId => $composableBuilder( column: $table.variantId, builder: (column) => ColumnFilters(column), ); ColumnFilters get label => $composableBuilder( column: $table.label, builder: (column) => ColumnFilters(column), ); ColumnFilters get doseText => $composableBuilder( column: $table.doseText, builder: (column) => ColumnFilters(column), ); ColumnFilters get contextTagsJson => $composableBuilder( column: $table.contextTagsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get conditionTagsJson => $composableBuilder( column: $table.conditionTagsJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get isMinimum => $composableBuilder( column: $table.isMinimum, builder: (column) => ColumnFilters(column), ); ColumnFilters get sortOrder => $composableBuilder( column: $table.sortOrder, builder: (column) => ColumnFilters(column), ); $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression trackerEntriesRefs( Expression Function($$TrackerEntriesTableFilterComposer f) f, ) { final $$TrackerEntriesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.variantId, referencedTable: $db.trackerEntries, getReferencedColumn: (t) => t.variantId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$TrackerEntriesTableFilterComposer( $db: $db, $table: $db.trackerEntries, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$HabitDoseVariantsTableOrderingComposer extends Composer<_$AppDatabase, $HabitDoseVariantsTable> { $$HabitDoseVariantsTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get variantId => $composableBuilder( column: $table.variantId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get label => $composableBuilder( column: $table.label, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get doseText => $composableBuilder( column: $table.doseText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contextTagsJson => $composableBuilder( column: $table.contextTagsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get conditionTagsJson => $composableBuilder( column: $table.conditionTagsJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get isMinimum => $composableBuilder( column: $table.isMinimum, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get sortOrder => $composableBuilder( column: $table.sortOrder, builder: (column) => ColumnOrderings(column), ); $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$HabitDoseVariantsTableAnnotationComposer extends Composer<_$AppDatabase, $HabitDoseVariantsTable> { $$HabitDoseVariantsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get variantId => $composableBuilder(column: $table.variantId, builder: (column) => column); GeneratedColumn get label => $composableBuilder(column: $table.label, builder: (column) => column); GeneratedColumn get doseText => $composableBuilder(column: $table.doseText, builder: (column) => column); GeneratedColumn get contextTagsJson => $composableBuilder( column: $table.contextTagsJson, builder: (column) => column, ); GeneratedColumn get conditionTagsJson => $composableBuilder( column: $table.conditionTagsJson, builder: (column) => column, ); GeneratedColumn get isMinimum => $composableBuilder(column: $table.isMinimum, builder: (column) => column); GeneratedColumn get sortOrder => $composableBuilder(column: $table.sortOrder, builder: (column) => column); $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression trackerEntriesRefs( Expression Function($$TrackerEntriesTableAnnotationComposer a) f, ) { final $$TrackerEntriesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.variantId, referencedTable: $db.trackerEntries, getReferencedColumn: (t) => t.variantId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$TrackerEntriesTableAnnotationComposer( $db: $db, $table: $db.trackerEntries, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$HabitDoseVariantsTableTableManager extends RootTableManager< _$AppDatabase, $HabitDoseVariantsTable, HabitDoseVariant, $$HabitDoseVariantsTableFilterComposer, $$HabitDoseVariantsTableOrderingComposer, $$HabitDoseVariantsTableAnnotationComposer, $$HabitDoseVariantsTableCreateCompanionBuilder, $$HabitDoseVariantsTableUpdateCompanionBuilder, (HabitDoseVariant, $$HabitDoseVariantsTableReferences), HabitDoseVariant, PrefetchHooks Function({bool habitId, bool trackerEntriesRefs}) > { $$HabitDoseVariantsTableTableManager( _$AppDatabase db, $HabitDoseVariantsTable table, ) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$HabitDoseVariantsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$HabitDoseVariantsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$HabitDoseVariantsTableAnnotationComposer( $db: db, $table: table, ), updateCompanionCallback: ({ Value variantId = const Value.absent(), Value habitId = const Value.absent(), Value label = const Value.absent(), Value doseText = const Value.absent(), Value contextTagsJson = const Value.absent(), Value conditionTagsJson = const Value.absent(), Value isMinimum = const Value.absent(), Value sortOrder = const Value.absent(), Value rowid = const Value.absent(), }) => HabitDoseVariantsCompanion( variantId: variantId, habitId: habitId, label: label, doseText: doseText, contextTagsJson: contextTagsJson, conditionTagsJson: conditionTagsJson, isMinimum: isMinimum, sortOrder: sortOrder, rowid: rowid, ), createCompanionCallback: ({ required String variantId, required String habitId, required String label, required String doseText, Value contextTagsJson = const Value.absent(), Value conditionTagsJson = const Value.absent(), Value isMinimum = const Value.absent(), Value sortOrder = const Value.absent(), Value rowid = const Value.absent(), }) => HabitDoseVariantsCompanion.insert( variantId: variantId, habitId: habitId, label: label, doseText: doseText, contextTagsJson: contextTagsJson, conditionTagsJson: conditionTagsJson, isMinimum: isMinimum, sortOrder: sortOrder, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$HabitDoseVariantsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({habitId = false, trackerEntriesRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (trackerEntriesRefs) db.trackerEntries, ], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$HabitDoseVariantsTableReferences ._habitIdTable(db), referencedColumn: $$HabitDoseVariantsTableReferences ._habitIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return [ if (trackerEntriesRefs) await $_getPrefetchedData< HabitDoseVariant, $HabitDoseVariantsTable, TrackerEntry >( currentTable: table, referencedTable: $$HabitDoseVariantsTableReferences ._trackerEntriesRefsTable(db), managerFromTypedResult: (p0) => $$HabitDoseVariantsTableReferences( db, table, p0, ).trackerEntriesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.variantId == item.variantId, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$HabitDoseVariantsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $HabitDoseVariantsTable, HabitDoseVariant, $$HabitDoseVariantsTableFilterComposer, $$HabitDoseVariantsTableOrderingComposer, $$HabitDoseVariantsTableAnnotationComposer, $$HabitDoseVariantsTableCreateCompanionBuilder, $$HabitDoseVariantsTableUpdateCompanionBuilder, (HabitDoseVariant, $$HabitDoseVariantsTableReferences), HabitDoseVariant, PrefetchHooks Function({bool habitId, bool trackerEntriesRefs}) >; typedef $$IfThenRulesTableCreateCompanionBuilder = IfThenRulesCompanion Function({ required String id, required String habitId, required String ifCondition, required String thenAction, Value triggerType, Value priority, Value createdAt, Value rowid, }); typedef $$IfThenRulesTableUpdateCompanionBuilder = IfThenRulesCompanion Function({ Value id, Value habitId, Value ifCondition, Value thenAction, Value triggerType, Value priority, Value createdAt, Value rowid, }); final class $$IfThenRulesTableReferences extends BaseReferences<_$AppDatabase, $IfThenRulesTable, IfThenRule> { $$IfThenRulesTableReferences(super.$_db, super.$_table, super.$_typedResult); static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.ifThenRules.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$IfThenRulesTableFilterComposer extends Composer<_$AppDatabase, $IfThenRulesTable> { $$IfThenRulesTableFilterComposer({ 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 ifCondition => $composableBuilder( column: $table.ifCondition, builder: (column) => ColumnFilters(column), ); ColumnFilters get thenAction => $composableBuilder( column: $table.thenAction, builder: (column) => ColumnFilters(column), ); ColumnFilters get triggerType => $composableBuilder( column: $table.triggerType, builder: (column) => ColumnFilters(column), ); ColumnFilters get priority => $composableBuilder( column: $table.priority, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$IfThenRulesTableOrderingComposer extends Composer<_$AppDatabase, $IfThenRulesTable> { $$IfThenRulesTableOrderingComposer({ 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 ifCondition => $composableBuilder( column: $table.ifCondition, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get thenAction => $composableBuilder( column: $table.thenAction, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get triggerType => $composableBuilder( column: $table.triggerType, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get priority => $composableBuilder( column: $table.priority, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$IfThenRulesTableAnnotationComposer extends Composer<_$AppDatabase, $IfThenRulesTable> { $$IfThenRulesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get ifCondition => $composableBuilder( column: $table.ifCondition, builder: (column) => column, ); GeneratedColumn get thenAction => $composableBuilder( column: $table.thenAction, builder: (column) => column, ); GeneratedColumn get triggerType => $composableBuilder( column: $table.triggerType, builder: (column) => column, ); GeneratedColumn get priority => $composableBuilder(column: $table.priority, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$IfThenRulesTableTableManager extends RootTableManager< _$AppDatabase, $IfThenRulesTable, IfThenRule, $$IfThenRulesTableFilterComposer, $$IfThenRulesTableOrderingComposer, $$IfThenRulesTableAnnotationComposer, $$IfThenRulesTableCreateCompanionBuilder, $$IfThenRulesTableUpdateCompanionBuilder, (IfThenRule, $$IfThenRulesTableReferences), IfThenRule, PrefetchHooks Function({bool habitId}) > { $$IfThenRulesTableTableManager(_$AppDatabase db, $IfThenRulesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$IfThenRulesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$IfThenRulesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$IfThenRulesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value habitId = const Value.absent(), Value ifCondition = const Value.absent(), Value thenAction = const Value.absent(), Value triggerType = const Value.absent(), Value priority = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => IfThenRulesCompanion( id: id, habitId: habitId, ifCondition: ifCondition, thenAction: thenAction, triggerType: triggerType, priority: priority, createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String habitId, required String ifCondition, required String thenAction, Value triggerType = const Value.absent(), Value priority = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => IfThenRulesCompanion.insert( id: id, habitId: habitId, ifCondition: ifCondition, thenAction: thenAction, triggerType: triggerType, priority: priority, createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$IfThenRulesTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({habitId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$IfThenRulesTableReferences ._habitIdTable(db), referencedColumn: $$IfThenRulesTableReferences ._habitIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$IfThenRulesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $IfThenRulesTable, IfThenRule, $$IfThenRulesTableFilterComposer, $$IfThenRulesTableOrderingComposer, $$IfThenRulesTableAnnotationComposer, $$IfThenRulesTableCreateCompanionBuilder, $$IfThenRulesTableUpdateCompanionBuilder, (IfThenRule, $$IfThenRulesTableReferences), IfThenRule, PrefetchHooks Function({bool habitId}) >; typedef $$TrackerEntriesTableCreateCompanionBuilder = TrackerEntriesCompanion Function({ required String id, required String habitId, required String date, required String value, Value loggedAt, Value note, Value variantId, Value ctxLocation, Value ctxCondition, Value rowid, }); typedef $$TrackerEntriesTableUpdateCompanionBuilder = TrackerEntriesCompanion Function({ Value id, Value habitId, Value date, Value value, Value loggedAt, Value note, Value variantId, Value ctxLocation, Value ctxCondition, Value rowid, }); final class $$TrackerEntriesTableReferences extends BaseReferences<_$AppDatabase, $TrackerEntriesTable, TrackerEntry> { $$TrackerEntriesTableReferences( super.$_db, super.$_table, super.$_typedResult, ); static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.trackerEntries.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static $HabitDoseVariantsTable _variantIdTable(_$AppDatabase db) => db.habitDoseVariants.createAlias( $_aliasNameGenerator( db.trackerEntries.variantId, db.habitDoseVariants.variantId, ), ); $$HabitDoseVariantsTableProcessedTableManager? get variantId { final $_column = $_itemColumn('variant_id'); if ($_column == null) return null; final manager = $$HabitDoseVariantsTableTableManager( $_db, $_db.habitDoseVariants, ).filter((f) => f.variantId.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_variantIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$TrackerEntriesTableFilterComposer extends Composer<_$AppDatabase, $TrackerEntriesTable> { $$TrackerEntriesTableFilterComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnFilters(column), ); ColumnFilters get value => $composableBuilder( column: $table.value, builder: (column) => ColumnFilters(column), ); ColumnFilters get loggedAt => $composableBuilder( column: $table.loggedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get note => $composableBuilder( column: $table.note, builder: (column) => ColumnFilters(column), ); ColumnFilters get ctxLocation => $composableBuilder( column: $table.ctxLocation, builder: (column) => ColumnFilters(column), ); ColumnFilters get ctxCondition => $composableBuilder( column: $table.ctxCondition, builder: (column) => ColumnFilters(column), ); $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitDoseVariantsTableFilterComposer get variantId { final $$HabitDoseVariantsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.variantId, referencedTable: $db.habitDoseVariants, getReferencedColumn: (t) => t.variantId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitDoseVariantsTableFilterComposer( $db: $db, $table: $db.habitDoseVariants, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$TrackerEntriesTableOrderingComposer extends Composer<_$AppDatabase, $TrackerEntriesTable> { $$TrackerEntriesTableOrderingComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get value => $composableBuilder( column: $table.value, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get loggedAt => $composableBuilder( column: $table.loggedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get note => $composableBuilder( column: $table.note, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get ctxLocation => $composableBuilder( column: $table.ctxLocation, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get ctxCondition => $composableBuilder( column: $table.ctxCondition, builder: (column) => ColumnOrderings(column), ); $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitDoseVariantsTableOrderingComposer get variantId { final $$HabitDoseVariantsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.variantId, referencedTable: $db.habitDoseVariants, getReferencedColumn: (t) => t.variantId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitDoseVariantsTableOrderingComposer( $db: $db, $table: $db.habitDoseVariants, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$TrackerEntriesTableAnnotationComposer extends Composer<_$AppDatabase, $TrackerEntriesTable> { $$TrackerEntriesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get date => $composableBuilder(column: $table.date, builder: (column) => column); GeneratedColumn get value => $composableBuilder(column: $table.value, builder: (column) => column); GeneratedColumn get loggedAt => $composableBuilder(column: $table.loggedAt, builder: (column) => column); GeneratedColumn get note => $composableBuilder(column: $table.note, builder: (column) => column); GeneratedColumn get ctxLocation => $composableBuilder( column: $table.ctxLocation, builder: (column) => column, ); GeneratedColumn get ctxCondition => $composableBuilder( column: $table.ctxCondition, builder: (column) => column, ); $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitDoseVariantsTableAnnotationComposer get variantId { final $$HabitDoseVariantsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.variantId, referencedTable: $db.habitDoseVariants, getReferencedColumn: (t) => t.variantId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitDoseVariantsTableAnnotationComposer( $db: $db, $table: $db.habitDoseVariants, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$TrackerEntriesTableTableManager extends RootTableManager< _$AppDatabase, $TrackerEntriesTable, TrackerEntry, $$TrackerEntriesTableFilterComposer, $$TrackerEntriesTableOrderingComposer, $$TrackerEntriesTableAnnotationComposer, $$TrackerEntriesTableCreateCompanionBuilder, $$TrackerEntriesTableUpdateCompanionBuilder, (TrackerEntry, $$TrackerEntriesTableReferences), TrackerEntry, PrefetchHooks Function({bool habitId, bool variantId}) > { $$TrackerEntriesTableTableManager( _$AppDatabase db, $TrackerEntriesTable table, ) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$TrackerEntriesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$TrackerEntriesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$TrackerEntriesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value habitId = const Value.absent(), Value date = const Value.absent(), Value value = const Value.absent(), Value loggedAt = const Value.absent(), Value note = const Value.absent(), Value variantId = const Value.absent(), Value ctxLocation = const Value.absent(), Value ctxCondition = const Value.absent(), Value rowid = const Value.absent(), }) => TrackerEntriesCompanion( id: id, habitId: habitId, date: date, value: value, loggedAt: loggedAt, note: note, variantId: variantId, ctxLocation: ctxLocation, ctxCondition: ctxCondition, rowid: rowid, ), createCompanionCallback: ({ required String id, required String habitId, required String date, required String value, Value loggedAt = const Value.absent(), Value note = const Value.absent(), Value variantId = const Value.absent(), Value ctxLocation = const Value.absent(), Value ctxCondition = const Value.absent(), Value rowid = const Value.absent(), }) => TrackerEntriesCompanion.insert( id: id, habitId: habitId, date: date, value: value, loggedAt: loggedAt, note: note, variantId: variantId, ctxLocation: ctxLocation, ctxCondition: ctxCondition, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$TrackerEntriesTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({habitId = false, variantId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$TrackerEntriesTableReferences ._habitIdTable(db), referencedColumn: $$TrackerEntriesTableReferences ._habitIdTable(db) .id, ) as T; } if (variantId) { state = state.withJoin( currentTable: table, currentColumn: table.variantId, referencedTable: $$TrackerEntriesTableReferences ._variantIdTable(db), referencedColumn: $$TrackerEntriesTableReferences ._variantIdTable(db) .variantId, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$TrackerEntriesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $TrackerEntriesTable, TrackerEntry, $$TrackerEntriesTableFilterComposer, $$TrackerEntriesTableOrderingComposer, $$TrackerEntriesTableAnnotationComposer, $$TrackerEntriesTableCreateCompanionBuilder, $$TrackerEntriesTableUpdateCompanionBuilder, (TrackerEntry, $$TrackerEntriesTableReferences), TrackerEntry, PrefetchHooks Function({bool habitId, bool variantId}) >; typedef $$LapseLogsTableCreateCompanionBuilder = LapseLogsCompanion Function({ required String id, required String habitId, required String date, required String labelText, required String examineHaltJson, required String antecedentJson, required String replan, required String nextAction, Value createdAt, Value rowid, }); typedef $$LapseLogsTableUpdateCompanionBuilder = LapseLogsCompanion Function({ Value id, Value habitId, Value date, Value labelText, Value examineHaltJson, Value antecedentJson, Value replan, Value nextAction, Value createdAt, Value rowid, }); final class $$LapseLogsTableReferences extends BaseReferences<_$AppDatabase, $LapseLogsTable, LapseLog> { $$LapseLogsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.lapseLogs.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$LapseLogsTableFilterComposer extends Composer<_$AppDatabase, $LapseLogsTable> { $$LapseLogsTableFilterComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnFilters(column), ); ColumnFilters get labelText => $composableBuilder( column: $table.labelText, builder: (column) => ColumnFilters(column), ); ColumnFilters get examineHaltJson => $composableBuilder( column: $table.examineHaltJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get antecedentJson => $composableBuilder( column: $table.antecedentJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get replan => $composableBuilder( column: $table.replan, builder: (column) => ColumnFilters(column), ); ColumnFilters get nextAction => $composableBuilder( column: $table.nextAction, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$LapseLogsTableOrderingComposer extends Composer<_$AppDatabase, $LapseLogsTable> { $$LapseLogsTableOrderingComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get labelText => $composableBuilder( column: $table.labelText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get examineHaltJson => $composableBuilder( column: $table.examineHaltJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get antecedentJson => $composableBuilder( column: $table.antecedentJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get replan => $composableBuilder( column: $table.replan, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get nextAction => $composableBuilder( column: $table.nextAction, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$LapseLogsTableAnnotationComposer extends Composer<_$AppDatabase, $LapseLogsTable> { $$LapseLogsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get date => $composableBuilder(column: $table.date, builder: (column) => column); GeneratedColumn get labelText => $composableBuilder(column: $table.labelText, builder: (column) => column); GeneratedColumn get examineHaltJson => $composableBuilder( column: $table.examineHaltJson, builder: (column) => column, ); GeneratedColumn get antecedentJson => $composableBuilder( column: $table.antecedentJson, builder: (column) => column, ); GeneratedColumn get replan => $composableBuilder(column: $table.replan, builder: (column) => column); GeneratedColumn get nextAction => $composableBuilder( column: $table.nextAction, builder: (column) => column, ); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$LapseLogsTableTableManager extends RootTableManager< _$AppDatabase, $LapseLogsTable, LapseLog, $$LapseLogsTableFilterComposer, $$LapseLogsTableOrderingComposer, $$LapseLogsTableAnnotationComposer, $$LapseLogsTableCreateCompanionBuilder, $$LapseLogsTableUpdateCompanionBuilder, (LapseLog, $$LapseLogsTableReferences), LapseLog, PrefetchHooks Function({bool habitId}) > { $$LapseLogsTableTableManager(_$AppDatabase db, $LapseLogsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$LapseLogsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$LapseLogsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$LapseLogsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value habitId = const Value.absent(), Value date = const Value.absent(), Value labelText = const Value.absent(), Value examineHaltJson = const Value.absent(), Value antecedentJson = const Value.absent(), Value replan = const Value.absent(), Value nextAction = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => LapseLogsCompanion( id: id, habitId: habitId, date: date, labelText: labelText, examineHaltJson: examineHaltJson, antecedentJson: antecedentJson, replan: replan, nextAction: nextAction, createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String habitId, required String date, required String labelText, required String examineHaltJson, required String antecedentJson, required String replan, required String nextAction, Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => LapseLogsCompanion.insert( id: id, habitId: habitId, date: date, labelText: labelText, examineHaltJson: examineHaltJson, antecedentJson: antecedentJson, replan: replan, nextAction: nextAction, createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$LapseLogsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({habitId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$LapseLogsTableReferences ._habitIdTable(db), referencedColumn: $$LapseLogsTableReferences ._habitIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$LapseLogsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $LapseLogsTable, LapseLog, $$LapseLogsTableFilterComposer, $$LapseLogsTableOrderingComposer, $$LapseLogsTableAnnotationComposer, $$LapseLogsTableCreateCompanionBuilder, $$LapseLogsTableUpdateCompanionBuilder, (LapseLog, $$LapseLogsTableReferences), LapseLog, PrefetchHooks Function({bool habitId}) >; typedef $$UrgeLogsTableCreateCompanionBuilder = UrgeLogsCompanion Function({ required String id, required String habitId, required String occurredAt, Value intensityBefore, Value intensityAfter, Value durationSeconds, Value bodyLocationJson, required bool passed, Value methodUsed, Value rowid, }); typedef $$UrgeLogsTableUpdateCompanionBuilder = UrgeLogsCompanion Function({ Value id, Value habitId, Value occurredAt, Value intensityBefore, Value intensityAfter, Value durationSeconds, Value bodyLocationJson, Value passed, Value methodUsed, Value rowid, }); final class $$UrgeLogsTableReferences extends BaseReferences<_$AppDatabase, $UrgeLogsTable, UrgeLog> { $$UrgeLogsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.urgeLogs.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$UrgeLogsTableFilterComposer extends Composer<_$AppDatabase, $UrgeLogsTable> { $$UrgeLogsTableFilterComposer({ 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 occurredAt => $composableBuilder( column: $table.occurredAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get intensityBefore => $composableBuilder( column: $table.intensityBefore, builder: (column) => ColumnFilters(column), ); ColumnFilters get intensityAfter => $composableBuilder( column: $table.intensityAfter, builder: (column) => ColumnFilters(column), ); ColumnFilters get durationSeconds => $composableBuilder( column: $table.durationSeconds, builder: (column) => ColumnFilters(column), ); ColumnFilters get bodyLocationJson => $composableBuilder( column: $table.bodyLocationJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get passed => $composableBuilder( column: $table.passed, builder: (column) => ColumnFilters(column), ); ColumnFilters get methodUsed => $composableBuilder( column: $table.methodUsed, builder: (column) => ColumnFilters(column), ); $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$UrgeLogsTableOrderingComposer extends Composer<_$AppDatabase, $UrgeLogsTable> { $$UrgeLogsTableOrderingComposer({ 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 occurredAt => $composableBuilder( column: $table.occurredAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get intensityBefore => $composableBuilder( column: $table.intensityBefore, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get intensityAfter => $composableBuilder( column: $table.intensityAfter, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get durationSeconds => $composableBuilder( column: $table.durationSeconds, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get bodyLocationJson => $composableBuilder( column: $table.bodyLocationJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get passed => $composableBuilder( column: $table.passed, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get methodUsed => $composableBuilder( column: $table.methodUsed, builder: (column) => ColumnOrderings(column), ); $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$UrgeLogsTableAnnotationComposer extends Composer<_$AppDatabase, $UrgeLogsTable> { $$UrgeLogsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get occurredAt => $composableBuilder( column: $table.occurredAt, builder: (column) => column, ); GeneratedColumn get intensityBefore => $composableBuilder( column: $table.intensityBefore, builder: (column) => column, ); GeneratedColumn get intensityAfter => $composableBuilder( column: $table.intensityAfter, builder: (column) => column, ); GeneratedColumn get durationSeconds => $composableBuilder( column: $table.durationSeconds, builder: (column) => column, ); GeneratedColumn get bodyLocationJson => $composableBuilder( column: $table.bodyLocationJson, builder: (column) => column, ); GeneratedColumn get passed => $composableBuilder(column: $table.passed, builder: (column) => column); GeneratedColumn get methodUsed => $composableBuilder( column: $table.methodUsed, builder: (column) => column, ); $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$UrgeLogsTableTableManager extends RootTableManager< _$AppDatabase, $UrgeLogsTable, UrgeLog, $$UrgeLogsTableFilterComposer, $$UrgeLogsTableOrderingComposer, $$UrgeLogsTableAnnotationComposer, $$UrgeLogsTableCreateCompanionBuilder, $$UrgeLogsTableUpdateCompanionBuilder, (UrgeLog, $$UrgeLogsTableReferences), UrgeLog, PrefetchHooks Function({bool habitId}) > { $$UrgeLogsTableTableManager(_$AppDatabase db, $UrgeLogsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$UrgeLogsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$UrgeLogsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$UrgeLogsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value habitId = const Value.absent(), Value occurredAt = const Value.absent(), Value intensityBefore = const Value.absent(), Value intensityAfter = const Value.absent(), Value durationSeconds = const Value.absent(), Value bodyLocationJson = const Value.absent(), Value passed = const Value.absent(), Value methodUsed = const Value.absent(), Value rowid = const Value.absent(), }) => UrgeLogsCompanion( id: id, habitId: habitId, occurredAt: occurredAt, intensityBefore: intensityBefore, intensityAfter: intensityAfter, durationSeconds: durationSeconds, bodyLocationJson: bodyLocationJson, passed: passed, methodUsed: methodUsed, rowid: rowid, ), createCompanionCallback: ({ required String id, required String habitId, required String occurredAt, Value intensityBefore = const Value.absent(), Value intensityAfter = const Value.absent(), Value durationSeconds = const Value.absent(), Value bodyLocationJson = const Value.absent(), required bool passed, Value methodUsed = const Value.absent(), Value rowid = const Value.absent(), }) => UrgeLogsCompanion.insert( id: id, habitId: habitId, occurredAt: occurredAt, intensityBefore: intensityBefore, intensityAfter: intensityAfter, durationSeconds: durationSeconds, bodyLocationJson: bodyLocationJson, passed: passed, methodUsed: methodUsed, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$UrgeLogsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({habitId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$UrgeLogsTableReferences ._habitIdTable(db), referencedColumn: $$UrgeLogsTableReferences ._habitIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$UrgeLogsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $UrgeLogsTable, UrgeLog, $$UrgeLogsTableFilterComposer, $$UrgeLogsTableOrderingComposer, $$UrgeLogsTableAnnotationComposer, $$UrgeLogsTableCreateCompanionBuilder, $$UrgeLogsTableUpdateCompanionBuilder, (UrgeLog, $$UrgeLogsTableReferences), UrgeLog, PrefetchHooks Function({bool habitId}) >; typedef $$RewardDeclarationsTableCreateCompanionBuilder = RewardDeclarationsCompanion Function({ required String id, required String phaseId, required String habitId, required String tier, required String milestoneRule, Value milestoneMachineRuleJson, required String rewardText, Value rewardMenuItemId, Value estimatedCostKrw, Value isEffortTied, required String declaredAt, Value rowid, }); typedef $$RewardDeclarationsTableUpdateCompanionBuilder = RewardDeclarationsCompanion Function({ Value id, Value phaseId, Value habitId, Value tier, Value milestoneRule, Value milestoneMachineRuleJson, Value rewardText, Value rewardMenuItemId, Value estimatedCostKrw, Value isEffortTied, Value declaredAt, Value rowid, }); final class $$RewardDeclarationsTableReferences extends BaseReferences< _$AppDatabase, $RewardDeclarationsTable, RewardDeclaration > { $$RewardDeclarationsTableReferences( super.$_db, super.$_table, super.$_typedResult, ); static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias( $_aliasNameGenerator(db.rewardDeclarations.phaseId, db.phases.id), ); $$PhasesTableProcessedTableManager get phaseId { final $_column = $_itemColumn('phase_id')!; final manager = $$PhasesTableTableManager( $_db, $_db.phases, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_phaseIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias( $_aliasNameGenerator(db.rewardDeclarations.habitId, db.habits.id), ); $$HabitsTableProcessedTableManager get habitId { final $_column = $_itemColumn('habit_id')!; final manager = $$HabitsTableTableManager( $_db, $_db.habits, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_habitIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static MultiTypedResultKey<$RewardClaimsTable, List> _rewardClaimsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.rewardClaims, aliasName: $_aliasNameGenerator( db.rewardDeclarations.id, db.rewardClaims.declarationId, ), ); $$RewardClaimsTableProcessedTableManager get rewardClaimsRefs { final manager = $$RewardClaimsTableTableManager( $_db, $_db.rewardClaims, ).filter((f) => f.declarationId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_rewardClaimsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$RewardDeclarationsTableFilterComposer extends Composer<_$AppDatabase, $RewardDeclarationsTable> { $$RewardDeclarationsTableFilterComposer({ 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 tier => $composableBuilder( column: $table.tier, builder: (column) => ColumnFilters(column), ); ColumnFilters get milestoneRule => $composableBuilder( column: $table.milestoneRule, builder: (column) => ColumnFilters(column), ); ColumnFilters get milestoneMachineRuleJson => $composableBuilder( column: $table.milestoneMachineRuleJson, builder: (column) => ColumnFilters(column), ); ColumnFilters get rewardText => $composableBuilder( column: $table.rewardText, builder: (column) => ColumnFilters(column), ); ColumnFilters get rewardMenuItemId => $composableBuilder( column: $table.rewardMenuItemId, builder: (column) => ColumnFilters(column), ); ColumnFilters get estimatedCostKrw => $composableBuilder( column: $table.estimatedCostKrw, builder: (column) => ColumnFilters(column), ); ColumnFilters get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => ColumnFilters(column), ); ColumnFilters get declaredAt => $composableBuilder( column: $table.declaredAt, builder: (column) => ColumnFilters(column), ); $$PhasesTableFilterComposer get phaseId { final $$PhasesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableFilterComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitsTableFilterComposer get habitId { final $$HabitsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableFilterComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression rewardClaimsRefs( Expression Function($$RewardClaimsTableFilterComposer f) f, ) { final $$RewardClaimsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardClaims, getReferencedColumn: (t) => t.declarationId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardClaimsTableFilterComposer( $db: $db, $table: $db.rewardClaims, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$RewardDeclarationsTableOrderingComposer extends Composer<_$AppDatabase, $RewardDeclarationsTable> { $$RewardDeclarationsTableOrderingComposer({ 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 tier => $composableBuilder( column: $table.tier, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get milestoneRule => $composableBuilder( column: $table.milestoneRule, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get milestoneMachineRuleJson => $composableBuilder( column: $table.milestoneMachineRuleJson, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get rewardText => $composableBuilder( column: $table.rewardText, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get rewardMenuItemId => $composableBuilder( column: $table.rewardMenuItemId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get estimatedCostKrw => $composableBuilder( column: $table.estimatedCostKrw, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get declaredAt => $composableBuilder( column: $table.declaredAt, builder: (column) => ColumnOrderings(column), ); $$PhasesTableOrderingComposer get phaseId { final $$PhasesTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableOrderingComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitsTableOrderingComposer get habitId { final $$HabitsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableOrderingComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$RewardDeclarationsTableAnnotationComposer extends Composer<_$AppDatabase, $RewardDeclarationsTable> { $$RewardDeclarationsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get tier => $composableBuilder(column: $table.tier, builder: (column) => column); GeneratedColumn get milestoneRule => $composableBuilder( column: $table.milestoneRule, builder: (column) => column, ); GeneratedColumn get milestoneMachineRuleJson => $composableBuilder( column: $table.milestoneMachineRuleJson, builder: (column) => column, ); GeneratedColumn get rewardText => $composableBuilder( column: $table.rewardText, builder: (column) => column, ); GeneratedColumn get rewardMenuItemId => $composableBuilder( column: $table.rewardMenuItemId, builder: (column) => column, ); GeneratedColumn get estimatedCostKrw => $composableBuilder( column: $table.estimatedCostKrw, builder: (column) => column, ); GeneratedColumn get isEffortTied => $composableBuilder( column: $table.isEffortTied, builder: (column) => column, ); GeneratedColumn get declaredAt => $composableBuilder( column: $table.declaredAt, builder: (column) => column, ); $$PhasesTableAnnotationComposer get phaseId { final $$PhasesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableAnnotationComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$HabitsTableAnnotationComposer get habitId { final $$HabitsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.habitId, referencedTable: $db.habits, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$HabitsTableAnnotationComposer( $db: $db, $table: $db.habits, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression rewardClaimsRefs( Expression Function($$RewardClaimsTableAnnotationComposer a) f, ) { final $$RewardClaimsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.rewardClaims, getReferencedColumn: (t) => t.declarationId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardClaimsTableAnnotationComposer( $db: $db, $table: $db.rewardClaims, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$RewardDeclarationsTableTableManager extends RootTableManager< _$AppDatabase, $RewardDeclarationsTable, RewardDeclaration, $$RewardDeclarationsTableFilterComposer, $$RewardDeclarationsTableOrderingComposer, $$RewardDeclarationsTableAnnotationComposer, $$RewardDeclarationsTableCreateCompanionBuilder, $$RewardDeclarationsTableUpdateCompanionBuilder, (RewardDeclaration, $$RewardDeclarationsTableReferences), RewardDeclaration, PrefetchHooks Function({ bool phaseId, bool habitId, bool rewardClaimsRefs, }) > { $$RewardDeclarationsTableTableManager( _$AppDatabase db, $RewardDeclarationsTable table, ) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$RewardDeclarationsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$RewardDeclarationsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$RewardDeclarationsTableAnnotationComposer( $db: db, $table: table, ), updateCompanionCallback: ({ Value id = const Value.absent(), Value phaseId = const Value.absent(), Value habitId = const Value.absent(), Value tier = const Value.absent(), Value milestoneRule = const Value.absent(), Value milestoneMachineRuleJson = const Value.absent(), Value rewardText = const Value.absent(), Value rewardMenuItemId = const Value.absent(), Value estimatedCostKrw = const Value.absent(), Value isEffortTied = const Value.absent(), Value declaredAt = const Value.absent(), Value rowid = const Value.absent(), }) => RewardDeclarationsCompanion( id: id, phaseId: phaseId, habitId: habitId, tier: tier, milestoneRule: milestoneRule, milestoneMachineRuleJson: milestoneMachineRuleJson, rewardText: rewardText, rewardMenuItemId: rewardMenuItemId, estimatedCostKrw: estimatedCostKrw, isEffortTied: isEffortTied, declaredAt: declaredAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String phaseId, required String habitId, required String tier, required String milestoneRule, Value milestoneMachineRuleJson = const Value.absent(), required String rewardText, Value rewardMenuItemId = const Value.absent(), Value estimatedCostKrw = const Value.absent(), Value isEffortTied = const Value.absent(), required String declaredAt, Value rowid = const Value.absent(), }) => RewardDeclarationsCompanion.insert( id: id, phaseId: phaseId, habitId: habitId, tier: tier, milestoneRule: milestoneRule, milestoneMachineRuleJson: milestoneMachineRuleJson, rewardText: rewardText, rewardMenuItemId: rewardMenuItemId, estimatedCostKrw: estimatedCostKrw, isEffortTied: isEffortTied, declaredAt: declaredAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$RewardDeclarationsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({phaseId = false, habitId = false, rewardClaimsRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (rewardClaimsRefs) db.rewardClaims, ], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (phaseId) { state = state.withJoin( currentTable: table, currentColumn: table.phaseId, referencedTable: $$RewardDeclarationsTableReferences ._phaseIdTable(db), referencedColumn: $$RewardDeclarationsTableReferences ._phaseIdTable(db) .id, ) as T; } if (habitId) { state = state.withJoin( currentTable: table, currentColumn: table.habitId, referencedTable: $$RewardDeclarationsTableReferences ._habitIdTable(db), referencedColumn: $$RewardDeclarationsTableReferences ._habitIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return [ if (rewardClaimsRefs) await $_getPrefetchedData< RewardDeclaration, $RewardDeclarationsTable, RewardClaim >( currentTable: table, referencedTable: $$RewardDeclarationsTableReferences ._rewardClaimsRefsTable(db), managerFromTypedResult: (p0) => $$RewardDeclarationsTableReferences( db, table, p0, ).rewardClaimsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.declarationId == item.id, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$RewardDeclarationsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $RewardDeclarationsTable, RewardDeclaration, $$RewardDeclarationsTableFilterComposer, $$RewardDeclarationsTableOrderingComposer, $$RewardDeclarationsTableAnnotationComposer, $$RewardDeclarationsTableCreateCompanionBuilder, $$RewardDeclarationsTableUpdateCompanionBuilder, (RewardDeclaration, $$RewardDeclarationsTableReferences), RewardDeclaration, PrefetchHooks Function({ bool phaseId, bool habitId, bool rewardClaimsRefs, }) >; typedef $$RewardClaimsTableCreateCompanionBuilder = RewardClaimsCompanion Function({ required String id, required String declarationId, required String milestoneReachedAt, required bool fulfilled, Value fulfilledAt, Value reflection, Value rowid, }); typedef $$RewardClaimsTableUpdateCompanionBuilder = RewardClaimsCompanion Function({ Value id, Value declarationId, Value milestoneReachedAt, Value fulfilled, Value fulfilledAt, Value reflection, Value rowid, }); final class $$RewardClaimsTableReferences extends BaseReferences<_$AppDatabase, $RewardClaimsTable, RewardClaim> { $$RewardClaimsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $RewardDeclarationsTable _declarationIdTable(_$AppDatabase db) => db.rewardDeclarations.createAlias( $_aliasNameGenerator( db.rewardClaims.declarationId, db.rewardDeclarations.id, ), ); $$RewardDeclarationsTableProcessedTableManager get declarationId { final $_column = $_itemColumn('declaration_id')!; final manager = $$RewardDeclarationsTableTableManager( $_db, $_db.rewardDeclarations, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_declarationIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$RewardClaimsTableFilterComposer extends Composer<_$AppDatabase, $RewardClaimsTable> { $$RewardClaimsTableFilterComposer({ 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 milestoneReachedAt => $composableBuilder( column: $table.milestoneReachedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get fulfilled => $composableBuilder( column: $table.fulfilled, builder: (column) => ColumnFilters(column), ); ColumnFilters get fulfilledAt => $composableBuilder( column: $table.fulfilledAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get reflection => $composableBuilder( column: $table.reflection, builder: (column) => ColumnFilters(column), ); $$RewardDeclarationsTableFilterComposer get declarationId { final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.declarationId, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableFilterComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$RewardClaimsTableOrderingComposer extends Composer<_$AppDatabase, $RewardClaimsTable> { $$RewardClaimsTableOrderingComposer({ 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 milestoneReachedAt => $composableBuilder( column: $table.milestoneReachedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get fulfilled => $composableBuilder( column: $table.fulfilled, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get fulfilledAt => $composableBuilder( column: $table.fulfilledAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get reflection => $composableBuilder( column: $table.reflection, builder: (column) => ColumnOrderings(column), ); $$RewardDeclarationsTableOrderingComposer get declarationId { final $$RewardDeclarationsTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.declarationId, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableOrderingComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$RewardClaimsTableAnnotationComposer extends Composer<_$AppDatabase, $RewardClaimsTable> { $$RewardClaimsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get milestoneReachedAt => $composableBuilder( column: $table.milestoneReachedAt, builder: (column) => column, ); GeneratedColumn get fulfilled => $composableBuilder(column: $table.fulfilled, builder: (column) => column); GeneratedColumn get fulfilledAt => $composableBuilder( column: $table.fulfilledAt, builder: (column) => column, ); GeneratedColumn get reflection => $composableBuilder( column: $table.reflection, builder: (column) => column, ); $$RewardDeclarationsTableAnnotationComposer get declarationId { final $$RewardDeclarationsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.declarationId, referencedTable: $db.rewardDeclarations, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$RewardDeclarationsTableAnnotationComposer( $db: $db, $table: $db.rewardDeclarations, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$RewardClaimsTableTableManager extends RootTableManager< _$AppDatabase, $RewardClaimsTable, RewardClaim, $$RewardClaimsTableFilterComposer, $$RewardClaimsTableOrderingComposer, $$RewardClaimsTableAnnotationComposer, $$RewardClaimsTableCreateCompanionBuilder, $$RewardClaimsTableUpdateCompanionBuilder, (RewardClaim, $$RewardClaimsTableReferences), RewardClaim, PrefetchHooks Function({bool declarationId}) > { $$RewardClaimsTableTableManager(_$AppDatabase db, $RewardClaimsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$RewardClaimsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$RewardClaimsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$RewardClaimsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value declarationId = const Value.absent(), Value milestoneReachedAt = const Value.absent(), Value fulfilled = const Value.absent(), Value fulfilledAt = const Value.absent(), Value reflection = const Value.absent(), Value rowid = const Value.absent(), }) => RewardClaimsCompanion( id: id, declarationId: declarationId, milestoneReachedAt: milestoneReachedAt, fulfilled: fulfilled, fulfilledAt: fulfilledAt, reflection: reflection, rowid: rowid, ), createCompanionCallback: ({ required String id, required String declarationId, required String milestoneReachedAt, required bool fulfilled, Value fulfilledAt = const Value.absent(), Value reflection = const Value.absent(), Value rowid = const Value.absent(), }) => RewardClaimsCompanion.insert( id: id, declarationId: declarationId, milestoneReachedAt: milestoneReachedAt, fulfilled: fulfilled, fulfilledAt: fulfilledAt, reflection: reflection, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$RewardClaimsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({declarationId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (declarationId) { state = state.withJoin( currentTable: table, currentColumn: table.declarationId, referencedTable: $$RewardClaimsTableReferences ._declarationIdTable(db), referencedColumn: $$RewardClaimsTableReferences ._declarationIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$RewardClaimsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $RewardClaimsTable, RewardClaim, $$RewardClaimsTableFilterComposer, $$RewardClaimsTableOrderingComposer, $$RewardClaimsTableAnnotationComposer, $$RewardClaimsTableCreateCompanionBuilder, $$RewardClaimsTableUpdateCompanionBuilder, (RewardClaim, $$RewardClaimsTableReferences), RewardClaim, PrefetchHooks Function({bool declarationId}) >; typedef $$ReflectionsTableCreateCompanionBuilder = ReflectionsCompanion Function({ required String id, required String userId, required String scope, required String periodStart, required String periodEnd, Value phaseId, Value kept, Value missed, Value adjust, Value identityNote, Value minimumRatio, Value createdAt, Value rowid, }); typedef $$ReflectionsTableUpdateCompanionBuilder = ReflectionsCompanion Function({ Value id, Value userId, Value scope, Value periodStart, Value periodEnd, Value phaseId, Value kept, Value missed, Value adjust, Value identityNote, Value minimumRatio, Value createdAt, Value rowid, }); final class $$ReflectionsTableReferences extends BaseReferences<_$AppDatabase, $ReflectionsTable, Reflection> { $$ReflectionsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $UsersTable _userIdTable(_$AppDatabase db) => db.users.createAlias( $_aliasNameGenerator(db.reflections.userId, db.users.id), ); $$UsersTableProcessedTableManager get userId { final $_column = $_itemColumn('user_id')!; final manager = $$UsersTableTableManager( $_db, $_db.users, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_userIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias( $_aliasNameGenerator(db.reflections.phaseId, db.phases.id), ); $$PhasesTableProcessedTableManager? get phaseId { final $_column = $_itemColumn('phase_id'); if ($_column == null) return null; final manager = $$PhasesTableTableManager( $_db, $_db.phases, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_phaseIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$ReflectionsTableFilterComposer extends Composer<_$AppDatabase, $ReflectionsTable> { $$ReflectionsTableFilterComposer({ 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 scope => $composableBuilder( column: $table.scope, builder: (column) => ColumnFilters(column), ); ColumnFilters get periodStart => $composableBuilder( column: $table.periodStart, builder: (column) => ColumnFilters(column), ); ColumnFilters get periodEnd => $composableBuilder( column: $table.periodEnd, builder: (column) => ColumnFilters(column), ); ColumnFilters get kept => $composableBuilder( column: $table.kept, builder: (column) => ColumnFilters(column), ); ColumnFilters get missed => $composableBuilder( column: $table.missed, builder: (column) => ColumnFilters(column), ); ColumnFilters get adjust => $composableBuilder( column: $table.adjust, builder: (column) => ColumnFilters(column), ); ColumnFilters get identityNote => $composableBuilder( column: $table.identityNote, builder: (column) => ColumnFilters(column), ); ColumnFilters get minimumRatio => $composableBuilder( column: $table.minimumRatio, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); $$UsersTableFilterComposer get userId { final $$UsersTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableFilterComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableFilterComposer get phaseId { final $$PhasesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableFilterComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$ReflectionsTableOrderingComposer extends Composer<_$AppDatabase, $ReflectionsTable> { $$ReflectionsTableOrderingComposer({ 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 scope => $composableBuilder( column: $table.scope, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get periodStart => $composableBuilder( column: $table.periodStart, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get periodEnd => $composableBuilder( column: $table.periodEnd, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get kept => $composableBuilder( column: $table.kept, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get missed => $composableBuilder( column: $table.missed, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get adjust => $composableBuilder( column: $table.adjust, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get identityNote => $composableBuilder( column: $table.identityNote, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get minimumRatio => $composableBuilder( column: $table.minimumRatio, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); $$UsersTableOrderingComposer get userId { final $$UsersTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableOrderingComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableOrderingComposer get phaseId { final $$PhasesTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableOrderingComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$ReflectionsTableAnnotationComposer extends Composer<_$AppDatabase, $ReflectionsTable> { $$ReflectionsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get scope => $composableBuilder(column: $table.scope, builder: (column) => column); GeneratedColumn get periodStart => $composableBuilder( column: $table.periodStart, builder: (column) => column, ); GeneratedColumn get periodEnd => $composableBuilder(column: $table.periodEnd, builder: (column) => column); GeneratedColumn get kept => $composableBuilder(column: $table.kept, builder: (column) => column); GeneratedColumn get missed => $composableBuilder(column: $table.missed, builder: (column) => column); GeneratedColumn get adjust => $composableBuilder(column: $table.adjust, builder: (column) => column); GeneratedColumn get identityNote => $composableBuilder( column: $table.identityNote, builder: (column) => column, ); GeneratedColumn get minimumRatio => $composableBuilder( column: $table.minimumRatio, builder: (column) => column, ); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); $$UsersTableAnnotationComposer get userId { final $$UsersTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.userId, referencedTable: $db.users, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$UsersTableAnnotationComposer( $db: $db, $table: $db.users, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } $$PhasesTableAnnotationComposer get phaseId { final $$PhasesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.phaseId, referencedTable: $db.phases, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$PhasesTableAnnotationComposer( $db: $db, $table: $db.phases, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$ReflectionsTableTableManager extends RootTableManager< _$AppDatabase, $ReflectionsTable, Reflection, $$ReflectionsTableFilterComposer, $$ReflectionsTableOrderingComposer, $$ReflectionsTableAnnotationComposer, $$ReflectionsTableCreateCompanionBuilder, $$ReflectionsTableUpdateCompanionBuilder, (Reflection, $$ReflectionsTableReferences), Reflection, PrefetchHooks Function({bool userId, bool phaseId}) > { $$ReflectionsTableTableManager(_$AppDatabase db, $ReflectionsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$ReflectionsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ReflectionsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ReflectionsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value userId = const Value.absent(), Value scope = const Value.absent(), Value periodStart = const Value.absent(), Value periodEnd = const Value.absent(), Value phaseId = const Value.absent(), Value kept = const Value.absent(), Value missed = const Value.absent(), Value adjust = const Value.absent(), Value identityNote = const Value.absent(), Value minimumRatio = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => ReflectionsCompanion( id: id, userId: userId, scope: scope, periodStart: periodStart, periodEnd: periodEnd, phaseId: phaseId, kept: kept, missed: missed, adjust: adjust, identityNote: identityNote, minimumRatio: minimumRatio, createdAt: createdAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String userId, required String scope, required String periodStart, required String periodEnd, Value phaseId = const Value.absent(), Value kept = const Value.absent(), Value missed = const Value.absent(), Value adjust = const Value.absent(), Value identityNote = const Value.absent(), Value minimumRatio = const Value.absent(), Value createdAt = const Value.absent(), Value rowid = const Value.absent(), }) => ReflectionsCompanion.insert( id: id, userId: userId, scope: scope, periodStart: periodStart, periodEnd: periodEnd, phaseId: phaseId, kept: kept, missed: missed, adjust: adjust, identityNote: identityNote, minimumRatio: minimumRatio, createdAt: createdAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$ReflectionsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({userId = false, phaseId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (userId) { state = state.withJoin( currentTable: table, currentColumn: table.userId, referencedTable: $$ReflectionsTableReferences ._userIdTable(db), referencedColumn: $$ReflectionsTableReferences ._userIdTable(db) .id, ) as T; } if (phaseId) { state = state.withJoin( currentTable: table, currentColumn: table.phaseId, referencedTable: $$ReflectionsTableReferences ._phaseIdTable(db), referencedColumn: $$ReflectionsTableReferences ._phaseIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$ReflectionsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ReflectionsTable, Reflection, $$ReflectionsTableFilterComposer, $$ReflectionsTableOrderingComposer, $$ReflectionsTableAnnotationComposer, $$ReflectionsTableCreateCompanionBuilder, $$ReflectionsTableUpdateCompanionBuilder, (Reflection, $$ReflectionsTableReferences), Reflection, PrefetchHooks Function({bool userId, bool phaseId}) >; typedef $$MetaKvTableCreateCompanionBuilder = MetaKvCompanion Function({ required String key, required String value, Value rowid, }); typedef $$MetaKvTableUpdateCompanionBuilder = MetaKvCompanion Function({ Value key, Value value, Value rowid, }); class $$MetaKvTableFilterComposer extends Composer<_$AppDatabase, $MetaKvTable> { $$MetaKvTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get key => $composableBuilder( column: $table.key, builder: (column) => ColumnFilters(column), ); ColumnFilters get value => $composableBuilder( column: $table.value, builder: (column) => ColumnFilters(column), ); } class $$MetaKvTableOrderingComposer extends Composer<_$AppDatabase, $MetaKvTable> { $$MetaKvTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get key => $composableBuilder( column: $table.key, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get value => $composableBuilder( column: $table.value, builder: (column) => ColumnOrderings(column), ); } class $$MetaKvTableAnnotationComposer extends Composer<_$AppDatabase, $MetaKvTable> { $$MetaKvTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get key => $composableBuilder(column: $table.key, builder: (column) => column); GeneratedColumn get value => $composableBuilder(column: $table.value, builder: (column) => column); } class $$MetaKvTableTableManager extends RootTableManager< _$AppDatabase, $MetaKvTable, MetaKvData, $$MetaKvTableFilterComposer, $$MetaKvTableOrderingComposer, $$MetaKvTableAnnotationComposer, $$MetaKvTableCreateCompanionBuilder, $$MetaKvTableUpdateCompanionBuilder, (MetaKvData, BaseReferences<_$AppDatabase, $MetaKvTable, MetaKvData>), MetaKvData, PrefetchHooks Function() > { $$MetaKvTableTableManager(_$AppDatabase db, $MetaKvTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$MetaKvTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$MetaKvTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$MetaKvTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value key = const Value.absent(), Value value = const Value.absent(), Value rowid = const Value.absent(), }) => MetaKvCompanion(key: key, value: value, rowid: rowid), createCompanionCallback: ({ required String key, required String value, Value rowid = const Value.absent(), }) => MetaKvCompanion.insert(key: key, value: value, rowid: rowid), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$MetaKvTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $MetaKvTable, MetaKvData, $$MetaKvTableFilterComposer, $$MetaKvTableOrderingComposer, $$MetaKvTableAnnotationComposer, $$MetaKvTableCreateCompanionBuilder, $$MetaKvTableUpdateCompanionBuilder, (MetaKvData, BaseReferences<_$AppDatabase, $MetaKvTable, MetaKvData>), MetaKvData, PrefetchHooks Function() >; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$ProtocolsTableTableManager get protocols => $$ProtocolsTableTableManager(_db, _db.protocols); $$BreakProtocolsTableTableManager get breakProtocols => $$BreakProtocolsTableTableManager(_db, _db.breakProtocols); $$CommonFramesTableTableManager get commonFrames => $$CommonFramesTableTableManager(_db, _db.commonFrames); $$MethodologiesTableTableManager get methodologies => $$MethodologiesTableTableManager(_db, _db.methodologies); $$FramePatternsTableTableManager get framePatterns => $$FramePatternsTableTableManager(_db, _db.framePatterns); $$RewardMenuItemsTableTableManager get rewardMenuItems => $$RewardMenuItemsTableTableManager(_db, _db.rewardMenuItems); $$ReferencesTableTableManager get references => $$ReferencesTableTableManager(_db, _db.references); $$DietPatternsTableTableManager get dietPatterns => $$DietPatternsTableTableManager(_db, _db.dietPatterns); $$UsersTableTableManager get users => $$UsersTableTableManager(_db, _db.users); $$PhasesTableTableManager get phases => $$PhasesTableTableManager(_db, _db.phases); $$HabitsTableTableManager get habits => $$HabitsTableTableManager(_db, _db.habits); $$HabitDoseVariantsTableTableManager get habitDoseVariants => $$HabitDoseVariantsTableTableManager(_db, _db.habitDoseVariants); $$IfThenRulesTableTableManager get ifThenRules => $$IfThenRulesTableTableManager(_db, _db.ifThenRules); $$TrackerEntriesTableTableManager get trackerEntries => $$TrackerEntriesTableTableManager(_db, _db.trackerEntries); $$LapseLogsTableTableManager get lapseLogs => $$LapseLogsTableTableManager(_db, _db.lapseLogs); $$UrgeLogsTableTableManager get urgeLogs => $$UrgeLogsTableTableManager(_db, _db.urgeLogs); $$RewardDeclarationsTableTableManager get rewardDeclarations => $$RewardDeclarationsTableTableManager(_db, _db.rewardDeclarations); $$RewardClaimsTableTableManager get rewardClaims => $$RewardClaimsTableTableManager(_db, _db.rewardClaims); $$ReflectionsTableTableManager get reflections => $$ReflectionsTableTableManager(_db, _db.reflections); $$MetaKvTableTableManager get metaKv => $$MetaKvTableTableManager(_db, _db.metaKv); }