// GENERATED CODE - DO NOT MODIFY BY HAND part of 'app_database.dart'; // ignore_for_file: type=lint class $MedicationDosesTableTable extends MedicationDosesTable with TableInfo<$MedicationDosesTableTable, MedicationDoseRecord> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $MedicationDosesTableTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); static const VerificationMeta _compoundNameMeta = const VerificationMeta('compoundName'); @override late final GeneratedColumn compoundName = GeneratedColumn( 'compound_name', aliasedName, false, additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 128), type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _doseMgMeta = const VerificationMeta('doseMg'); @override late final GeneratedColumn doseMg = GeneratedColumn( 'dose_mg', aliasedName, false, type: DriftSqlType.double, requiredDuringInsert: true); static const VerificationMeta _scheduledTimeMeta = const VerificationMeta('scheduledTime'); @override late final GeneratedColumn scheduledTime = GeneratedColumn('scheduled_time', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true); static const VerificationMeta _administeredTimeMeta = const VerificationMeta('administeredTime'); @override late final GeneratedColumn administeredTime = GeneratedColumn('administered_time', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _injectionSiteMeta = const VerificationMeta('injectionSite'); @override late final GeneratedColumn injectionSite = GeneratedColumn( 'injection_site', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false); static const VerificationMeta _notesMeta = const VerificationMeta('notes'); @override late final GeneratedColumn notes = GeneratedColumn( 'notes', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false); @override List get $columns => [ id, compoundName, doseMg, scheduledTime, administeredTime, injectionSite, notes ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'medication_doses_table'; @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)); } if (data.containsKey('compound_name')) { context.handle( _compoundNameMeta, compoundName.isAcceptableOrUnknown( data['compound_name']!, _compoundNameMeta)); } else if (isInserting) { context.missing(_compoundNameMeta); } if (data.containsKey('dose_mg')) { context.handle(_doseMgMeta, doseMg.isAcceptableOrUnknown(data['dose_mg']!, _doseMgMeta)); } else if (isInserting) { context.missing(_doseMgMeta); } if (data.containsKey('scheduled_time')) { context.handle( _scheduledTimeMeta, scheduledTime.isAcceptableOrUnknown( data['scheduled_time']!, _scheduledTimeMeta)); } else if (isInserting) { context.missing(_scheduledTimeMeta); } if (data.containsKey('administered_time')) { context.handle( _administeredTimeMeta, administeredTime.isAcceptableOrUnknown( data['administered_time']!, _administeredTimeMeta)); } if (data.containsKey('injection_site')) { context.handle( _injectionSiteMeta, injectionSite.isAcceptableOrUnknown( data['injection_site']!, _injectionSiteMeta)); } if (data.containsKey('notes')) { context.handle( _notesMeta, notes.isAcceptableOrUnknown(data['notes']!, _notesMeta)); } return context; } @override Set get $primaryKey => {id}; @override MedicationDoseRecord map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return MedicationDoseRecord( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, compoundName: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}compound_name'])!, doseMg: attachedDatabase.typeMapping .read(DriftSqlType.double, data['${effectivePrefix}dose_mg'])!, scheduledTime: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}scheduled_time'])!, administeredTime: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}administered_time']), injectionSite: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}injection_site']), notes: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}notes']), ); } @override $MedicationDosesTableTable createAlias(String alias) { return $MedicationDosesTableTable(attachedDatabase, alias); } } class MedicationDoseRecord extends DataClass implements Insertable { final int id; /// Commercial or compounded name of the GLP-1/GIP agonist (e.g. Tirzepatide). final String compoundName; /// Total injected quantity in milligrams. final double doseMg; /// When the dose was prescribed to be taken (titration schedule anchor). final DateTime scheduledTime; /// When the dose was actually administered; `null` while still pending. final DateTime? administeredTime; /// Rotation quadrant identifier (e.g. `abdomenLeftLower`). final String? injectionSite; final String? notes; const MedicationDoseRecord( {required this.id, required this.compoundName, required this.doseMg, required this.scheduledTime, this.administeredTime, this.injectionSite, this.notes}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['compound_name'] = Variable(compoundName); map['dose_mg'] = Variable(doseMg); map['scheduled_time'] = Variable(scheduledTime); if (!nullToAbsent || administeredTime != null) { map['administered_time'] = Variable(administeredTime); } if (!nullToAbsent || injectionSite != null) { map['injection_site'] = Variable(injectionSite); } if (!nullToAbsent || notes != null) { map['notes'] = Variable(notes); } return map; } MedicationDosesTableCompanion toCompanion(bool nullToAbsent) { return MedicationDosesTableCompanion( id: Value(id), compoundName: Value(compoundName), doseMg: Value(doseMg), scheduledTime: Value(scheduledTime), administeredTime: administeredTime == null && nullToAbsent ? const Value.absent() : Value(administeredTime), injectionSite: injectionSite == null && nullToAbsent ? const Value.absent() : Value(injectionSite), notes: notes == null && nullToAbsent ? const Value.absent() : Value(notes), ); } factory MedicationDoseRecord.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return MedicationDoseRecord( id: serializer.fromJson(json['id']), compoundName: serializer.fromJson(json['compoundName']), doseMg: serializer.fromJson(json['doseMg']), scheduledTime: serializer.fromJson(json['scheduledTime']), administeredTime: serializer.fromJson(json['administeredTime']), injectionSite: serializer.fromJson(json['injectionSite']), notes: serializer.fromJson(json['notes']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'compoundName': serializer.toJson(compoundName), 'doseMg': serializer.toJson(doseMg), 'scheduledTime': serializer.toJson(scheduledTime), 'administeredTime': serializer.toJson(administeredTime), 'injectionSite': serializer.toJson(injectionSite), 'notes': serializer.toJson(notes), }; } MedicationDoseRecord copyWith( {int? id, String? compoundName, double? doseMg, DateTime? scheduledTime, Value administeredTime = const Value.absent(), Value injectionSite = const Value.absent(), Value notes = const Value.absent()}) => MedicationDoseRecord( id: id ?? this.id, compoundName: compoundName ?? this.compoundName, doseMg: doseMg ?? this.doseMg, scheduledTime: scheduledTime ?? this.scheduledTime, administeredTime: administeredTime.present ? administeredTime.value : this.administeredTime, injectionSite: injectionSite.present ? injectionSite.value : this.injectionSite, notes: notes.present ? notes.value : this.notes, ); MedicationDoseRecord copyWithCompanion(MedicationDosesTableCompanion data) { return MedicationDoseRecord( id: data.id.present ? data.id.value : this.id, compoundName: data.compoundName.present ? data.compoundName.value : this.compoundName, doseMg: data.doseMg.present ? data.doseMg.value : this.doseMg, scheduledTime: data.scheduledTime.present ? data.scheduledTime.value : this.scheduledTime, administeredTime: data.administeredTime.present ? data.administeredTime.value : this.administeredTime, injectionSite: data.injectionSite.present ? data.injectionSite.value : this.injectionSite, notes: data.notes.present ? data.notes.value : this.notes, ); } @override String toString() { return (StringBuffer('MedicationDoseRecord(') ..write('id: $id, ') ..write('compoundName: $compoundName, ') ..write('doseMg: $doseMg, ') ..write('scheduledTime: $scheduledTime, ') ..write('administeredTime: $administeredTime, ') ..write('injectionSite: $injectionSite, ') ..write('notes: $notes') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, compoundName, doseMg, scheduledTime, administeredTime, injectionSite, notes); @override bool operator ==(Object other) => identical(this, other) || (other is MedicationDoseRecord && other.id == this.id && other.compoundName == this.compoundName && other.doseMg == this.doseMg && other.scheduledTime == this.scheduledTime && other.administeredTime == this.administeredTime && other.injectionSite == this.injectionSite && other.notes == this.notes); } class MedicationDosesTableCompanion extends UpdateCompanion { final Value id; final Value compoundName; final Value doseMg; final Value scheduledTime; final Value administeredTime; final Value injectionSite; final Value notes; const MedicationDosesTableCompanion({ this.id = const Value.absent(), this.compoundName = const Value.absent(), this.doseMg = const Value.absent(), this.scheduledTime = const Value.absent(), this.administeredTime = const Value.absent(), this.injectionSite = const Value.absent(), this.notes = const Value.absent(), }); MedicationDosesTableCompanion.insert({ this.id = const Value.absent(), required String compoundName, required double doseMg, required DateTime scheduledTime, this.administeredTime = const Value.absent(), this.injectionSite = const Value.absent(), this.notes = const Value.absent(), }) : compoundName = Value(compoundName), doseMg = Value(doseMg), scheduledTime = Value(scheduledTime); static Insertable custom({ Expression? id, Expression? compoundName, Expression? doseMg, Expression? scheduledTime, Expression? administeredTime, Expression? injectionSite, Expression? notes, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (compoundName != null) 'compound_name': compoundName, if (doseMg != null) 'dose_mg': doseMg, if (scheduledTime != null) 'scheduled_time': scheduledTime, if (administeredTime != null) 'administered_time': administeredTime, if (injectionSite != null) 'injection_site': injectionSite, if (notes != null) 'notes': notes, }); } MedicationDosesTableCompanion copyWith( {Value? id, Value? compoundName, Value? doseMg, Value? scheduledTime, Value? administeredTime, Value? injectionSite, Value? notes}) { return MedicationDosesTableCompanion( id: id ?? this.id, compoundName: compoundName ?? this.compoundName, doseMg: doseMg ?? this.doseMg, scheduledTime: scheduledTime ?? this.scheduledTime, administeredTime: administeredTime ?? this.administeredTime, injectionSite: injectionSite ?? this.injectionSite, notes: notes ?? this.notes, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (compoundName.present) { map['compound_name'] = Variable(compoundName.value); } if (doseMg.present) { map['dose_mg'] = Variable(doseMg.value); } if (scheduledTime.present) { map['scheduled_time'] = Variable(scheduledTime.value); } if (administeredTime.present) { map['administered_time'] = Variable(administeredTime.value); } if (injectionSite.present) { map['injection_site'] = Variable(injectionSite.value); } if (notes.present) { map['notes'] = Variable(notes.value); } return map; } @override String toString() { return (StringBuffer('MedicationDosesTableCompanion(') ..write('id: $id, ') ..write('compoundName: $compoundName, ') ..write('doseMg: $doseMg, ') ..write('scheduledTime: $scheduledTime, ') ..write('administeredTime: $administeredTime, ') ..write('injectionSite: $injectionSite, ') ..write('notes: $notes') ..write(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $MedicationDosesTableTable medicationDosesTable = $MedicationDosesTableTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [medicationDosesTable]; } typedef $$MedicationDosesTableTableCreateCompanionBuilder = MedicationDosesTableCompanion Function({ Value id, required String compoundName, required double doseMg, required DateTime scheduledTime, Value administeredTime, Value injectionSite, Value notes, }); typedef $$MedicationDosesTableTableUpdateCompanionBuilder = MedicationDosesTableCompanion Function({ Value id, Value compoundName, Value doseMg, Value scheduledTime, Value administeredTime, Value injectionSite, Value notes, }); class $$MedicationDosesTableTableFilterComposer extends Composer<_$AppDatabase, $MedicationDosesTableTable> { $$MedicationDosesTableTableFilterComposer({ 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 compoundName => $composableBuilder( column: $table.compoundName, builder: (column) => ColumnFilters(column)); ColumnFilters get doseMg => $composableBuilder( column: $table.doseMg, builder: (column) => ColumnFilters(column)); ColumnFilters get scheduledTime => $composableBuilder( column: $table.scheduledTime, builder: (column) => ColumnFilters(column)); ColumnFilters get administeredTime => $composableBuilder( column: $table.administeredTime, builder: (column) => ColumnFilters(column)); ColumnFilters get injectionSite => $composableBuilder( column: $table.injectionSite, builder: (column) => ColumnFilters(column)); ColumnFilters get notes => $composableBuilder( column: $table.notes, builder: (column) => ColumnFilters(column)); } class $$MedicationDosesTableTableOrderingComposer extends Composer<_$AppDatabase, $MedicationDosesTableTable> { $$MedicationDosesTableTableOrderingComposer({ 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 compoundName => $composableBuilder( column: $table.compoundName, builder: (column) => ColumnOrderings(column)); ColumnOrderings get doseMg => $composableBuilder( column: $table.doseMg, builder: (column) => ColumnOrderings(column)); ColumnOrderings get scheduledTime => $composableBuilder( column: $table.scheduledTime, builder: (column) => ColumnOrderings(column)); ColumnOrderings get administeredTime => $composableBuilder( column: $table.administeredTime, builder: (column) => ColumnOrderings(column)); ColumnOrderings get injectionSite => $composableBuilder( column: $table.injectionSite, builder: (column) => ColumnOrderings(column)); ColumnOrderings get notes => $composableBuilder( column: $table.notes, builder: (column) => ColumnOrderings(column)); } class $$MedicationDosesTableTableAnnotationComposer extends Composer<_$AppDatabase, $MedicationDosesTableTable> { $$MedicationDosesTableTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get compoundName => $composableBuilder( column: $table.compoundName, builder: (column) => column); GeneratedColumn get doseMg => $composableBuilder(column: $table.doseMg, builder: (column) => column); GeneratedColumn get scheduledTime => $composableBuilder( column: $table.scheduledTime, builder: (column) => column); GeneratedColumn get administeredTime => $composableBuilder( column: $table.administeredTime, builder: (column) => column); GeneratedColumn get injectionSite => $composableBuilder( column: $table.injectionSite, builder: (column) => column); GeneratedColumn get notes => $composableBuilder(column: $table.notes, builder: (column) => column); } class $$MedicationDosesTableTableTableManager extends RootTableManager< _$AppDatabase, $MedicationDosesTableTable, MedicationDoseRecord, $$MedicationDosesTableTableFilterComposer, $$MedicationDosesTableTableOrderingComposer, $$MedicationDosesTableTableAnnotationComposer, $$MedicationDosesTableTableCreateCompanionBuilder, $$MedicationDosesTableTableUpdateCompanionBuilder, ( MedicationDoseRecord, BaseReferences<_$AppDatabase, $MedicationDosesTableTable, MedicationDoseRecord> ), MedicationDoseRecord, PrefetchHooks Function()> { $$MedicationDosesTableTableTableManager( _$AppDatabase db, $MedicationDosesTableTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$MedicationDosesTableTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$MedicationDosesTableTableOrderingComposer( $db: db, $table: table), createComputedFieldComposer: () => $$MedicationDosesTableTableAnnotationComposer( $db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value compoundName = const Value.absent(), Value doseMg = const Value.absent(), Value scheduledTime = const Value.absent(), Value administeredTime = const Value.absent(), Value injectionSite = const Value.absent(), Value notes = const Value.absent(), }) => MedicationDosesTableCompanion( id: id, compoundName: compoundName, doseMg: doseMg, scheduledTime: scheduledTime, administeredTime: administeredTime, injectionSite: injectionSite, notes: notes, ), createCompanionCallback: ({ Value id = const Value.absent(), required String compoundName, required double doseMg, required DateTime scheduledTime, Value administeredTime = const Value.absent(), Value injectionSite = const Value.absent(), Value notes = const Value.absent(), }) => MedicationDosesTableCompanion.insert( id: id, compoundName: compoundName, doseMg: doseMg, scheduledTime: scheduledTime, administeredTime: administeredTime, injectionSite: injectionSite, notes: notes, ), withReferenceMapper: (p0) => p0 .map((e) => ( e.readTable<$MedicationDosesTableTable, MedicationDoseRecord>(table), BaseReferences<_$AppDatabase, $MedicationDosesTableTable, MedicationDoseRecord>(db, table, e) )) .toList(), prefetchHooksCallback: null, )); } typedef $$MedicationDosesTableTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $MedicationDosesTableTable, MedicationDoseRecord, $$MedicationDosesTableTableFilterComposer, $$MedicationDosesTableTableOrderingComposer, $$MedicationDosesTableTableAnnotationComposer, $$MedicationDosesTableTableCreateCompanionBuilder, $$MedicationDosesTableTableUpdateCompanionBuilder, ( MedicationDoseRecord, BaseReferences<_$AppDatabase, $MedicationDosesTableTable, MedicationDoseRecord> ), MedicationDoseRecord, PrefetchHooks Function()>; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$MedicationDosesTableTableTableManager get medicationDosesTable => $$MedicationDosesTableTableTableManager(_db, _db.medicationDosesTable); }