2208 lines
80 KiB
Dart
2208 lines
80 KiB
Dart
// 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<int> id = GeneratedColumn<int>(
|
|
'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<String> compoundName = GeneratedColumn<String>(
|
|
'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<double> doseMg = GeneratedColumn<double>(
|
|
'dose_mg', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _scheduledTimeMeta =
|
|
const VerificationMeta('scheduledTime');
|
|
@override
|
|
late final GeneratedColumn<DateTime> scheduledTime =
|
|
GeneratedColumn<DateTime>('scheduled_time', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
static const VerificationMeta _administeredTimeMeta =
|
|
const VerificationMeta('administeredTime');
|
|
@override
|
|
late final GeneratedColumn<DateTime> administeredTime =
|
|
GeneratedColumn<DateTime>('administered_time', aliasedName, true,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: false);
|
|
static const VerificationMeta _injectionSiteMeta =
|
|
const VerificationMeta('injectionSite');
|
|
@override
|
|
late final GeneratedColumn<String> injectionSite = GeneratedColumn<String>(
|
|
'injection_site', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
@override
|
|
List<GeneratedColumn> 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<MedicationDoseRecord> 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<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
MedicationDoseRecord map(Map<String, dynamic> 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<MedicationDoseRecord> {
|
|
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<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['compound_name'] = Variable<String>(compoundName);
|
|
map['dose_mg'] = Variable<double>(doseMg);
|
|
map['scheduled_time'] = Variable<DateTime>(scheduledTime);
|
|
if (!nullToAbsent || administeredTime != null) {
|
|
map['administered_time'] = Variable<DateTime>(administeredTime);
|
|
}
|
|
if (!nullToAbsent || injectionSite != null) {
|
|
map['injection_site'] = Variable<String>(injectionSite);
|
|
}
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(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<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return MedicationDoseRecord(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
compoundName: serializer.fromJson<String>(json['compoundName']),
|
|
doseMg: serializer.fromJson<double>(json['doseMg']),
|
|
scheduledTime: serializer.fromJson<DateTime>(json['scheduledTime']),
|
|
administeredTime:
|
|
serializer.fromJson<DateTime?>(json['administeredTime']),
|
|
injectionSite: serializer.fromJson<String?>(json['injectionSite']),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'compoundName': serializer.toJson<String>(compoundName),
|
|
'doseMg': serializer.toJson<double>(doseMg),
|
|
'scheduledTime': serializer.toJson<DateTime>(scheduledTime),
|
|
'administeredTime': serializer.toJson<DateTime?>(administeredTime),
|
|
'injectionSite': serializer.toJson<String?>(injectionSite),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
MedicationDoseRecord copyWith(
|
|
{int? id,
|
|
String? compoundName,
|
|
double? doseMg,
|
|
DateTime? scheduledTime,
|
|
Value<DateTime?> administeredTime = const Value.absent(),
|
|
Value<String?> injectionSite = const Value.absent(),
|
|
Value<String?> 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<MedicationDoseRecord> {
|
|
final Value<int> id;
|
|
final Value<String> compoundName;
|
|
final Value<double> doseMg;
|
|
final Value<DateTime> scheduledTime;
|
|
final Value<DateTime?> administeredTime;
|
|
final Value<String?> injectionSite;
|
|
final Value<String?> 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<MedicationDoseRecord> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? compoundName,
|
|
Expression<double>? doseMg,
|
|
Expression<DateTime>? scheduledTime,
|
|
Expression<DateTime>? administeredTime,
|
|
Expression<String>? injectionSite,
|
|
Expression<String>? 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<int>? id,
|
|
Value<String>? compoundName,
|
|
Value<double>? doseMg,
|
|
Value<DateTime>? scheduledTime,
|
|
Value<DateTime?>? administeredTime,
|
|
Value<String?>? injectionSite,
|
|
Value<String?>? 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<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (compoundName.present) {
|
|
map['compound_name'] = Variable<String>(compoundName.value);
|
|
}
|
|
if (doseMg.present) {
|
|
map['dose_mg'] = Variable<double>(doseMg.value);
|
|
}
|
|
if (scheduledTime.present) {
|
|
map['scheduled_time'] = Variable<DateTime>(scheduledTime.value);
|
|
}
|
|
if (administeredTime.present) {
|
|
map['administered_time'] = Variable<DateTime>(administeredTime.value);
|
|
}
|
|
if (injectionSite.present) {
|
|
map['injection_site'] = Variable<String>(injectionSite.value);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(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();
|
|
}
|
|
}
|
|
|
|
class $FoodLogsTableTable extends FoodLogsTable
|
|
with TableInfo<$FoodLogsTableTable, FoodLogRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$FoodLogsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
static const VerificationMeta _timestampMeta =
|
|
const VerificationMeta('timestamp');
|
|
@override
|
|
late final GeneratedColumn<DateTime> timestamp = GeneratedColumn<DateTime>(
|
|
'timestamp', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
static const VerificationMeta _mealTypeMeta =
|
|
const VerificationMeta('mealType');
|
|
@override
|
|
late final GeneratedColumn<String> mealType = GeneratedColumn<String>(
|
|
'meal_type', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _descriptionMeta =
|
|
const VerificationMeta('description');
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 512),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _proteinGramsMeta =
|
|
const VerificationMeta('proteinGrams');
|
|
@override
|
|
late final GeneratedColumn<double> proteinGrams = GeneratedColumn<double>(
|
|
'protein_grams', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _caloriesMeta =
|
|
const VerificationMeta('calories');
|
|
@override
|
|
late final GeneratedColumn<int> calories = GeneratedColumn<int>(
|
|
'calories', aliasedName, false,
|
|
type: DriftSqlType.int, requiredDuringInsert: true);
|
|
static const VerificationMeta _carbsGramsMeta =
|
|
const VerificationMeta('carbsGrams');
|
|
@override
|
|
late final GeneratedColumn<double> carbsGrams = GeneratedColumn<double>(
|
|
'carbs_grams', aliasedName, true,
|
|
type: DriftSqlType.double, requiredDuringInsert: false);
|
|
static const VerificationMeta _fatGramsMeta =
|
|
const VerificationMeta('fatGrams');
|
|
@override
|
|
late final GeneratedColumn<double> fatGrams = GeneratedColumn<double>(
|
|
'fat_grams', aliasedName, true,
|
|
type: DriftSqlType.double, requiredDuringInsert: false);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
timestamp,
|
|
mealType,
|
|
description,
|
|
proteinGrams,
|
|
calories,
|
|
carbsGrams,
|
|
fatGrams
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'food_logs_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<FoodLogRecord> 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('timestamp')) {
|
|
context.handle(_timestampMeta,
|
|
timestamp.isAcceptableOrUnknown(data['timestamp']!, _timestampMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_timestampMeta);
|
|
}
|
|
if (data.containsKey('meal_type')) {
|
|
context.handle(_mealTypeMeta,
|
|
mealType.isAcceptableOrUnknown(data['meal_type']!, _mealTypeMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_mealTypeMeta);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!, _descriptionMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_descriptionMeta);
|
|
}
|
|
if (data.containsKey('protein_grams')) {
|
|
context.handle(
|
|
_proteinGramsMeta,
|
|
proteinGrams.isAcceptableOrUnknown(
|
|
data['protein_grams']!, _proteinGramsMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_proteinGramsMeta);
|
|
}
|
|
if (data.containsKey('calories')) {
|
|
context.handle(_caloriesMeta,
|
|
calories.isAcceptableOrUnknown(data['calories']!, _caloriesMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_caloriesMeta);
|
|
}
|
|
if (data.containsKey('carbs_grams')) {
|
|
context.handle(
|
|
_carbsGramsMeta,
|
|
carbsGrams.isAcceptableOrUnknown(
|
|
data['carbs_grams']!, _carbsGramsMeta));
|
|
}
|
|
if (data.containsKey('fat_grams')) {
|
|
context.handle(_fatGramsMeta,
|
|
fatGrams.isAcceptableOrUnknown(data['fat_grams']!, _fatGramsMeta));
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
FoodLogRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return FoodLogRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
timestamp: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}timestamp'])!,
|
|
mealType: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}meal_type'])!,
|
|
description: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}description'])!,
|
|
proteinGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}protein_grams'])!,
|
|
calories: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}calories'])!,
|
|
carbsGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}carbs_grams']),
|
|
fatGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}fat_grams']),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$FoodLogsTableTable createAlias(String alias) {
|
|
return $FoodLogsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class FoodLogRecord extends DataClass implements Insertable<FoodLogRecord> {
|
|
final int id;
|
|
|
|
/// When the food was consumed.
|
|
final DateTime timestamp;
|
|
|
|
/// Meal slot identifier (e.g. `breakfast`).
|
|
final String mealType;
|
|
|
|
/// Free-text description of the meal.
|
|
final String description;
|
|
|
|
/// Protein content in grams (lean-mass tracking metric).
|
|
final double proteinGrams;
|
|
|
|
/// Energy content in kilocalories.
|
|
final int calories;
|
|
|
|
/// Carbohydrate content in grams; optional.
|
|
final double? carbsGrams;
|
|
|
|
/// Fat content in grams; optional.
|
|
final double? fatGrams;
|
|
const FoodLogRecord(
|
|
{required this.id,
|
|
required this.timestamp,
|
|
required this.mealType,
|
|
required this.description,
|
|
required this.proteinGrams,
|
|
required this.calories,
|
|
this.carbsGrams,
|
|
this.fatGrams});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['timestamp'] = Variable<DateTime>(timestamp);
|
|
map['meal_type'] = Variable<String>(mealType);
|
|
map['description'] = Variable<String>(description);
|
|
map['protein_grams'] = Variable<double>(proteinGrams);
|
|
map['calories'] = Variable<int>(calories);
|
|
if (!nullToAbsent || carbsGrams != null) {
|
|
map['carbs_grams'] = Variable<double>(carbsGrams);
|
|
}
|
|
if (!nullToAbsent || fatGrams != null) {
|
|
map['fat_grams'] = Variable<double>(fatGrams);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
FoodLogsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return FoodLogsTableCompanion(
|
|
id: Value(id),
|
|
timestamp: Value(timestamp),
|
|
mealType: Value(mealType),
|
|
description: Value(description),
|
|
proteinGrams: Value(proteinGrams),
|
|
calories: Value(calories),
|
|
carbsGrams: carbsGrams == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(carbsGrams),
|
|
fatGrams: fatGrams == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(fatGrams),
|
|
);
|
|
}
|
|
|
|
factory FoodLogRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return FoodLogRecord(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
timestamp: serializer.fromJson<DateTime>(json['timestamp']),
|
|
mealType: serializer.fromJson<String>(json['mealType']),
|
|
description: serializer.fromJson<String>(json['description']),
|
|
proteinGrams: serializer.fromJson<double>(json['proteinGrams']),
|
|
calories: serializer.fromJson<int>(json['calories']),
|
|
carbsGrams: serializer.fromJson<double?>(json['carbsGrams']),
|
|
fatGrams: serializer.fromJson<double?>(json['fatGrams']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'timestamp': serializer.toJson<DateTime>(timestamp),
|
|
'mealType': serializer.toJson<String>(mealType),
|
|
'description': serializer.toJson<String>(description),
|
|
'proteinGrams': serializer.toJson<double>(proteinGrams),
|
|
'calories': serializer.toJson<int>(calories),
|
|
'carbsGrams': serializer.toJson<double?>(carbsGrams),
|
|
'fatGrams': serializer.toJson<double?>(fatGrams),
|
|
};
|
|
}
|
|
|
|
FoodLogRecord copyWith(
|
|
{int? id,
|
|
DateTime? timestamp,
|
|
String? mealType,
|
|
String? description,
|
|
double? proteinGrams,
|
|
int? calories,
|
|
Value<double?> carbsGrams = const Value.absent(),
|
|
Value<double?> fatGrams = const Value.absent()}) =>
|
|
FoodLogRecord(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
mealType: mealType ?? this.mealType,
|
|
description: description ?? this.description,
|
|
proteinGrams: proteinGrams ?? this.proteinGrams,
|
|
calories: calories ?? this.calories,
|
|
carbsGrams: carbsGrams.present ? carbsGrams.value : this.carbsGrams,
|
|
fatGrams: fatGrams.present ? fatGrams.value : this.fatGrams,
|
|
);
|
|
FoodLogRecord copyWithCompanion(FoodLogsTableCompanion data) {
|
|
return FoodLogRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp,
|
|
mealType: data.mealType.present ? data.mealType.value : this.mealType,
|
|
description:
|
|
data.description.present ? data.description.value : this.description,
|
|
proteinGrams: data.proteinGrams.present
|
|
? data.proteinGrams.value
|
|
: this.proteinGrams,
|
|
calories: data.calories.present ? data.calories.value : this.calories,
|
|
carbsGrams:
|
|
data.carbsGrams.present ? data.carbsGrams.value : this.carbsGrams,
|
|
fatGrams: data.fatGrams.present ? data.fatGrams.value : this.fatGrams,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FoodLogRecord(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('mealType: $mealType, ')
|
|
..write('description: $description, ')
|
|
..write('proteinGrams: $proteinGrams, ')
|
|
..write('calories: $calories, ')
|
|
..write('carbsGrams: $carbsGrams, ')
|
|
..write('fatGrams: $fatGrams')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, timestamp, mealType, description,
|
|
proteinGrams, calories, carbsGrams, fatGrams);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is FoodLogRecord &&
|
|
other.id == this.id &&
|
|
other.timestamp == this.timestamp &&
|
|
other.mealType == this.mealType &&
|
|
other.description == this.description &&
|
|
other.proteinGrams == this.proteinGrams &&
|
|
other.calories == this.calories &&
|
|
other.carbsGrams == this.carbsGrams &&
|
|
other.fatGrams == this.fatGrams);
|
|
}
|
|
|
|
class FoodLogsTableCompanion extends UpdateCompanion<FoodLogRecord> {
|
|
final Value<int> id;
|
|
final Value<DateTime> timestamp;
|
|
final Value<String> mealType;
|
|
final Value<String> description;
|
|
final Value<double> proteinGrams;
|
|
final Value<int> calories;
|
|
final Value<double?> carbsGrams;
|
|
final Value<double?> fatGrams;
|
|
const FoodLogsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.timestamp = const Value.absent(),
|
|
this.mealType = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.proteinGrams = const Value.absent(),
|
|
this.calories = const Value.absent(),
|
|
this.carbsGrams = const Value.absent(),
|
|
this.fatGrams = const Value.absent(),
|
|
});
|
|
FoodLogsTableCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required String mealType,
|
|
required String description,
|
|
required double proteinGrams,
|
|
required int calories,
|
|
this.carbsGrams = const Value.absent(),
|
|
this.fatGrams = const Value.absent(),
|
|
}) : timestamp = Value(timestamp),
|
|
mealType = Value(mealType),
|
|
description = Value(description),
|
|
proteinGrams = Value(proteinGrams),
|
|
calories = Value(calories);
|
|
static Insertable<FoodLogRecord> custom({
|
|
Expression<int>? id,
|
|
Expression<DateTime>? timestamp,
|
|
Expression<String>? mealType,
|
|
Expression<String>? description,
|
|
Expression<double>? proteinGrams,
|
|
Expression<int>? calories,
|
|
Expression<double>? carbsGrams,
|
|
Expression<double>? fatGrams,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (timestamp != null) 'timestamp': timestamp,
|
|
if (mealType != null) 'meal_type': mealType,
|
|
if (description != null) 'description': description,
|
|
if (proteinGrams != null) 'protein_grams': proteinGrams,
|
|
if (calories != null) 'calories': calories,
|
|
if (carbsGrams != null) 'carbs_grams': carbsGrams,
|
|
if (fatGrams != null) 'fat_grams': fatGrams,
|
|
});
|
|
}
|
|
|
|
FoodLogsTableCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<DateTime>? timestamp,
|
|
Value<String>? mealType,
|
|
Value<String>? description,
|
|
Value<double>? proteinGrams,
|
|
Value<int>? calories,
|
|
Value<double?>? carbsGrams,
|
|
Value<double?>? fatGrams}) {
|
|
return FoodLogsTableCompanion(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
mealType: mealType ?? this.mealType,
|
|
description: description ?? this.description,
|
|
proteinGrams: proteinGrams ?? this.proteinGrams,
|
|
calories: calories ?? this.calories,
|
|
carbsGrams: carbsGrams ?? this.carbsGrams,
|
|
fatGrams: fatGrams ?? this.fatGrams,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (timestamp.present) {
|
|
map['timestamp'] = Variable<DateTime>(timestamp.value);
|
|
}
|
|
if (mealType.present) {
|
|
map['meal_type'] = Variable<String>(mealType.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (proteinGrams.present) {
|
|
map['protein_grams'] = Variable<double>(proteinGrams.value);
|
|
}
|
|
if (calories.present) {
|
|
map['calories'] = Variable<int>(calories.value);
|
|
}
|
|
if (carbsGrams.present) {
|
|
map['carbs_grams'] = Variable<double>(carbsGrams.value);
|
|
}
|
|
if (fatGrams.present) {
|
|
map['fat_grams'] = Variable<double>(fatGrams.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FoodLogsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('mealType: $mealType, ')
|
|
..write('description: $description, ')
|
|
..write('proteinGrams: $proteinGrams, ')
|
|
..write('calories: $calories, ')
|
|
..write('carbsGrams: $carbsGrams, ')
|
|
..write('fatGrams: $fatGrams')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $HydrationLogsTableTable extends HydrationLogsTable
|
|
with TableInfo<$HydrationLogsTableTable, HydrationLogRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$HydrationLogsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
static const VerificationMeta _timestampMeta =
|
|
const VerificationMeta('timestamp');
|
|
@override
|
|
late final GeneratedColumn<DateTime> timestamp = GeneratedColumn<DateTime>(
|
|
'timestamp', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
static const VerificationMeta _volumeOzMeta =
|
|
const VerificationMeta('volumeOz');
|
|
@override
|
|
late final GeneratedColumn<double> volumeOz = GeneratedColumn<double>(
|
|
'volume_oz', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, timestamp, volumeOz];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'hydration_logs_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<HydrationLogRecord> 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('timestamp')) {
|
|
context.handle(_timestampMeta,
|
|
timestamp.isAcceptableOrUnknown(data['timestamp']!, _timestampMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_timestampMeta);
|
|
}
|
|
if (data.containsKey('volume_oz')) {
|
|
context.handle(_volumeOzMeta,
|
|
volumeOz.isAcceptableOrUnknown(data['volume_oz']!, _volumeOzMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_volumeOzMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
HydrationLogRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return HydrationLogRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
timestamp: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}timestamp'])!,
|
|
volumeOz: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}volume_oz'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$HydrationLogsTableTable createAlias(String alias) {
|
|
return $HydrationLogsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class HydrationLogRecord extends DataClass
|
|
implements Insertable<HydrationLogRecord> {
|
|
final int id;
|
|
|
|
/// When the fluid was consumed.
|
|
final DateTime timestamp;
|
|
|
|
/// Consumed volume in fluid ounces.
|
|
final double volumeOz;
|
|
const HydrationLogRecord(
|
|
{required this.id, required this.timestamp, required this.volumeOz});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['timestamp'] = Variable<DateTime>(timestamp);
|
|
map['volume_oz'] = Variable<double>(volumeOz);
|
|
return map;
|
|
}
|
|
|
|
HydrationLogsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return HydrationLogsTableCompanion(
|
|
id: Value(id),
|
|
timestamp: Value(timestamp),
|
|
volumeOz: Value(volumeOz),
|
|
);
|
|
}
|
|
|
|
factory HydrationLogRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return HydrationLogRecord(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
timestamp: serializer.fromJson<DateTime>(json['timestamp']),
|
|
volumeOz: serializer.fromJson<double>(json['volumeOz']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'timestamp': serializer.toJson<DateTime>(timestamp),
|
|
'volumeOz': serializer.toJson<double>(volumeOz),
|
|
};
|
|
}
|
|
|
|
HydrationLogRecord copyWith(
|
|
{int? id, DateTime? timestamp, double? volumeOz}) =>
|
|
HydrationLogRecord(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
volumeOz: volumeOz ?? this.volumeOz,
|
|
);
|
|
HydrationLogRecord copyWithCompanion(HydrationLogsTableCompanion data) {
|
|
return HydrationLogRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp,
|
|
volumeOz: data.volumeOz.present ? data.volumeOz.value : this.volumeOz,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('HydrationLogRecord(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('volumeOz: $volumeOz')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, timestamp, volumeOz);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is HydrationLogRecord &&
|
|
other.id == this.id &&
|
|
other.timestamp == this.timestamp &&
|
|
other.volumeOz == this.volumeOz);
|
|
}
|
|
|
|
class HydrationLogsTableCompanion extends UpdateCompanion<HydrationLogRecord> {
|
|
final Value<int> id;
|
|
final Value<DateTime> timestamp;
|
|
final Value<double> volumeOz;
|
|
const HydrationLogsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.timestamp = const Value.absent(),
|
|
this.volumeOz = const Value.absent(),
|
|
});
|
|
HydrationLogsTableCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required double volumeOz,
|
|
}) : timestamp = Value(timestamp),
|
|
volumeOz = Value(volumeOz);
|
|
static Insertable<HydrationLogRecord> custom({
|
|
Expression<int>? id,
|
|
Expression<DateTime>? timestamp,
|
|
Expression<double>? volumeOz,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (timestamp != null) 'timestamp': timestamp,
|
|
if (volumeOz != null) 'volume_oz': volumeOz,
|
|
});
|
|
}
|
|
|
|
HydrationLogsTableCompanion copyWith(
|
|
{Value<int>? id, Value<DateTime>? timestamp, Value<double>? volumeOz}) {
|
|
return HydrationLogsTableCompanion(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
volumeOz: volumeOz ?? this.volumeOz,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (timestamp.present) {
|
|
map['timestamp'] = Variable<DateTime>(timestamp.value);
|
|
}
|
|
if (volumeOz.present) {
|
|
map['volume_oz'] = Variable<double>(volumeOz.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('HydrationLogsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('volumeOz: $volumeOz')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $BiometricLogsTableTable extends BiometricLogsTable
|
|
with TableInfo<$BiometricLogsTableTable, BiometricLogRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$BiometricLogsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id', aliasedName, false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
|
static const VerificationMeta _timestampMeta =
|
|
const VerificationMeta('timestamp');
|
|
@override
|
|
late final GeneratedColumn<DateTime> timestamp = GeneratedColumn<DateTime>(
|
|
'timestamp', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
static const VerificationMeta _weightLbsMeta =
|
|
const VerificationMeta('weightLbs');
|
|
@override
|
|
late final GeneratedColumn<double> weightLbs = GeneratedColumn<double>(
|
|
'weight_lbs', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _activeCaloriesBurnedMeta =
|
|
const VerificationMeta('activeCaloriesBurned');
|
|
@override
|
|
late final GeneratedColumn<double> activeCaloriesBurned =
|
|
GeneratedColumn<double>('active_calories_burned', aliasedName, true,
|
|
type: DriftSqlType.double, requiredDuringInsert: false);
|
|
static const VerificationMeta _sourceMeta = const VerificationMeta('source');
|
|
@override
|
|
late final GeneratedColumn<String> source = GeneratedColumn<String>(
|
|
'source', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, timestamp, weightLbs, activeCaloriesBurned, source];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'biometric_logs_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<BiometricLogRecord> 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('timestamp')) {
|
|
context.handle(_timestampMeta,
|
|
timestamp.isAcceptableOrUnknown(data['timestamp']!, _timestampMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_timestampMeta);
|
|
}
|
|
if (data.containsKey('weight_lbs')) {
|
|
context.handle(_weightLbsMeta,
|
|
weightLbs.isAcceptableOrUnknown(data['weight_lbs']!, _weightLbsMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_weightLbsMeta);
|
|
}
|
|
if (data.containsKey('active_calories_burned')) {
|
|
context.handle(
|
|
_activeCaloriesBurnedMeta,
|
|
activeCaloriesBurned.isAcceptableOrUnknown(
|
|
data['active_calories_burned']!, _activeCaloriesBurnedMeta));
|
|
}
|
|
if (data.containsKey('source')) {
|
|
context.handle(_sourceMeta,
|
|
source.isAcceptableOrUnknown(data['source']!, _sourceMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_sourceMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
BiometricLogRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return BiometricLogRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
timestamp: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}timestamp'])!,
|
|
weightLbs: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}weight_lbs'])!,
|
|
activeCaloriesBurned: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}active_calories_burned']),
|
|
source: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}source'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$BiometricLogsTableTable createAlias(String alias) {
|
|
return $BiometricLogsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class BiometricLogRecord extends DataClass
|
|
implements Insertable<BiometricLogRecord> {
|
|
final int id;
|
|
|
|
/// When the sample was recorded.
|
|
final DateTime timestamp;
|
|
|
|
/// Body weight in pounds.
|
|
final double weightLbs;
|
|
|
|
/// Active energy burned (kcal); `null` for weight-only samples.
|
|
final double? activeCaloriesBurned;
|
|
|
|
/// Origin identifier (e.g. `appleHealth`, `manual`).
|
|
final String source;
|
|
const BiometricLogRecord(
|
|
{required this.id,
|
|
required this.timestamp,
|
|
required this.weightLbs,
|
|
this.activeCaloriesBurned,
|
|
required this.source});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['timestamp'] = Variable<DateTime>(timestamp);
|
|
map['weight_lbs'] = Variable<double>(weightLbs);
|
|
if (!nullToAbsent || activeCaloriesBurned != null) {
|
|
map['active_calories_burned'] = Variable<double>(activeCaloriesBurned);
|
|
}
|
|
map['source'] = Variable<String>(source);
|
|
return map;
|
|
}
|
|
|
|
BiometricLogsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return BiometricLogsTableCompanion(
|
|
id: Value(id),
|
|
timestamp: Value(timestamp),
|
|
weightLbs: Value(weightLbs),
|
|
activeCaloriesBurned: activeCaloriesBurned == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(activeCaloriesBurned),
|
|
source: Value(source),
|
|
);
|
|
}
|
|
|
|
factory BiometricLogRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return BiometricLogRecord(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
timestamp: serializer.fromJson<DateTime>(json['timestamp']),
|
|
weightLbs: serializer.fromJson<double>(json['weightLbs']),
|
|
activeCaloriesBurned:
|
|
serializer.fromJson<double?>(json['activeCaloriesBurned']),
|
|
source: serializer.fromJson<String>(json['source']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'timestamp': serializer.toJson<DateTime>(timestamp),
|
|
'weightLbs': serializer.toJson<double>(weightLbs),
|
|
'activeCaloriesBurned': serializer.toJson<double?>(activeCaloriesBurned),
|
|
'source': serializer.toJson<String>(source),
|
|
};
|
|
}
|
|
|
|
BiometricLogRecord copyWith(
|
|
{int? id,
|
|
DateTime? timestamp,
|
|
double? weightLbs,
|
|
Value<double?> activeCaloriesBurned = const Value.absent(),
|
|
String? source}) =>
|
|
BiometricLogRecord(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
weightLbs: weightLbs ?? this.weightLbs,
|
|
activeCaloriesBurned: activeCaloriesBurned.present
|
|
? activeCaloriesBurned.value
|
|
: this.activeCaloriesBurned,
|
|
source: source ?? this.source,
|
|
);
|
|
BiometricLogRecord copyWithCompanion(BiometricLogsTableCompanion data) {
|
|
return BiometricLogRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp,
|
|
weightLbs: data.weightLbs.present ? data.weightLbs.value : this.weightLbs,
|
|
activeCaloriesBurned: data.activeCaloriesBurned.present
|
|
? data.activeCaloriesBurned.value
|
|
: this.activeCaloriesBurned,
|
|
source: data.source.present ? data.source.value : this.source,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BiometricLogRecord(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('weightLbs: $weightLbs, ')
|
|
..write('activeCaloriesBurned: $activeCaloriesBurned, ')
|
|
..write('source: $source')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, timestamp, weightLbs, activeCaloriesBurned, source);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is BiometricLogRecord &&
|
|
other.id == this.id &&
|
|
other.timestamp == this.timestamp &&
|
|
other.weightLbs == this.weightLbs &&
|
|
other.activeCaloriesBurned == this.activeCaloriesBurned &&
|
|
other.source == this.source);
|
|
}
|
|
|
|
class BiometricLogsTableCompanion extends UpdateCompanion<BiometricLogRecord> {
|
|
final Value<int> id;
|
|
final Value<DateTime> timestamp;
|
|
final Value<double> weightLbs;
|
|
final Value<double?> activeCaloriesBurned;
|
|
final Value<String> source;
|
|
const BiometricLogsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.timestamp = const Value.absent(),
|
|
this.weightLbs = const Value.absent(),
|
|
this.activeCaloriesBurned = const Value.absent(),
|
|
this.source = const Value.absent(),
|
|
});
|
|
BiometricLogsTableCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required double weightLbs,
|
|
this.activeCaloriesBurned = const Value.absent(),
|
|
required String source,
|
|
}) : timestamp = Value(timestamp),
|
|
weightLbs = Value(weightLbs),
|
|
source = Value(source);
|
|
static Insertable<BiometricLogRecord> custom({
|
|
Expression<int>? id,
|
|
Expression<DateTime>? timestamp,
|
|
Expression<double>? weightLbs,
|
|
Expression<double>? activeCaloriesBurned,
|
|
Expression<String>? source,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (timestamp != null) 'timestamp': timestamp,
|
|
if (weightLbs != null) 'weight_lbs': weightLbs,
|
|
if (activeCaloriesBurned != null)
|
|
'active_calories_burned': activeCaloriesBurned,
|
|
if (source != null) 'source': source,
|
|
});
|
|
}
|
|
|
|
BiometricLogsTableCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<DateTime>? timestamp,
|
|
Value<double>? weightLbs,
|
|
Value<double?>? activeCaloriesBurned,
|
|
Value<String>? source}) {
|
|
return BiometricLogsTableCompanion(
|
|
id: id ?? this.id,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
weightLbs: weightLbs ?? this.weightLbs,
|
|
activeCaloriesBurned: activeCaloriesBurned ?? this.activeCaloriesBurned,
|
|
source: source ?? this.source,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (timestamp.present) {
|
|
map['timestamp'] = Variable<DateTime>(timestamp.value);
|
|
}
|
|
if (weightLbs.present) {
|
|
map['weight_lbs'] = Variable<double>(weightLbs.value);
|
|
}
|
|
if (activeCaloriesBurned.present) {
|
|
map['active_calories_burned'] =
|
|
Variable<double>(activeCaloriesBurned.value);
|
|
}
|
|
if (source.present) {
|
|
map['source'] = Variable<String>(source.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BiometricLogsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('timestamp: $timestamp, ')
|
|
..write('weightLbs: $weightLbs, ')
|
|
..write('activeCaloriesBurned: $activeCaloriesBurned, ')
|
|
..write('source: $source')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $MedicationDosesTableTable medicationDosesTable =
|
|
$MedicationDosesTableTable(this);
|
|
late final $FoodLogsTableTable foodLogsTable = $FoodLogsTableTable(this);
|
|
late final $HydrationLogsTableTable hydrationLogsTable =
|
|
$HydrationLogsTableTable(this);
|
|
late final $BiometricLogsTableTable biometricLogsTable =
|
|
$BiometricLogsTableTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
medicationDosesTable,
|
|
foodLogsTable,
|
|
hydrationLogsTable,
|
|
biometricLogsTable
|
|
];
|
|
}
|
|
|
|
typedef $$MedicationDosesTableTableCreateCompanionBuilder
|
|
= MedicationDosesTableCompanion Function({
|
|
Value<int> id,
|
|
required String compoundName,
|
|
required double doseMg,
|
|
required DateTime scheduledTime,
|
|
Value<DateTime?> administeredTime,
|
|
Value<String?> injectionSite,
|
|
Value<String?> notes,
|
|
});
|
|
typedef $$MedicationDosesTableTableUpdateCompanionBuilder
|
|
= MedicationDosesTableCompanion Function({
|
|
Value<int> id,
|
|
Value<String> compoundName,
|
|
Value<double> doseMg,
|
|
Value<DateTime> scheduledTime,
|
|
Value<DateTime?> administeredTime,
|
|
Value<String?> injectionSite,
|
|
Value<String?> notes,
|
|
});
|
|
|
|
class $$MedicationDosesTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MedicationDosesTableTable> {
|
|
$$MedicationDosesTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get compoundName => $composableBuilder(
|
|
column: $table.compoundName, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get doseMg => $composableBuilder(
|
|
column: $table.doseMg, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get scheduledTime => $composableBuilder(
|
|
column: $table.scheduledTime, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get administeredTime => $composableBuilder(
|
|
column: $table.administeredTime,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get injectionSite => $composableBuilder(
|
|
column: $table.injectionSite, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> 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<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get compoundName => $composableBuilder(
|
|
column: $table.compoundName,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get doseMg => $composableBuilder(
|
|
column: $table.doseMg, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get scheduledTime => $composableBuilder(
|
|
column: $table.scheduledTime,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get administeredTime => $composableBuilder(
|
|
column: $table.administeredTime,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get injectionSite => $composableBuilder(
|
|
column: $table.injectionSite,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> 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<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get compoundName => $composableBuilder(
|
|
column: $table.compoundName, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get doseMg =>
|
|
$composableBuilder(column: $table.doseMg, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get scheduledTime => $composableBuilder(
|
|
column: $table.scheduledTime, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get administeredTime => $composableBuilder(
|
|
column: $table.administeredTime, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get injectionSite => $composableBuilder(
|
|
column: $table.injectionSite, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> 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<int> id = const Value.absent(),
|
|
Value<String> compoundName = const Value.absent(),
|
|
Value<double> doseMg = const Value.absent(),
|
|
Value<DateTime> scheduledTime = const Value.absent(),
|
|
Value<DateTime?> administeredTime = const Value.absent(),
|
|
Value<String?> injectionSite = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
}) =>
|
|
MedicationDosesTableCompanion(
|
|
id: id,
|
|
compoundName: compoundName,
|
|
doseMg: doseMg,
|
|
scheduledTime: scheduledTime,
|
|
administeredTime: administeredTime,
|
|
injectionSite: injectionSite,
|
|
notes: notes,
|
|
),
|
|
createCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
required String compoundName,
|
|
required double doseMg,
|
|
required DateTime scheduledTime,
|
|
Value<DateTime?> administeredTime = const Value.absent(),
|
|
Value<String?> injectionSite = const Value.absent(),
|
|
Value<String?> 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()>;
|
|
typedef $$FoodLogsTableTableCreateCompanionBuilder = FoodLogsTableCompanion
|
|
Function({
|
|
Value<int> id,
|
|
required DateTime timestamp,
|
|
required String mealType,
|
|
required String description,
|
|
required double proteinGrams,
|
|
required int calories,
|
|
Value<double?> carbsGrams,
|
|
Value<double?> fatGrams,
|
|
});
|
|
typedef $$FoodLogsTableTableUpdateCompanionBuilder = FoodLogsTableCompanion
|
|
Function({
|
|
Value<int> id,
|
|
Value<DateTime> timestamp,
|
|
Value<String> mealType,
|
|
Value<String> description,
|
|
Value<double> proteinGrams,
|
|
Value<int> calories,
|
|
Value<double?> carbsGrams,
|
|
Value<double?> fatGrams,
|
|
});
|
|
|
|
class $$FoodLogsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $FoodLogsTableTable> {
|
|
$$FoodLogsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get mealType => $composableBuilder(
|
|
column: $table.mealType, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<int> get calories => $composableBuilder(
|
|
column: $table.calories, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get carbsGrams => $composableBuilder(
|
|
column: $table.carbsGrams, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get fatGrams => $composableBuilder(
|
|
column: $table.fatGrams, builder: (column) => ColumnFilters(column));
|
|
}
|
|
|
|
class $$FoodLogsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $FoodLogsTableTable> {
|
|
$$FoodLogsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get mealType => $composableBuilder(
|
|
column: $table.mealType, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<int> get calories => $composableBuilder(
|
|
column: $table.calories, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get carbsGrams => $composableBuilder(
|
|
column: $table.carbsGrams, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get fatGrams => $composableBuilder(
|
|
column: $table.fatGrams, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$FoodLogsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $FoodLogsTableTable> {
|
|
$$FoodLogsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get timestamp =>
|
|
$composableBuilder(column: $table.timestamp, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get mealType =>
|
|
$composableBuilder(column: $table.mealType, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get calories =>
|
|
$composableBuilder(column: $table.calories, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get carbsGrams => $composableBuilder(
|
|
column: $table.carbsGrams, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get fatGrams =>
|
|
$composableBuilder(column: $table.fatGrams, builder: (column) => column);
|
|
}
|
|
|
|
class $$FoodLogsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$FoodLogsTableTable,
|
|
FoodLogRecord,
|
|
$$FoodLogsTableTableFilterComposer,
|
|
$$FoodLogsTableTableOrderingComposer,
|
|
$$FoodLogsTableTableAnnotationComposer,
|
|
$$FoodLogsTableTableCreateCompanionBuilder,
|
|
$$FoodLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
FoodLogRecord,
|
|
BaseReferences<_$AppDatabase, $FoodLogsTableTable, FoodLogRecord>
|
|
),
|
|
FoodLogRecord,
|
|
PrefetchHooks Function()> {
|
|
$$FoodLogsTableTableTableManager(_$AppDatabase db, $FoodLogsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$FoodLogsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$FoodLogsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$FoodLogsTableTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
Value<DateTime> timestamp = const Value.absent(),
|
|
Value<String> mealType = const Value.absent(),
|
|
Value<String> description = const Value.absent(),
|
|
Value<double> proteinGrams = const Value.absent(),
|
|
Value<int> calories = const Value.absent(),
|
|
Value<double?> carbsGrams = const Value.absent(),
|
|
Value<double?> fatGrams = const Value.absent(),
|
|
}) =>
|
|
FoodLogsTableCompanion(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
mealType: mealType,
|
|
description: description,
|
|
proteinGrams: proteinGrams,
|
|
calories: calories,
|
|
carbsGrams: carbsGrams,
|
|
fatGrams: fatGrams,
|
|
),
|
|
createCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required String mealType,
|
|
required String description,
|
|
required double proteinGrams,
|
|
required int calories,
|
|
Value<double?> carbsGrams = const Value.absent(),
|
|
Value<double?> fatGrams = const Value.absent(),
|
|
}) =>
|
|
FoodLogsTableCompanion.insert(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
mealType: mealType,
|
|
description: description,
|
|
proteinGrams: proteinGrams,
|
|
calories: calories,
|
|
carbsGrams: carbsGrams,
|
|
fatGrams: fatGrams,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$FoodLogsTableTable, FoodLogRecord>(table),
|
|
BaseReferences<_$AppDatabase, $FoodLogsTableTable,
|
|
FoodLogRecord>(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
));
|
|
}
|
|
|
|
typedef $$FoodLogsTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$FoodLogsTableTable,
|
|
FoodLogRecord,
|
|
$$FoodLogsTableTableFilterComposer,
|
|
$$FoodLogsTableTableOrderingComposer,
|
|
$$FoodLogsTableTableAnnotationComposer,
|
|
$$FoodLogsTableTableCreateCompanionBuilder,
|
|
$$FoodLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
FoodLogRecord,
|
|
BaseReferences<_$AppDatabase, $FoodLogsTableTable, FoodLogRecord>
|
|
),
|
|
FoodLogRecord,
|
|
PrefetchHooks Function()>;
|
|
typedef $$HydrationLogsTableTableCreateCompanionBuilder
|
|
= HydrationLogsTableCompanion Function({
|
|
Value<int> id,
|
|
required DateTime timestamp,
|
|
required double volumeOz,
|
|
});
|
|
typedef $$HydrationLogsTableTableUpdateCompanionBuilder
|
|
= HydrationLogsTableCompanion Function({
|
|
Value<int> id,
|
|
Value<DateTime> timestamp,
|
|
Value<double> volumeOz,
|
|
});
|
|
|
|
class $$HydrationLogsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $HydrationLogsTableTable> {
|
|
$$HydrationLogsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get volumeOz => $composableBuilder(
|
|
column: $table.volumeOz, builder: (column) => ColumnFilters(column));
|
|
}
|
|
|
|
class $$HydrationLogsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $HydrationLogsTableTable> {
|
|
$$HydrationLogsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get volumeOz => $composableBuilder(
|
|
column: $table.volumeOz, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$HydrationLogsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $HydrationLogsTableTable> {
|
|
$$HydrationLogsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get timestamp =>
|
|
$composableBuilder(column: $table.timestamp, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get volumeOz =>
|
|
$composableBuilder(column: $table.volumeOz, builder: (column) => column);
|
|
}
|
|
|
|
class $$HydrationLogsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$HydrationLogsTableTable,
|
|
HydrationLogRecord,
|
|
$$HydrationLogsTableTableFilterComposer,
|
|
$$HydrationLogsTableTableOrderingComposer,
|
|
$$HydrationLogsTableTableAnnotationComposer,
|
|
$$HydrationLogsTableTableCreateCompanionBuilder,
|
|
$$HydrationLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
HydrationLogRecord,
|
|
BaseReferences<_$AppDatabase, $HydrationLogsTableTable,
|
|
HydrationLogRecord>
|
|
),
|
|
HydrationLogRecord,
|
|
PrefetchHooks Function()> {
|
|
$$HydrationLogsTableTableTableManager(
|
|
_$AppDatabase db, $HydrationLogsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$HydrationLogsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$HydrationLogsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$HydrationLogsTableTableAnnotationComposer(
|
|
$db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
Value<DateTime> timestamp = const Value.absent(),
|
|
Value<double> volumeOz = const Value.absent(),
|
|
}) =>
|
|
HydrationLogsTableCompanion(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
volumeOz: volumeOz,
|
|
),
|
|
createCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required double volumeOz,
|
|
}) =>
|
|
HydrationLogsTableCompanion.insert(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
volumeOz: volumeOz,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$HydrationLogsTableTable, HydrationLogRecord>(
|
|
table),
|
|
BaseReferences<_$AppDatabase, $HydrationLogsTableTable,
|
|
HydrationLogRecord>(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
));
|
|
}
|
|
|
|
typedef $$HydrationLogsTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$HydrationLogsTableTable,
|
|
HydrationLogRecord,
|
|
$$HydrationLogsTableTableFilterComposer,
|
|
$$HydrationLogsTableTableOrderingComposer,
|
|
$$HydrationLogsTableTableAnnotationComposer,
|
|
$$HydrationLogsTableTableCreateCompanionBuilder,
|
|
$$HydrationLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
HydrationLogRecord,
|
|
BaseReferences<_$AppDatabase, $HydrationLogsTableTable,
|
|
HydrationLogRecord>
|
|
),
|
|
HydrationLogRecord,
|
|
PrefetchHooks Function()>;
|
|
typedef $$BiometricLogsTableTableCreateCompanionBuilder
|
|
= BiometricLogsTableCompanion Function({
|
|
Value<int> id,
|
|
required DateTime timestamp,
|
|
required double weightLbs,
|
|
Value<double?> activeCaloriesBurned,
|
|
required String source,
|
|
});
|
|
typedef $$BiometricLogsTableTableUpdateCompanionBuilder
|
|
= BiometricLogsTableCompanion Function({
|
|
Value<int> id,
|
|
Value<DateTime> timestamp,
|
|
Value<double> weightLbs,
|
|
Value<double?> activeCaloriesBurned,
|
|
Value<String> source,
|
|
});
|
|
|
|
class $$BiometricLogsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $BiometricLogsTableTable> {
|
|
$$BiometricLogsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get weightLbs => $composableBuilder(
|
|
column: $table.weightLbs, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get activeCaloriesBurned => $composableBuilder(
|
|
column: $table.activeCaloriesBurned,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get source => $composableBuilder(
|
|
column: $table.source, builder: (column) => ColumnFilters(column));
|
|
}
|
|
|
|
class $$BiometricLogsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $BiometricLogsTableTable> {
|
|
$$BiometricLogsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get timestamp => $composableBuilder(
|
|
column: $table.timestamp, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get weightLbs => $composableBuilder(
|
|
column: $table.weightLbs, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get activeCaloriesBurned => $composableBuilder(
|
|
column: $table.activeCaloriesBurned,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get source => $composableBuilder(
|
|
column: $table.source, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$BiometricLogsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $BiometricLogsTableTable> {
|
|
$$BiometricLogsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get timestamp =>
|
|
$composableBuilder(column: $table.timestamp, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get weightLbs =>
|
|
$composableBuilder(column: $table.weightLbs, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get activeCaloriesBurned => $composableBuilder(
|
|
column: $table.activeCaloriesBurned, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get source =>
|
|
$composableBuilder(column: $table.source, builder: (column) => column);
|
|
}
|
|
|
|
class $$BiometricLogsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$BiometricLogsTableTable,
|
|
BiometricLogRecord,
|
|
$$BiometricLogsTableTableFilterComposer,
|
|
$$BiometricLogsTableTableOrderingComposer,
|
|
$$BiometricLogsTableTableAnnotationComposer,
|
|
$$BiometricLogsTableTableCreateCompanionBuilder,
|
|
$$BiometricLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
BiometricLogRecord,
|
|
BaseReferences<_$AppDatabase, $BiometricLogsTableTable,
|
|
BiometricLogRecord>
|
|
),
|
|
BiometricLogRecord,
|
|
PrefetchHooks Function()> {
|
|
$$BiometricLogsTableTableTableManager(
|
|
_$AppDatabase db, $BiometricLogsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$BiometricLogsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$BiometricLogsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$BiometricLogsTableTableAnnotationComposer(
|
|
$db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
Value<DateTime> timestamp = const Value.absent(),
|
|
Value<double> weightLbs = const Value.absent(),
|
|
Value<double?> activeCaloriesBurned = const Value.absent(),
|
|
Value<String> source = const Value.absent(),
|
|
}) =>
|
|
BiometricLogsTableCompanion(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
weightLbs: weightLbs,
|
|
activeCaloriesBurned: activeCaloriesBurned,
|
|
source: source,
|
|
),
|
|
createCompanionCallback: ({
|
|
Value<int> id = const Value.absent(),
|
|
required DateTime timestamp,
|
|
required double weightLbs,
|
|
Value<double?> activeCaloriesBurned = const Value.absent(),
|
|
required String source,
|
|
}) =>
|
|
BiometricLogsTableCompanion.insert(
|
|
id: id,
|
|
timestamp: timestamp,
|
|
weightLbs: weightLbs,
|
|
activeCaloriesBurned: activeCaloriesBurned,
|
|
source: source,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$BiometricLogsTableTable, BiometricLogRecord>(
|
|
table),
|
|
BaseReferences<_$AppDatabase, $BiometricLogsTableTable,
|
|
BiometricLogRecord>(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
));
|
|
}
|
|
|
|
typedef $$BiometricLogsTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$BiometricLogsTableTable,
|
|
BiometricLogRecord,
|
|
$$BiometricLogsTableTableFilterComposer,
|
|
$$BiometricLogsTableTableOrderingComposer,
|
|
$$BiometricLogsTableTableAnnotationComposer,
|
|
$$BiometricLogsTableTableCreateCompanionBuilder,
|
|
$$BiometricLogsTableTableUpdateCompanionBuilder,
|
|
(
|
|
BiometricLogRecord,
|
|
BaseReferences<_$AppDatabase, $BiometricLogsTableTable,
|
|
BiometricLogRecord>
|
|
),
|
|
BiometricLogRecord,
|
|
PrefetchHooks Function()>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$MedicationDosesTableTableTableManager get medicationDosesTable =>
|
|
$$MedicationDosesTableTableTableManager(_db, _db.medicationDosesTable);
|
|
$$FoodLogsTableTableTableManager get foodLogsTable =>
|
|
$$FoodLogsTableTableTableManager(_db, _db.foodLogsTable);
|
|
$$HydrationLogsTableTableTableManager get hydrationLogsTable =>
|
|
$$HydrationLogsTableTableTableManager(_db, _db.hydrationLogsTable);
|
|
$$BiometricLogsTableTableTableManager get biometricLogsTable =>
|
|
$$BiometricLogsTableTableTableManager(_db, _db.biometricLogsTable);
|
|
}
|