5360 lines
198 KiB
Dart
5360 lines
198 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();
|
|
}
|
|
}
|
|
|
|
class $RecipesTableTable extends RecipesTable
|
|
with TableInfo<$RecipesTableTable, RecipeRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$RecipesTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 256),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _sourceUrlMeta =
|
|
const VerificationMeta('sourceUrl');
|
|
@override
|
|
late final GeneratedColumn<String> sourceUrl = GeneratedColumn<String>(
|
|
'source_url', aliasedName, false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(
|
|
minTextLength: 1, maxTextLength: 1024),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _imageUrlMeta =
|
|
const VerificationMeta('imageUrl');
|
|
@override
|
|
late final GeneratedColumn<String> imageUrl = GeneratedColumn<String>(
|
|
'image_url', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
static const VerificationMeta _descriptionMeta =
|
|
const VerificationMeta('description');
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
static const VerificationMeta _prepTimeMinutesMeta =
|
|
const VerificationMeta('prepTimeMinutes');
|
|
@override
|
|
late final GeneratedColumn<int> prepTimeMinutes = GeneratedColumn<int>(
|
|
'prep_time_minutes', aliasedName, true,
|
|
type: DriftSqlType.int, requiredDuringInsert: false);
|
|
static const VerificationMeta _cookTimeMinutesMeta =
|
|
const VerificationMeta('cookTimeMinutes');
|
|
@override
|
|
late final GeneratedColumn<int> cookTimeMinutes = GeneratedColumn<int>(
|
|
'cook_time_minutes', aliasedName, true,
|
|
type: DriftSqlType.int, requiredDuringInsert: false);
|
|
static const VerificationMeta _servingsMeta =
|
|
const VerificationMeta('servings');
|
|
@override
|
|
late final GeneratedColumn<int> servings = GeneratedColumn<int>(
|
|
'servings', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1));
|
|
static const VerificationMeta _rawIngredientsJsonMeta =
|
|
const VerificationMeta('rawIngredientsJson');
|
|
@override
|
|
late final GeneratedColumn<String> rawIngredientsJson =
|
|
GeneratedColumn<String>('raw_ingredients_json', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _instructionsJsonMeta =
|
|
const VerificationMeta('instructionsJson');
|
|
@override
|
|
late final GeneratedColumn<String> instructionsJson = GeneratedColumn<String>(
|
|
'instructions_json', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _caloriesMeta =
|
|
const VerificationMeta('calories');
|
|
@override
|
|
late final GeneratedColumn<int> calories = GeneratedColumn<int>(
|
|
'calories', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0));
|
|
static const VerificationMeta _proteinGramsMeta =
|
|
const VerificationMeta('proteinGrams');
|
|
@override
|
|
late final GeneratedColumn<double> proteinGrams = GeneratedColumn<double>(
|
|
'protein_grams', aliasedName, false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0));
|
|
static const VerificationMeta _carbsGramsMeta =
|
|
const VerificationMeta('carbsGrams');
|
|
@override
|
|
late final GeneratedColumn<double> carbsGrams = GeneratedColumn<double>(
|
|
'carbs_grams', aliasedName, false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0));
|
|
static const VerificationMeta _fatGramsMeta =
|
|
const VerificationMeta('fatGrams');
|
|
@override
|
|
late final GeneratedColumn<double> fatGrams = GeneratedColumn<double>(
|
|
'fat_grams', aliasedName, false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0));
|
|
static const VerificationMeta _createdAtMeta =
|
|
const VerificationMeta('createdAt');
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
title,
|
|
sourceUrl,
|
|
imageUrl,
|
|
description,
|
|
prepTimeMinutes,
|
|
cookTimeMinutes,
|
|
servings,
|
|
rawIngredientsJson,
|
|
instructionsJson,
|
|
calories,
|
|
proteinGrams,
|
|
carbsGrams,
|
|
fatGrams,
|
|
createdAt
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'recipes_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<RecipeRecord> instance,
|
|
{bool isInserting = false}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('source_url')) {
|
|
context.handle(_sourceUrlMeta,
|
|
sourceUrl.isAcceptableOrUnknown(data['source_url']!, _sourceUrlMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_sourceUrlMeta);
|
|
}
|
|
if (data.containsKey('image_url')) {
|
|
context.handle(_imageUrlMeta,
|
|
imageUrl.isAcceptableOrUnknown(data['image_url']!, _imageUrlMeta));
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!, _descriptionMeta));
|
|
}
|
|
if (data.containsKey('prep_time_minutes')) {
|
|
context.handle(
|
|
_prepTimeMinutesMeta,
|
|
prepTimeMinutes.isAcceptableOrUnknown(
|
|
data['prep_time_minutes']!, _prepTimeMinutesMeta));
|
|
}
|
|
if (data.containsKey('cook_time_minutes')) {
|
|
context.handle(
|
|
_cookTimeMinutesMeta,
|
|
cookTimeMinutes.isAcceptableOrUnknown(
|
|
data['cook_time_minutes']!, _cookTimeMinutesMeta));
|
|
}
|
|
if (data.containsKey('servings')) {
|
|
context.handle(_servingsMeta,
|
|
servings.isAcceptableOrUnknown(data['servings']!, _servingsMeta));
|
|
}
|
|
if (data.containsKey('raw_ingredients_json')) {
|
|
context.handle(
|
|
_rawIngredientsJsonMeta,
|
|
rawIngredientsJson.isAcceptableOrUnknown(
|
|
data['raw_ingredients_json']!, _rawIngredientsJsonMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_rawIngredientsJsonMeta);
|
|
}
|
|
if (data.containsKey('instructions_json')) {
|
|
context.handle(
|
|
_instructionsJsonMeta,
|
|
instructionsJson.isAcceptableOrUnknown(
|
|
data['instructions_json']!, _instructionsJsonMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_instructionsJsonMeta);
|
|
}
|
|
if (data.containsKey('calories')) {
|
|
context.handle(_caloriesMeta,
|
|
calories.isAcceptableOrUnknown(data['calories']!, _caloriesMeta));
|
|
}
|
|
if (data.containsKey('protein_grams')) {
|
|
context.handle(
|
|
_proteinGramsMeta,
|
|
proteinGrams.isAcceptableOrUnknown(
|
|
data['protein_grams']!, _proteinGramsMeta));
|
|
}
|
|
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));
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
RecipeRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return RecipeRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}id'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
sourceUrl: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}source_url'])!,
|
|
imageUrl: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}image_url']),
|
|
description: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}description']),
|
|
prepTimeMinutes: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}prep_time_minutes']),
|
|
cookTimeMinutes: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}cook_time_minutes']),
|
|
servings: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}servings'])!,
|
|
rawIngredientsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string, data['${effectivePrefix}raw_ingredients_json'])!,
|
|
instructionsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string, data['${effectivePrefix}instructions_json'])!,
|
|
calories: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}calories'])!,
|
|
proteinGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}protein_grams'])!,
|
|
carbsGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}carbs_grams'])!,
|
|
fatGrams: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}fat_grams'])!,
|
|
createdAt: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$RecipesTableTable createAlias(String alias) {
|
|
return $RecipesTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class RecipeRecord extends DataClass implements Insertable<RecipeRecord> {
|
|
/// UUID primary key (see `core/utils/uuid.dart`).
|
|
final String id;
|
|
final String title;
|
|
|
|
/// Canonical URL the recipe was imported from; used to de-duplicate
|
|
/// re-imports.
|
|
final String sourceUrl;
|
|
final String? imageUrl;
|
|
|
|
/// Short summary (schema.org `description` / `og:description`).
|
|
final String? description;
|
|
|
|
/// Preparation time in minutes; `null` when unknown.
|
|
final int? prepTimeMinutes;
|
|
|
|
/// Cook time in minutes; `null` when unknown.
|
|
final int? cookTimeMinutes;
|
|
final int servings;
|
|
|
|
/// JSON-encoded `List<Map>` of ingredient records.
|
|
final String rawIngredientsJson;
|
|
|
|
/// JSON-encoded `List<String>` of instruction steps.
|
|
final String instructionsJson;
|
|
final int calories;
|
|
final double proteinGrams;
|
|
final double carbsGrams;
|
|
final double fatGrams;
|
|
final DateTime createdAt;
|
|
const RecipeRecord(
|
|
{required this.id,
|
|
required this.title,
|
|
required this.sourceUrl,
|
|
this.imageUrl,
|
|
this.description,
|
|
this.prepTimeMinutes,
|
|
this.cookTimeMinutes,
|
|
required this.servings,
|
|
required this.rawIngredientsJson,
|
|
required this.instructionsJson,
|
|
required this.calories,
|
|
required this.proteinGrams,
|
|
required this.carbsGrams,
|
|
required this.fatGrams,
|
|
required this.createdAt});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['source_url'] = Variable<String>(sourceUrl);
|
|
if (!nullToAbsent || imageUrl != null) {
|
|
map['image_url'] = Variable<String>(imageUrl);
|
|
}
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
if (!nullToAbsent || prepTimeMinutes != null) {
|
|
map['prep_time_minutes'] = Variable<int>(prepTimeMinutes);
|
|
}
|
|
if (!nullToAbsent || cookTimeMinutes != null) {
|
|
map['cook_time_minutes'] = Variable<int>(cookTimeMinutes);
|
|
}
|
|
map['servings'] = Variable<int>(servings);
|
|
map['raw_ingredients_json'] = Variable<String>(rawIngredientsJson);
|
|
map['instructions_json'] = Variable<String>(instructionsJson);
|
|
map['calories'] = Variable<int>(calories);
|
|
map['protein_grams'] = Variable<double>(proteinGrams);
|
|
map['carbs_grams'] = Variable<double>(carbsGrams);
|
|
map['fat_grams'] = Variable<double>(fatGrams);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
RecipesTableCompanion toCompanion(bool nullToAbsent) {
|
|
return RecipesTableCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
sourceUrl: Value(sourceUrl),
|
|
imageUrl: imageUrl == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(imageUrl),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
prepTimeMinutes: prepTimeMinutes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(prepTimeMinutes),
|
|
cookTimeMinutes: cookTimeMinutes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(cookTimeMinutes),
|
|
servings: Value(servings),
|
|
rawIngredientsJson: Value(rawIngredientsJson),
|
|
instructionsJson: Value(instructionsJson),
|
|
calories: Value(calories),
|
|
proteinGrams: Value(proteinGrams),
|
|
carbsGrams: Value(carbsGrams),
|
|
fatGrams: Value(fatGrams),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory RecipeRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return RecipeRecord(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
sourceUrl: serializer.fromJson<String>(json['sourceUrl']),
|
|
imageUrl: serializer.fromJson<String?>(json['imageUrl']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
prepTimeMinutes: serializer.fromJson<int?>(json['prepTimeMinutes']),
|
|
cookTimeMinutes: serializer.fromJson<int?>(json['cookTimeMinutes']),
|
|
servings: serializer.fromJson<int>(json['servings']),
|
|
rawIngredientsJson:
|
|
serializer.fromJson<String>(json['rawIngredientsJson']),
|
|
instructionsJson: serializer.fromJson<String>(json['instructionsJson']),
|
|
calories: serializer.fromJson<int>(json['calories']),
|
|
proteinGrams: serializer.fromJson<double>(json['proteinGrams']),
|
|
carbsGrams: serializer.fromJson<double>(json['carbsGrams']),
|
|
fatGrams: serializer.fromJson<double>(json['fatGrams']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'sourceUrl': serializer.toJson<String>(sourceUrl),
|
|
'imageUrl': serializer.toJson<String?>(imageUrl),
|
|
'description': serializer.toJson<String?>(description),
|
|
'prepTimeMinutes': serializer.toJson<int?>(prepTimeMinutes),
|
|
'cookTimeMinutes': serializer.toJson<int?>(cookTimeMinutes),
|
|
'servings': serializer.toJson<int>(servings),
|
|
'rawIngredientsJson': serializer.toJson<String>(rawIngredientsJson),
|
|
'instructionsJson': serializer.toJson<String>(instructionsJson),
|
|
'calories': serializer.toJson<int>(calories),
|
|
'proteinGrams': serializer.toJson<double>(proteinGrams),
|
|
'carbsGrams': serializer.toJson<double>(carbsGrams),
|
|
'fatGrams': serializer.toJson<double>(fatGrams),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
RecipeRecord copyWith(
|
|
{String? id,
|
|
String? title,
|
|
String? sourceUrl,
|
|
Value<String?> imageUrl = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> prepTimeMinutes = const Value.absent(),
|
|
Value<int?> cookTimeMinutes = const Value.absent(),
|
|
int? servings,
|
|
String? rawIngredientsJson,
|
|
String? instructionsJson,
|
|
int? calories,
|
|
double? proteinGrams,
|
|
double? carbsGrams,
|
|
double? fatGrams,
|
|
DateTime? createdAt}) =>
|
|
RecipeRecord(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
sourceUrl: sourceUrl ?? this.sourceUrl,
|
|
imageUrl: imageUrl.present ? imageUrl.value : this.imageUrl,
|
|
description: description.present ? description.value : this.description,
|
|
prepTimeMinutes: prepTimeMinutes.present
|
|
? prepTimeMinutes.value
|
|
: this.prepTimeMinutes,
|
|
cookTimeMinutes: cookTimeMinutes.present
|
|
? cookTimeMinutes.value
|
|
: this.cookTimeMinutes,
|
|
servings: servings ?? this.servings,
|
|
rawIngredientsJson: rawIngredientsJson ?? this.rawIngredientsJson,
|
|
instructionsJson: instructionsJson ?? this.instructionsJson,
|
|
calories: calories ?? this.calories,
|
|
proteinGrams: proteinGrams ?? this.proteinGrams,
|
|
carbsGrams: carbsGrams ?? this.carbsGrams,
|
|
fatGrams: fatGrams ?? this.fatGrams,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
RecipeRecord copyWithCompanion(RecipesTableCompanion data) {
|
|
return RecipeRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
sourceUrl: data.sourceUrl.present ? data.sourceUrl.value : this.sourceUrl,
|
|
imageUrl: data.imageUrl.present ? data.imageUrl.value : this.imageUrl,
|
|
description:
|
|
data.description.present ? data.description.value : this.description,
|
|
prepTimeMinutes: data.prepTimeMinutes.present
|
|
? data.prepTimeMinutes.value
|
|
: this.prepTimeMinutes,
|
|
cookTimeMinutes: data.cookTimeMinutes.present
|
|
? data.cookTimeMinutes.value
|
|
: this.cookTimeMinutes,
|
|
servings: data.servings.present ? data.servings.value : this.servings,
|
|
rawIngredientsJson: data.rawIngredientsJson.present
|
|
? data.rawIngredientsJson.value
|
|
: this.rawIngredientsJson,
|
|
instructionsJson: data.instructionsJson.present
|
|
? data.instructionsJson.value
|
|
: this.instructionsJson,
|
|
calories: data.calories.present ? data.calories.value : this.calories,
|
|
proteinGrams: data.proteinGrams.present
|
|
? data.proteinGrams.value
|
|
: this.proteinGrams,
|
|
carbsGrams:
|
|
data.carbsGrams.present ? data.carbsGrams.value : this.carbsGrams,
|
|
fatGrams: data.fatGrams.present ? data.fatGrams.value : this.fatGrams,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RecipeRecord(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('sourceUrl: $sourceUrl, ')
|
|
..write('imageUrl: $imageUrl, ')
|
|
..write('description: $description, ')
|
|
..write('prepTimeMinutes: $prepTimeMinutes, ')
|
|
..write('cookTimeMinutes: $cookTimeMinutes, ')
|
|
..write('servings: $servings, ')
|
|
..write('rawIngredientsJson: $rawIngredientsJson, ')
|
|
..write('instructionsJson: $instructionsJson, ')
|
|
..write('calories: $calories, ')
|
|
..write('proteinGrams: $proteinGrams, ')
|
|
..write('carbsGrams: $carbsGrams, ')
|
|
..write('fatGrams: $fatGrams, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
title,
|
|
sourceUrl,
|
|
imageUrl,
|
|
description,
|
|
prepTimeMinutes,
|
|
cookTimeMinutes,
|
|
servings,
|
|
rawIngredientsJson,
|
|
instructionsJson,
|
|
calories,
|
|
proteinGrams,
|
|
carbsGrams,
|
|
fatGrams,
|
|
createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is RecipeRecord &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.sourceUrl == this.sourceUrl &&
|
|
other.imageUrl == this.imageUrl &&
|
|
other.description == this.description &&
|
|
other.prepTimeMinutes == this.prepTimeMinutes &&
|
|
other.cookTimeMinutes == this.cookTimeMinutes &&
|
|
other.servings == this.servings &&
|
|
other.rawIngredientsJson == this.rawIngredientsJson &&
|
|
other.instructionsJson == this.instructionsJson &&
|
|
other.calories == this.calories &&
|
|
other.proteinGrams == this.proteinGrams &&
|
|
other.carbsGrams == this.carbsGrams &&
|
|
other.fatGrams == this.fatGrams &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class RecipesTableCompanion extends UpdateCompanion<RecipeRecord> {
|
|
final Value<String> id;
|
|
final Value<String> title;
|
|
final Value<String> sourceUrl;
|
|
final Value<String?> imageUrl;
|
|
final Value<String?> description;
|
|
final Value<int?> prepTimeMinutes;
|
|
final Value<int?> cookTimeMinutes;
|
|
final Value<int> servings;
|
|
final Value<String> rawIngredientsJson;
|
|
final Value<String> instructionsJson;
|
|
final Value<int> calories;
|
|
final Value<double> proteinGrams;
|
|
final Value<double> carbsGrams;
|
|
final Value<double> fatGrams;
|
|
final Value<DateTime> createdAt;
|
|
final Value<int> rowid;
|
|
const RecipesTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.sourceUrl = const Value.absent(),
|
|
this.imageUrl = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.prepTimeMinutes = const Value.absent(),
|
|
this.cookTimeMinutes = const Value.absent(),
|
|
this.servings = const Value.absent(),
|
|
this.rawIngredientsJson = const Value.absent(),
|
|
this.instructionsJson = const Value.absent(),
|
|
this.calories = const Value.absent(),
|
|
this.proteinGrams = const Value.absent(),
|
|
this.carbsGrams = const Value.absent(),
|
|
this.fatGrams = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
RecipesTableCompanion.insert({
|
|
required String id,
|
|
required String title,
|
|
required String sourceUrl,
|
|
this.imageUrl = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.prepTimeMinutes = const Value.absent(),
|
|
this.cookTimeMinutes = const Value.absent(),
|
|
this.servings = const Value.absent(),
|
|
required String rawIngredientsJson,
|
|
required String instructionsJson,
|
|
this.calories = const Value.absent(),
|
|
this.proteinGrams = const Value.absent(),
|
|
this.carbsGrams = const Value.absent(),
|
|
this.fatGrams = const Value.absent(),
|
|
required DateTime createdAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
title = Value(title),
|
|
sourceUrl = Value(sourceUrl),
|
|
rawIngredientsJson = Value(rawIngredientsJson),
|
|
instructionsJson = Value(instructionsJson),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<RecipeRecord> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? sourceUrl,
|
|
Expression<String>? imageUrl,
|
|
Expression<String>? description,
|
|
Expression<int>? prepTimeMinutes,
|
|
Expression<int>? cookTimeMinutes,
|
|
Expression<int>? servings,
|
|
Expression<String>? rawIngredientsJson,
|
|
Expression<String>? instructionsJson,
|
|
Expression<int>? calories,
|
|
Expression<double>? proteinGrams,
|
|
Expression<double>? carbsGrams,
|
|
Expression<double>? fatGrams,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (sourceUrl != null) 'source_url': sourceUrl,
|
|
if (imageUrl != null) 'image_url': imageUrl,
|
|
if (description != null) 'description': description,
|
|
if (prepTimeMinutes != null) 'prep_time_minutes': prepTimeMinutes,
|
|
if (cookTimeMinutes != null) 'cook_time_minutes': cookTimeMinutes,
|
|
if (servings != null) 'servings': servings,
|
|
if (rawIngredientsJson != null)
|
|
'raw_ingredients_json': rawIngredientsJson,
|
|
if (instructionsJson != null) 'instructions_json': instructionsJson,
|
|
if (calories != null) 'calories': calories,
|
|
if (proteinGrams != null) 'protein_grams': proteinGrams,
|
|
if (carbsGrams != null) 'carbs_grams': carbsGrams,
|
|
if (fatGrams != null) 'fat_grams': fatGrams,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
RecipesTableCompanion copyWith(
|
|
{Value<String>? id,
|
|
Value<String>? title,
|
|
Value<String>? sourceUrl,
|
|
Value<String?>? imageUrl,
|
|
Value<String?>? description,
|
|
Value<int?>? prepTimeMinutes,
|
|
Value<int?>? cookTimeMinutes,
|
|
Value<int>? servings,
|
|
Value<String>? rawIngredientsJson,
|
|
Value<String>? instructionsJson,
|
|
Value<int>? calories,
|
|
Value<double>? proteinGrams,
|
|
Value<double>? carbsGrams,
|
|
Value<double>? fatGrams,
|
|
Value<DateTime>? createdAt,
|
|
Value<int>? rowid}) {
|
|
return RecipesTableCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
sourceUrl: sourceUrl ?? this.sourceUrl,
|
|
imageUrl: imageUrl ?? this.imageUrl,
|
|
description: description ?? this.description,
|
|
prepTimeMinutes: prepTimeMinutes ?? this.prepTimeMinutes,
|
|
cookTimeMinutes: cookTimeMinutes ?? this.cookTimeMinutes,
|
|
servings: servings ?? this.servings,
|
|
rawIngredientsJson: rawIngredientsJson ?? this.rawIngredientsJson,
|
|
instructionsJson: instructionsJson ?? this.instructionsJson,
|
|
calories: calories ?? this.calories,
|
|
proteinGrams: proteinGrams ?? this.proteinGrams,
|
|
carbsGrams: carbsGrams ?? this.carbsGrams,
|
|
fatGrams: fatGrams ?? this.fatGrams,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (sourceUrl.present) {
|
|
map['source_url'] = Variable<String>(sourceUrl.value);
|
|
}
|
|
if (imageUrl.present) {
|
|
map['image_url'] = Variable<String>(imageUrl.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (prepTimeMinutes.present) {
|
|
map['prep_time_minutes'] = Variable<int>(prepTimeMinutes.value);
|
|
}
|
|
if (cookTimeMinutes.present) {
|
|
map['cook_time_minutes'] = Variable<int>(cookTimeMinutes.value);
|
|
}
|
|
if (servings.present) {
|
|
map['servings'] = Variable<int>(servings.value);
|
|
}
|
|
if (rawIngredientsJson.present) {
|
|
map['raw_ingredients_json'] = Variable<String>(rawIngredientsJson.value);
|
|
}
|
|
if (instructionsJson.present) {
|
|
map['instructions_json'] = Variable<String>(instructionsJson.value);
|
|
}
|
|
if (calories.present) {
|
|
map['calories'] = Variable<int>(calories.value);
|
|
}
|
|
if (proteinGrams.present) {
|
|
map['protein_grams'] = Variable<double>(proteinGrams.value);
|
|
}
|
|
if (carbsGrams.present) {
|
|
map['carbs_grams'] = Variable<double>(carbsGrams.value);
|
|
}
|
|
if (fatGrams.present) {
|
|
map['fat_grams'] = Variable<double>(fatGrams.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RecipesTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('sourceUrl: $sourceUrl, ')
|
|
..write('imageUrl: $imageUrl, ')
|
|
..write('description: $description, ')
|
|
..write('prepTimeMinutes: $prepTimeMinutes, ')
|
|
..write('cookTimeMinutes: $cookTimeMinutes, ')
|
|
..write('servings: $servings, ')
|
|
..write('rawIngredientsJson: $rawIngredientsJson, ')
|
|
..write('instructionsJson: $instructionsJson, ')
|
|
..write('calories: $calories, ')
|
|
..write('proteinGrams: $proteinGrams, ')
|
|
..write('carbsGrams: $carbsGrams, ')
|
|
..write('fatGrams: $fatGrams, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $MealPlanSlotsTableTable extends MealPlanSlotsTable
|
|
with TableInfo<$MealPlanSlotsTableTable, MealPlanSlotRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MealPlanSlotsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _plannedDateMeta =
|
|
const VerificationMeta('plannedDate');
|
|
@override
|
|
late final GeneratedColumn<DateTime> plannedDate = GeneratedColumn<DateTime>(
|
|
'planned_date', 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 _recipeIdMeta =
|
|
const VerificationMeta('recipeId');
|
|
@override
|
|
late final GeneratedColumn<String> recipeId = GeneratedColumn<String>(
|
|
'recipe_id', aliasedName, true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES recipes_table (id) ON DELETE SET NULL'));
|
|
static const VerificationMeta _customNotesMeta =
|
|
const VerificationMeta('customNotes');
|
|
@override
|
|
late final GeneratedColumn<String> customNotes = GeneratedColumn<String>(
|
|
'custom_notes', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
static const VerificationMeta _isCompletedMeta =
|
|
const VerificationMeta('isCompleted');
|
|
@override
|
|
late final GeneratedColumn<bool> isCompleted = GeneratedColumn<bool>(
|
|
'is_completed', aliasedName, false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_completed" IN (0, 1))'),
|
|
defaultValue: const Constant(false));
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, plannedDate, mealType, recipeId, customNotes, isCompleted];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'meal_plan_slots_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<MealPlanSlotRecord> instance,
|
|
{bool isInserting = false}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('planned_date')) {
|
|
context.handle(
|
|
_plannedDateMeta,
|
|
plannedDate.isAcceptableOrUnknown(
|
|
data['planned_date']!, _plannedDateMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_plannedDateMeta);
|
|
}
|
|
if (data.containsKey('meal_type')) {
|
|
context.handle(_mealTypeMeta,
|
|
mealType.isAcceptableOrUnknown(data['meal_type']!, _mealTypeMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_mealTypeMeta);
|
|
}
|
|
if (data.containsKey('recipe_id')) {
|
|
context.handle(_recipeIdMeta,
|
|
recipeId.isAcceptableOrUnknown(data['recipe_id']!, _recipeIdMeta));
|
|
}
|
|
if (data.containsKey('custom_notes')) {
|
|
context.handle(
|
|
_customNotesMeta,
|
|
customNotes.isAcceptableOrUnknown(
|
|
data['custom_notes']!, _customNotesMeta));
|
|
}
|
|
if (data.containsKey('is_completed')) {
|
|
context.handle(
|
|
_isCompletedMeta,
|
|
isCompleted.isAcceptableOrUnknown(
|
|
data['is_completed']!, _isCompletedMeta));
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
MealPlanSlotRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return MealPlanSlotRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}id'])!,
|
|
plannedDate: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}planned_date'])!,
|
|
mealType: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}meal_type'])!,
|
|
recipeId: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}recipe_id']),
|
|
customNotes: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}custom_notes']),
|
|
isCompleted: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.bool, data['${effectivePrefix}is_completed'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MealPlanSlotsTableTable createAlias(String alias) {
|
|
return $MealPlanSlotsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class MealPlanSlotRecord extends DataClass
|
|
implements Insertable<MealPlanSlotRecord> {
|
|
/// UUID primary key.
|
|
final String id;
|
|
|
|
/// Calendar day the slot belongs to (local start-of-day).
|
|
final DateTime plannedDate;
|
|
|
|
/// Meal slot identifier (e.g. `breakfast`) — the `MealType.name` key of
|
|
/// the nutrition domain enum.
|
|
final String mealType;
|
|
|
|
/// Assigned recipe; falls back to `null` when the recipe is deleted.
|
|
final String? recipeId;
|
|
|
|
/// Free-text meal description for custom entries / notes.
|
|
final String? customNotes;
|
|
final bool isCompleted;
|
|
const MealPlanSlotRecord(
|
|
{required this.id,
|
|
required this.plannedDate,
|
|
required this.mealType,
|
|
this.recipeId,
|
|
this.customNotes,
|
|
required this.isCompleted});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['planned_date'] = Variable<DateTime>(plannedDate);
|
|
map['meal_type'] = Variable<String>(mealType);
|
|
if (!nullToAbsent || recipeId != null) {
|
|
map['recipe_id'] = Variable<String>(recipeId);
|
|
}
|
|
if (!nullToAbsent || customNotes != null) {
|
|
map['custom_notes'] = Variable<String>(customNotes);
|
|
}
|
|
map['is_completed'] = Variable<bool>(isCompleted);
|
|
return map;
|
|
}
|
|
|
|
MealPlanSlotsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return MealPlanSlotsTableCompanion(
|
|
id: Value(id),
|
|
plannedDate: Value(plannedDate),
|
|
mealType: Value(mealType),
|
|
recipeId: recipeId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(recipeId),
|
|
customNotes: customNotes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(customNotes),
|
|
isCompleted: Value(isCompleted),
|
|
);
|
|
}
|
|
|
|
factory MealPlanSlotRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return MealPlanSlotRecord(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
plannedDate: serializer.fromJson<DateTime>(json['plannedDate']),
|
|
mealType: serializer.fromJson<String>(json['mealType']),
|
|
recipeId: serializer.fromJson<String?>(json['recipeId']),
|
|
customNotes: serializer.fromJson<String?>(json['customNotes']),
|
|
isCompleted: serializer.fromJson<bool>(json['isCompleted']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'plannedDate': serializer.toJson<DateTime>(plannedDate),
|
|
'mealType': serializer.toJson<String>(mealType),
|
|
'recipeId': serializer.toJson<String?>(recipeId),
|
|
'customNotes': serializer.toJson<String?>(customNotes),
|
|
'isCompleted': serializer.toJson<bool>(isCompleted),
|
|
};
|
|
}
|
|
|
|
MealPlanSlotRecord copyWith(
|
|
{String? id,
|
|
DateTime? plannedDate,
|
|
String? mealType,
|
|
Value<String?> recipeId = const Value.absent(),
|
|
Value<String?> customNotes = const Value.absent(),
|
|
bool? isCompleted}) =>
|
|
MealPlanSlotRecord(
|
|
id: id ?? this.id,
|
|
plannedDate: plannedDate ?? this.plannedDate,
|
|
mealType: mealType ?? this.mealType,
|
|
recipeId: recipeId.present ? recipeId.value : this.recipeId,
|
|
customNotes: customNotes.present ? customNotes.value : this.customNotes,
|
|
isCompleted: isCompleted ?? this.isCompleted,
|
|
);
|
|
MealPlanSlotRecord copyWithCompanion(MealPlanSlotsTableCompanion data) {
|
|
return MealPlanSlotRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
plannedDate:
|
|
data.plannedDate.present ? data.plannedDate.value : this.plannedDate,
|
|
mealType: data.mealType.present ? data.mealType.value : this.mealType,
|
|
recipeId: data.recipeId.present ? data.recipeId.value : this.recipeId,
|
|
customNotes:
|
|
data.customNotes.present ? data.customNotes.value : this.customNotes,
|
|
isCompleted:
|
|
data.isCompleted.present ? data.isCompleted.value : this.isCompleted,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MealPlanSlotRecord(')
|
|
..write('id: $id, ')
|
|
..write('plannedDate: $plannedDate, ')
|
|
..write('mealType: $mealType, ')
|
|
..write('recipeId: $recipeId, ')
|
|
..write('customNotes: $customNotes, ')
|
|
..write('isCompleted: $isCompleted')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id, plannedDate, mealType, recipeId, customNotes, isCompleted);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is MealPlanSlotRecord &&
|
|
other.id == this.id &&
|
|
other.plannedDate == this.plannedDate &&
|
|
other.mealType == this.mealType &&
|
|
other.recipeId == this.recipeId &&
|
|
other.customNotes == this.customNotes &&
|
|
other.isCompleted == this.isCompleted);
|
|
}
|
|
|
|
class MealPlanSlotsTableCompanion extends UpdateCompanion<MealPlanSlotRecord> {
|
|
final Value<String> id;
|
|
final Value<DateTime> plannedDate;
|
|
final Value<String> mealType;
|
|
final Value<String?> recipeId;
|
|
final Value<String?> customNotes;
|
|
final Value<bool> isCompleted;
|
|
final Value<int> rowid;
|
|
const MealPlanSlotsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.plannedDate = const Value.absent(),
|
|
this.mealType = const Value.absent(),
|
|
this.recipeId = const Value.absent(),
|
|
this.customNotes = const Value.absent(),
|
|
this.isCompleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
MealPlanSlotsTableCompanion.insert({
|
|
required String id,
|
|
required DateTime plannedDate,
|
|
required String mealType,
|
|
this.recipeId = const Value.absent(),
|
|
this.customNotes = const Value.absent(),
|
|
this.isCompleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
plannedDate = Value(plannedDate),
|
|
mealType = Value(mealType);
|
|
static Insertable<MealPlanSlotRecord> custom({
|
|
Expression<String>? id,
|
|
Expression<DateTime>? plannedDate,
|
|
Expression<String>? mealType,
|
|
Expression<String>? recipeId,
|
|
Expression<String>? customNotes,
|
|
Expression<bool>? isCompleted,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (plannedDate != null) 'planned_date': plannedDate,
|
|
if (mealType != null) 'meal_type': mealType,
|
|
if (recipeId != null) 'recipe_id': recipeId,
|
|
if (customNotes != null) 'custom_notes': customNotes,
|
|
if (isCompleted != null) 'is_completed': isCompleted,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
MealPlanSlotsTableCompanion copyWith(
|
|
{Value<String>? id,
|
|
Value<DateTime>? plannedDate,
|
|
Value<String>? mealType,
|
|
Value<String?>? recipeId,
|
|
Value<String?>? customNotes,
|
|
Value<bool>? isCompleted,
|
|
Value<int>? rowid}) {
|
|
return MealPlanSlotsTableCompanion(
|
|
id: id ?? this.id,
|
|
plannedDate: plannedDate ?? this.plannedDate,
|
|
mealType: mealType ?? this.mealType,
|
|
recipeId: recipeId ?? this.recipeId,
|
|
customNotes: customNotes ?? this.customNotes,
|
|
isCompleted: isCompleted ?? this.isCompleted,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (plannedDate.present) {
|
|
map['planned_date'] = Variable<DateTime>(plannedDate.value);
|
|
}
|
|
if (mealType.present) {
|
|
map['meal_type'] = Variable<String>(mealType.value);
|
|
}
|
|
if (recipeId.present) {
|
|
map['recipe_id'] = Variable<String>(recipeId.value);
|
|
}
|
|
if (customNotes.present) {
|
|
map['custom_notes'] = Variable<String>(customNotes.value);
|
|
}
|
|
if (isCompleted.present) {
|
|
map['is_completed'] = Variable<bool>(isCompleted.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MealPlanSlotsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('plannedDate: $plannedDate, ')
|
|
..write('mealType: $mealType, ')
|
|
..write('recipeId: $recipeId, ')
|
|
..write('customNotes: $customNotes, ')
|
|
..write('isCompleted: $isCompleted, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PantryItemsTableTable extends PantryItemsTable
|
|
with TableInfo<$PantryItemsTableTable, PantryItemRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PantryItemsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 128),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _quantityOnHandMeta =
|
|
const VerificationMeta('quantityOnHand');
|
|
@override
|
|
late final GeneratedColumn<double> quantityOnHand = GeneratedColumn<double>(
|
|
'quantity_on_hand', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _unitMeta = const VerificationMeta('unit');
|
|
@override
|
|
late final GeneratedColumn<String> unit = GeneratedColumn<String>(
|
|
'unit', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 16),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _categoryMeta =
|
|
const VerificationMeta('category');
|
|
@override
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 32),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _expirationDateMeta =
|
|
const VerificationMeta('expirationDate');
|
|
@override
|
|
late final GeneratedColumn<DateTime> expirationDate =
|
|
GeneratedColumn<DateTime>('expiration_date', aliasedName, true,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: false);
|
|
static const VerificationMeta _lastUpdatedMeta =
|
|
const VerificationMeta('lastUpdated');
|
|
@override
|
|
late final GeneratedColumn<DateTime> lastUpdated = GeneratedColumn<DateTime>(
|
|
'last_updated', aliasedName, false,
|
|
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
|
@override
|
|
List<GeneratedColumn> get $columns =>
|
|
[id, name, quantityOnHand, unit, category, expirationDate, lastUpdated];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'pantry_items_table';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<PantryItemRecord> instance,
|
|
{bool isInserting = false}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('quantity_on_hand')) {
|
|
context.handle(
|
|
_quantityOnHandMeta,
|
|
quantityOnHand.isAcceptableOrUnknown(
|
|
data['quantity_on_hand']!, _quantityOnHandMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_quantityOnHandMeta);
|
|
}
|
|
if (data.containsKey('unit')) {
|
|
context.handle(
|
|
_unitMeta, unit.isAcceptableOrUnknown(data['unit']!, _unitMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_unitMeta);
|
|
}
|
|
if (data.containsKey('category')) {
|
|
context.handle(_categoryMeta,
|
|
category.isAcceptableOrUnknown(data['category']!, _categoryMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_categoryMeta);
|
|
}
|
|
if (data.containsKey('expiration_date')) {
|
|
context.handle(
|
|
_expirationDateMeta,
|
|
expirationDate.isAcceptableOrUnknown(
|
|
data['expiration_date']!, _expirationDateMeta));
|
|
}
|
|
if (data.containsKey('last_updated')) {
|
|
context.handle(
|
|
_lastUpdatedMeta,
|
|
lastUpdated.isAcceptableOrUnknown(
|
|
data['last_updated']!, _lastUpdatedMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_lastUpdatedMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
PantryItemRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return PantryItemRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}id'])!,
|
|
name: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}name'])!,
|
|
quantityOnHand: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double, data['${effectivePrefix}quantity_on_hand'])!,
|
|
unit: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}unit'])!,
|
|
category: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}category'])!,
|
|
expirationDate: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime, data['${effectivePrefix}expiration_date']),
|
|
lastUpdated: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_updated'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PantryItemsTableTable createAlias(String alias) {
|
|
return $PantryItemsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class PantryItemRecord extends DataClass
|
|
implements Insertable<PantryItemRecord> {
|
|
/// UUID primary key (see `core/utils/uuid.dart`).
|
|
final String id;
|
|
|
|
/// Canonical lowercase ingredient name (e.g. `chicken breast`).
|
|
final String name;
|
|
|
|
/// Quantity currently on hand, expressed in [unit].
|
|
final double quantityOnHand;
|
|
|
|
/// Canonical unit key (e.g. `g`, `oz`, `count`).
|
|
final String unit;
|
|
|
|
/// Grocery aisle key (e.g. `meat_seafood`) — the `persistenceKey` of the
|
|
/// pantry domain's category enum.
|
|
final String category;
|
|
|
|
/// Best-by date; `null` when the item does not expire.
|
|
final DateTime? expirationDate;
|
|
final DateTime lastUpdated;
|
|
const PantryItemRecord(
|
|
{required this.id,
|
|
required this.name,
|
|
required this.quantityOnHand,
|
|
required this.unit,
|
|
required this.category,
|
|
this.expirationDate,
|
|
required this.lastUpdated});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['quantity_on_hand'] = Variable<double>(quantityOnHand);
|
|
map['unit'] = Variable<String>(unit);
|
|
map['category'] = Variable<String>(category);
|
|
if (!nullToAbsent || expirationDate != null) {
|
|
map['expiration_date'] = Variable<DateTime>(expirationDate);
|
|
}
|
|
map['last_updated'] = Variable<DateTime>(lastUpdated);
|
|
return map;
|
|
}
|
|
|
|
PantryItemsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return PantryItemsTableCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
quantityOnHand: Value(quantityOnHand),
|
|
unit: Value(unit),
|
|
category: Value(category),
|
|
expirationDate: expirationDate == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(expirationDate),
|
|
lastUpdated: Value(lastUpdated),
|
|
);
|
|
}
|
|
|
|
factory PantryItemRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return PantryItemRecord(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
quantityOnHand: serializer.fromJson<double>(json['quantityOnHand']),
|
|
unit: serializer.fromJson<String>(json['unit']),
|
|
category: serializer.fromJson<String>(json['category']),
|
|
expirationDate: serializer.fromJson<DateTime?>(json['expirationDate']),
|
|
lastUpdated: serializer.fromJson<DateTime>(json['lastUpdated']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'quantityOnHand': serializer.toJson<double>(quantityOnHand),
|
|
'unit': serializer.toJson<String>(unit),
|
|
'category': serializer.toJson<String>(category),
|
|
'expirationDate': serializer.toJson<DateTime?>(expirationDate),
|
|
'lastUpdated': serializer.toJson<DateTime>(lastUpdated),
|
|
};
|
|
}
|
|
|
|
PantryItemRecord copyWith(
|
|
{String? id,
|
|
String? name,
|
|
double? quantityOnHand,
|
|
String? unit,
|
|
String? category,
|
|
Value<DateTime?> expirationDate = const Value.absent(),
|
|
DateTime? lastUpdated}) =>
|
|
PantryItemRecord(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
quantityOnHand: quantityOnHand ?? this.quantityOnHand,
|
|
unit: unit ?? this.unit,
|
|
category: category ?? this.category,
|
|
expirationDate:
|
|
expirationDate.present ? expirationDate.value : this.expirationDate,
|
|
lastUpdated: lastUpdated ?? this.lastUpdated,
|
|
);
|
|
PantryItemRecord copyWithCompanion(PantryItemsTableCompanion data) {
|
|
return PantryItemRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
quantityOnHand: data.quantityOnHand.present
|
|
? data.quantityOnHand.value
|
|
: this.quantityOnHand,
|
|
unit: data.unit.present ? data.unit.value : this.unit,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
expirationDate: data.expirationDate.present
|
|
? data.expirationDate.value
|
|
: this.expirationDate,
|
|
lastUpdated:
|
|
data.lastUpdated.present ? data.lastUpdated.value : this.lastUpdated,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PantryItemRecord(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('quantityOnHand: $quantityOnHand, ')
|
|
..write('unit: $unit, ')
|
|
..write('category: $category, ')
|
|
..write('expirationDate: $expirationDate, ')
|
|
..write('lastUpdated: $lastUpdated')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id, name, quantityOnHand, unit, category, expirationDate, lastUpdated);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is PantryItemRecord &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.quantityOnHand == this.quantityOnHand &&
|
|
other.unit == this.unit &&
|
|
other.category == this.category &&
|
|
other.expirationDate == this.expirationDate &&
|
|
other.lastUpdated == this.lastUpdated);
|
|
}
|
|
|
|
class PantryItemsTableCompanion extends UpdateCompanion<PantryItemRecord> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<double> quantityOnHand;
|
|
final Value<String> unit;
|
|
final Value<String> category;
|
|
final Value<DateTime?> expirationDate;
|
|
final Value<DateTime> lastUpdated;
|
|
final Value<int> rowid;
|
|
const PantryItemsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.quantityOnHand = const Value.absent(),
|
|
this.unit = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.expirationDate = const Value.absent(),
|
|
this.lastUpdated = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PantryItemsTableCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required double quantityOnHand,
|
|
required String unit,
|
|
required String category,
|
|
this.expirationDate = const Value.absent(),
|
|
required DateTime lastUpdated,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
quantityOnHand = Value(quantityOnHand),
|
|
unit = Value(unit),
|
|
category = Value(category),
|
|
lastUpdated = Value(lastUpdated);
|
|
static Insertable<PantryItemRecord> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<double>? quantityOnHand,
|
|
Expression<String>? unit,
|
|
Expression<String>? category,
|
|
Expression<DateTime>? expirationDate,
|
|
Expression<DateTime>? lastUpdated,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (quantityOnHand != null) 'quantity_on_hand': quantityOnHand,
|
|
if (unit != null) 'unit': unit,
|
|
if (category != null) 'category': category,
|
|
if (expirationDate != null) 'expiration_date': expirationDate,
|
|
if (lastUpdated != null) 'last_updated': lastUpdated,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PantryItemsTableCompanion copyWith(
|
|
{Value<String>? id,
|
|
Value<String>? name,
|
|
Value<double>? quantityOnHand,
|
|
Value<String>? unit,
|
|
Value<String>? category,
|
|
Value<DateTime?>? expirationDate,
|
|
Value<DateTime>? lastUpdated,
|
|
Value<int>? rowid}) {
|
|
return PantryItemsTableCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
quantityOnHand: quantityOnHand ?? this.quantityOnHand,
|
|
unit: unit ?? this.unit,
|
|
category: category ?? this.category,
|
|
expirationDate: expirationDate ?? this.expirationDate,
|
|
lastUpdated: lastUpdated ?? this.lastUpdated,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (quantityOnHand.present) {
|
|
map['quantity_on_hand'] = Variable<double>(quantityOnHand.value);
|
|
}
|
|
if (unit.present) {
|
|
map['unit'] = Variable<String>(unit.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (expirationDate.present) {
|
|
map['expiration_date'] = Variable<DateTime>(expirationDate.value);
|
|
}
|
|
if (lastUpdated.present) {
|
|
map['last_updated'] = Variable<DateTime>(lastUpdated.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PantryItemsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('quantityOnHand: $quantityOnHand, ')
|
|
..write('unit: $unit, ')
|
|
..write('category: $category, ')
|
|
..write('expirationDate: $expirationDate, ')
|
|
..write('lastUpdated: $lastUpdated, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ShoppingListItemsTableTable extends ShoppingListItemsTable
|
|
with TableInfo<$ShoppingListItemsTableTable, ShoppingListItemRecord> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ShoppingListItemsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 128),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _requiredQuantityMeta =
|
|
const VerificationMeta('requiredQuantity');
|
|
@override
|
|
late final GeneratedColumn<double> requiredQuantity = GeneratedColumn<double>(
|
|
'required_quantity', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _unitMeta = const VerificationMeta('unit');
|
|
@override
|
|
late final GeneratedColumn<String> unit = GeneratedColumn<String>(
|
|
'unit', aliasedName, false,
|
|
additionalChecks:
|
|
GeneratedColumn.checkTextLength(minTextLength: 1, maxTextLength: 16),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true);
|
|
static const VerificationMeta _isPurchasedMeta =
|
|
const VerificationMeta('isPurchased');
|
|
@override
|
|
late final GeneratedColumn<bool> isPurchased = GeneratedColumn<bool>(
|
|
'is_purchased', aliasedName, false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_purchased" IN (0, 1))'),
|
|
defaultValue: const Constant(false));
|
|
static const VerificationMeta _isAutoGeneratedMeta =
|
|
const VerificationMeta('isAutoGenerated');
|
|
@override
|
|
late final GeneratedColumn<bool> isAutoGenerated = GeneratedColumn<bool>(
|
|
'is_auto_generated', aliasedName, false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_auto_generated" IN (0, 1))'),
|
|
defaultValue: const Constant(false));
|
|
static const VerificationMeta _sourceNotesMeta =
|
|
const VerificationMeta('sourceNotes');
|
|
@override
|
|
late final GeneratedColumn<String> sourceNotes = GeneratedColumn<String>(
|
|
'source_notes', aliasedName, true,
|
|
type: DriftSqlType.string, requiredDuringInsert: false);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
requiredQuantity,
|
|
unit,
|
|
isPurchased,
|
|
isAutoGenerated,
|
|
sourceNotes
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'shopping_list_items_table';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ShoppingListItemRecord> instance,
|
|
{bool isInserting = false}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('required_quantity')) {
|
|
context.handle(
|
|
_requiredQuantityMeta,
|
|
requiredQuantity.isAcceptableOrUnknown(
|
|
data['required_quantity']!, _requiredQuantityMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_requiredQuantityMeta);
|
|
}
|
|
if (data.containsKey('unit')) {
|
|
context.handle(
|
|
_unitMeta, unit.isAcceptableOrUnknown(data['unit']!, _unitMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_unitMeta);
|
|
}
|
|
if (data.containsKey('is_purchased')) {
|
|
context.handle(
|
|
_isPurchasedMeta,
|
|
isPurchased.isAcceptableOrUnknown(
|
|
data['is_purchased']!, _isPurchasedMeta));
|
|
}
|
|
if (data.containsKey('is_auto_generated')) {
|
|
context.handle(
|
|
_isAutoGeneratedMeta,
|
|
isAutoGenerated.isAcceptableOrUnknown(
|
|
data['is_auto_generated']!, _isAutoGeneratedMeta));
|
|
}
|
|
if (data.containsKey('source_notes')) {
|
|
context.handle(
|
|
_sourceNotesMeta,
|
|
sourceNotes.isAcceptableOrUnknown(
|
|
data['source_notes']!, _sourceNotesMeta));
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ShoppingListItemRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ShoppingListItemRecord(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}id'])!,
|
|
name: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}name'])!,
|
|
requiredQuantity: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double, data['${effectivePrefix}required_quantity'])!,
|
|
unit: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}unit'])!,
|
|
isPurchased: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.bool, data['${effectivePrefix}is_purchased'])!,
|
|
isAutoGenerated: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool, data['${effectivePrefix}is_auto_generated'])!,
|
|
sourceNotes: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}source_notes']),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ShoppingListItemsTableTable createAlias(String alias) {
|
|
return $ShoppingListItemsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ShoppingListItemRecord extends DataClass
|
|
implements Insertable<ShoppingListItemRecord> {
|
|
/// UUID primary key.
|
|
final String id;
|
|
final String name;
|
|
|
|
/// Amount needed, expressed in [unit].
|
|
final double requiredQuantity;
|
|
|
|
/// Canonical unit key (e.g. `g`, `count`).
|
|
final String unit;
|
|
final bool isPurchased;
|
|
final bool isAutoGenerated;
|
|
|
|
/// JSON-encoded `List<String>` of contributing recipe titles for
|
|
/// auto-generated rows; `null` for manual entries.
|
|
final String? sourceNotes;
|
|
const ShoppingListItemRecord(
|
|
{required this.id,
|
|
required this.name,
|
|
required this.requiredQuantity,
|
|
required this.unit,
|
|
required this.isPurchased,
|
|
required this.isAutoGenerated,
|
|
this.sourceNotes});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['required_quantity'] = Variable<double>(requiredQuantity);
|
|
map['unit'] = Variable<String>(unit);
|
|
map['is_purchased'] = Variable<bool>(isPurchased);
|
|
map['is_auto_generated'] = Variable<bool>(isAutoGenerated);
|
|
if (!nullToAbsent || sourceNotes != null) {
|
|
map['source_notes'] = Variable<String>(sourceNotes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ShoppingListItemsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return ShoppingListItemsTableCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
requiredQuantity: Value(requiredQuantity),
|
|
unit: Value(unit),
|
|
isPurchased: Value(isPurchased),
|
|
isAutoGenerated: Value(isAutoGenerated),
|
|
sourceNotes: sourceNotes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceNotes),
|
|
);
|
|
}
|
|
|
|
factory ShoppingListItemRecord.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ShoppingListItemRecord(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
requiredQuantity: serializer.fromJson<double>(json['requiredQuantity']),
|
|
unit: serializer.fromJson<String>(json['unit']),
|
|
isPurchased: serializer.fromJson<bool>(json['isPurchased']),
|
|
isAutoGenerated: serializer.fromJson<bool>(json['isAutoGenerated']),
|
|
sourceNotes: serializer.fromJson<String?>(json['sourceNotes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'requiredQuantity': serializer.toJson<double>(requiredQuantity),
|
|
'unit': serializer.toJson<String>(unit),
|
|
'isPurchased': serializer.toJson<bool>(isPurchased),
|
|
'isAutoGenerated': serializer.toJson<bool>(isAutoGenerated),
|
|
'sourceNotes': serializer.toJson<String?>(sourceNotes),
|
|
};
|
|
}
|
|
|
|
ShoppingListItemRecord copyWith(
|
|
{String? id,
|
|
String? name,
|
|
double? requiredQuantity,
|
|
String? unit,
|
|
bool? isPurchased,
|
|
bool? isAutoGenerated,
|
|
Value<String?> sourceNotes = const Value.absent()}) =>
|
|
ShoppingListItemRecord(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
requiredQuantity: requiredQuantity ?? this.requiredQuantity,
|
|
unit: unit ?? this.unit,
|
|
isPurchased: isPurchased ?? this.isPurchased,
|
|
isAutoGenerated: isAutoGenerated ?? this.isAutoGenerated,
|
|
sourceNotes: sourceNotes.present ? sourceNotes.value : this.sourceNotes,
|
|
);
|
|
ShoppingListItemRecord copyWithCompanion(
|
|
ShoppingListItemsTableCompanion data) {
|
|
return ShoppingListItemRecord(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
requiredQuantity: data.requiredQuantity.present
|
|
? data.requiredQuantity.value
|
|
: this.requiredQuantity,
|
|
unit: data.unit.present ? data.unit.value : this.unit,
|
|
isPurchased:
|
|
data.isPurchased.present ? data.isPurchased.value : this.isPurchased,
|
|
isAutoGenerated: data.isAutoGenerated.present
|
|
? data.isAutoGenerated.value
|
|
: this.isAutoGenerated,
|
|
sourceNotes:
|
|
data.sourceNotes.present ? data.sourceNotes.value : this.sourceNotes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ShoppingListItemRecord(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('requiredQuantity: $requiredQuantity, ')
|
|
..write('unit: $unit, ')
|
|
..write('isPurchased: $isPurchased, ')
|
|
..write('isAutoGenerated: $isAutoGenerated, ')
|
|
..write('sourceNotes: $sourceNotes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, requiredQuantity, unit, isPurchased,
|
|
isAutoGenerated, sourceNotes);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ShoppingListItemRecord &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.requiredQuantity == this.requiredQuantity &&
|
|
other.unit == this.unit &&
|
|
other.isPurchased == this.isPurchased &&
|
|
other.isAutoGenerated == this.isAutoGenerated &&
|
|
other.sourceNotes == this.sourceNotes);
|
|
}
|
|
|
|
class ShoppingListItemsTableCompanion
|
|
extends UpdateCompanion<ShoppingListItemRecord> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<double> requiredQuantity;
|
|
final Value<String> unit;
|
|
final Value<bool> isPurchased;
|
|
final Value<bool> isAutoGenerated;
|
|
final Value<String?> sourceNotes;
|
|
final Value<int> rowid;
|
|
const ShoppingListItemsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.requiredQuantity = const Value.absent(),
|
|
this.unit = const Value.absent(),
|
|
this.isPurchased = const Value.absent(),
|
|
this.isAutoGenerated = const Value.absent(),
|
|
this.sourceNotes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ShoppingListItemsTableCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required double requiredQuantity,
|
|
required String unit,
|
|
this.isPurchased = const Value.absent(),
|
|
this.isAutoGenerated = const Value.absent(),
|
|
this.sourceNotes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
requiredQuantity = Value(requiredQuantity),
|
|
unit = Value(unit);
|
|
static Insertable<ShoppingListItemRecord> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<double>? requiredQuantity,
|
|
Expression<String>? unit,
|
|
Expression<bool>? isPurchased,
|
|
Expression<bool>? isAutoGenerated,
|
|
Expression<String>? sourceNotes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (requiredQuantity != null) 'required_quantity': requiredQuantity,
|
|
if (unit != null) 'unit': unit,
|
|
if (isPurchased != null) 'is_purchased': isPurchased,
|
|
if (isAutoGenerated != null) 'is_auto_generated': isAutoGenerated,
|
|
if (sourceNotes != null) 'source_notes': sourceNotes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ShoppingListItemsTableCompanion copyWith(
|
|
{Value<String>? id,
|
|
Value<String>? name,
|
|
Value<double>? requiredQuantity,
|
|
Value<String>? unit,
|
|
Value<bool>? isPurchased,
|
|
Value<bool>? isAutoGenerated,
|
|
Value<String?>? sourceNotes,
|
|
Value<int>? rowid}) {
|
|
return ShoppingListItemsTableCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
requiredQuantity: requiredQuantity ?? this.requiredQuantity,
|
|
unit: unit ?? this.unit,
|
|
isPurchased: isPurchased ?? this.isPurchased,
|
|
isAutoGenerated: isAutoGenerated ?? this.isAutoGenerated,
|
|
sourceNotes: sourceNotes ?? this.sourceNotes,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (requiredQuantity.present) {
|
|
map['required_quantity'] = Variable<double>(requiredQuantity.value);
|
|
}
|
|
if (unit.present) {
|
|
map['unit'] = Variable<String>(unit.value);
|
|
}
|
|
if (isPurchased.present) {
|
|
map['is_purchased'] = Variable<bool>(isPurchased.value);
|
|
}
|
|
if (isAutoGenerated.present) {
|
|
map['is_auto_generated'] = Variable<bool>(isAutoGenerated.value);
|
|
}
|
|
if (sourceNotes.present) {
|
|
map['source_notes'] = Variable<String>(sourceNotes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ShoppingListItemsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('requiredQuantity: $requiredQuantity, ')
|
|
..write('unit: $unit, ')
|
|
..write('isPurchased: $isPurchased, ')
|
|
..write('isAutoGenerated: $isAutoGenerated, ')
|
|
..write('sourceNotes: $sourceNotes, ')
|
|
..write('rowid: $rowid')
|
|
..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);
|
|
late final $RecipesTableTable recipesTable = $RecipesTableTable(this);
|
|
late final $MealPlanSlotsTableTable mealPlanSlotsTable =
|
|
$MealPlanSlotsTableTable(this);
|
|
late final $PantryItemsTableTable pantryItemsTable =
|
|
$PantryItemsTableTable(this);
|
|
late final $ShoppingListItemsTableTable shoppingListItemsTable =
|
|
$ShoppingListItemsTableTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
medicationDosesTable,
|
|
foodLogsTable,
|
|
hydrationLogsTable,
|
|
biometricLogsTable,
|
|
recipesTable,
|
|
mealPlanSlotsTable,
|
|
pantryItemsTable,
|
|
shoppingListItemsTable
|
|
];
|
|
@override
|
|
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules(
|
|
[
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName('recipes_table',
|
|
limitUpdateKind: UpdateKind.delete),
|
|
result: [
|
|
TableUpdate('meal_plan_slots_table', kind: UpdateKind.update),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
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()>;
|
|
typedef $$RecipesTableTableCreateCompanionBuilder = RecipesTableCompanion
|
|
Function({
|
|
required String id,
|
|
required String title,
|
|
required String sourceUrl,
|
|
Value<String?> imageUrl,
|
|
Value<String?> description,
|
|
Value<int?> prepTimeMinutes,
|
|
Value<int?> cookTimeMinutes,
|
|
Value<int> servings,
|
|
required String rawIngredientsJson,
|
|
required String instructionsJson,
|
|
Value<int> calories,
|
|
Value<double> proteinGrams,
|
|
Value<double> carbsGrams,
|
|
Value<double> fatGrams,
|
|
required DateTime createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$RecipesTableTableUpdateCompanionBuilder = RecipesTableCompanion
|
|
Function({
|
|
Value<String> id,
|
|
Value<String> title,
|
|
Value<String> sourceUrl,
|
|
Value<String?> imageUrl,
|
|
Value<String?> description,
|
|
Value<int?> prepTimeMinutes,
|
|
Value<int?> cookTimeMinutes,
|
|
Value<int> servings,
|
|
Value<String> rawIngredientsJson,
|
|
Value<String> instructionsJson,
|
|
Value<int> calories,
|
|
Value<double> proteinGrams,
|
|
Value<double> carbsGrams,
|
|
Value<double> fatGrams,
|
|
Value<DateTime> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$RecipesTableTableReferences
|
|
extends BaseReferences<_$AppDatabase, $RecipesTableTable, RecipeRecord> {
|
|
$$RecipesTableTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$MealPlanSlotsTableTable, List<MealPlanSlotRecord>>
|
|
_mealPlanSlotsTableRefsTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(db.mealPlanSlotsTable,
|
|
aliasName: 'recipes_table__id__meal_plan_slots_table__recipe_id');
|
|
|
|
$$MealPlanSlotsTableTableProcessedTableManager get mealPlanSlotsTableRefs {
|
|
final manager = $$MealPlanSlotsTableTableTableManager(
|
|
$_db, $_db.mealPlanSlotsTable)
|
|
.filter((f) => f.recipeId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache =
|
|
$_typedResult.readTableOrNull(_mealPlanSlotsTableRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache));
|
|
}
|
|
}
|
|
|
|
class $$RecipesTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $RecipesTableTable> {
|
|
$$RecipesTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get sourceUrl => $composableBuilder(
|
|
column: $table.sourceUrl, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get imageUrl => $composableBuilder(
|
|
column: $table.imageUrl, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<int> get prepTimeMinutes => $composableBuilder(
|
|
column: $table.prepTimeMinutes,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<int> get cookTimeMinutes => $composableBuilder(
|
|
column: $table.cookTimeMinutes,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<int> get servings => $composableBuilder(
|
|
column: $table.servings, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get rawIngredientsJson => $composableBuilder(
|
|
column: $table.rawIngredientsJson,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get instructionsJson => $composableBuilder(
|
|
column: $table.instructionsJson,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<int> get calories => $composableBuilder(
|
|
column: $table.calories, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams, 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));
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt, builder: (column) => ColumnFilters(column));
|
|
|
|
Expression<bool> mealPlanSlotsTableRefs(
|
|
Expression<bool> Function($$MealPlanSlotsTableTableFilterComposer f) f) {
|
|
final $$MealPlanSlotsTableTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.mealPlanSlotsTable,
|
|
getReferencedColumn: (t) => t.recipeId,
|
|
builder: (joinBuilder,
|
|
{$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer}) =>
|
|
$$MealPlanSlotsTableTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.mealPlanSlotsTable,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
));
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$RecipesTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $RecipesTableTable> {
|
|
$$RecipesTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get sourceUrl => $composableBuilder(
|
|
column: $table.sourceUrl, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get imageUrl => $composableBuilder(
|
|
column: $table.imageUrl, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<int> get prepTimeMinutes => $composableBuilder(
|
|
column: $table.prepTimeMinutes,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<int> get cookTimeMinutes => $composableBuilder(
|
|
column: $table.cookTimeMinutes,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<int> get servings => $composableBuilder(
|
|
column: $table.servings, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get rawIngredientsJson => $composableBuilder(
|
|
column: $table.rawIngredientsJson,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get instructionsJson => $composableBuilder(
|
|
column: $table.instructionsJson,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<int> get calories => $composableBuilder(
|
|
column: $table.calories, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams,
|
|
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));
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$RecipesTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $RecipesTableTable> {
|
|
$$RecipesTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get sourceUrl =>
|
|
$composableBuilder(column: $table.sourceUrl, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get imageUrl =>
|
|
$composableBuilder(column: $table.imageUrl, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get prepTimeMinutes => $composableBuilder(
|
|
column: $table.prepTimeMinutes, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get cookTimeMinutes => $composableBuilder(
|
|
column: $table.cookTimeMinutes, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get servings =>
|
|
$composableBuilder(column: $table.servings, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get rawIngredientsJson => $composableBuilder(
|
|
column: $table.rawIngredientsJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get instructionsJson => $composableBuilder(
|
|
column: $table.instructionsJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get calories =>
|
|
$composableBuilder(column: $table.calories, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get proteinGrams => $composableBuilder(
|
|
column: $table.proteinGrams, 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);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
Expression<T> mealPlanSlotsTableRefs<T extends Object>(
|
|
Expression<T> Function($$MealPlanSlotsTableTableAnnotationComposer a) f) {
|
|
final $$MealPlanSlotsTableTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.mealPlanSlotsTable,
|
|
getReferencedColumn: (t) => t.recipeId,
|
|
builder: (joinBuilder,
|
|
{$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer}) =>
|
|
$$MealPlanSlotsTableTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.mealPlanSlotsTable,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
));
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$RecipesTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$RecipesTableTable,
|
|
RecipeRecord,
|
|
$$RecipesTableTableFilterComposer,
|
|
$$RecipesTableTableOrderingComposer,
|
|
$$RecipesTableTableAnnotationComposer,
|
|
$$RecipesTableTableCreateCompanionBuilder,
|
|
$$RecipesTableTableUpdateCompanionBuilder,
|
|
(RecipeRecord, $$RecipesTableTableReferences),
|
|
RecipeRecord,
|
|
PrefetchHooks Function({bool mealPlanSlotsTableRefs})> {
|
|
$$RecipesTableTableTableManager(_$AppDatabase db, $RecipesTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$RecipesTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$RecipesTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$RecipesTableTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String> sourceUrl = const Value.absent(),
|
|
Value<String?> imageUrl = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> prepTimeMinutes = const Value.absent(),
|
|
Value<int?> cookTimeMinutes = const Value.absent(),
|
|
Value<int> servings = const Value.absent(),
|
|
Value<String> rawIngredientsJson = const Value.absent(),
|
|
Value<String> instructionsJson = const Value.absent(),
|
|
Value<int> calories = const Value.absent(),
|
|
Value<double> proteinGrams = const Value.absent(),
|
|
Value<double> carbsGrams = const Value.absent(),
|
|
Value<double> fatGrams = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
RecipesTableCompanion(
|
|
id: id,
|
|
title: title,
|
|
sourceUrl: sourceUrl,
|
|
imageUrl: imageUrl,
|
|
description: description,
|
|
prepTimeMinutes: prepTimeMinutes,
|
|
cookTimeMinutes: cookTimeMinutes,
|
|
servings: servings,
|
|
rawIngredientsJson: rawIngredientsJson,
|
|
instructionsJson: instructionsJson,
|
|
calories: calories,
|
|
proteinGrams: proteinGrams,
|
|
carbsGrams: carbsGrams,
|
|
fatGrams: fatGrams,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback: ({
|
|
required String id,
|
|
required String title,
|
|
required String sourceUrl,
|
|
Value<String?> imageUrl = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> prepTimeMinutes = const Value.absent(),
|
|
Value<int?> cookTimeMinutes = const Value.absent(),
|
|
Value<int> servings = const Value.absent(),
|
|
required String rawIngredientsJson,
|
|
required String instructionsJson,
|
|
Value<int> calories = const Value.absent(),
|
|
Value<double> proteinGrams = const Value.absent(),
|
|
Value<double> carbsGrams = const Value.absent(),
|
|
Value<double> fatGrams = const Value.absent(),
|
|
required DateTime createdAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
RecipesTableCompanion.insert(
|
|
id: id,
|
|
title: title,
|
|
sourceUrl: sourceUrl,
|
|
imageUrl: imageUrl,
|
|
description: description,
|
|
prepTimeMinutes: prepTimeMinutes,
|
|
cookTimeMinutes: cookTimeMinutes,
|
|
servings: servings,
|
|
rawIngredientsJson: rawIngredientsJson,
|
|
instructionsJson: instructionsJson,
|
|
calories: calories,
|
|
proteinGrams: proteinGrams,
|
|
carbsGrams: carbsGrams,
|
|
fatGrams: fatGrams,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$RecipesTableTable, RecipeRecord>(table),
|
|
$$RecipesTableTableReferences(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: ({mealPlanSlotsTableRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (mealPlanSlotsTableRefs) db.mealPlanSlotsTable
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (mealPlanSlotsTableRefs)
|
|
await $_getPrefetchedData<RecipeRecord, $RecipesTableTable,
|
|
MealPlanSlotRecord>(
|
|
currentTable: table,
|
|
referencedTable: $$RecipesTableTableReferences
|
|
._mealPlanSlotsTableRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$RecipesTableTableReferences(db, table, p0)
|
|
.mealPlanSlotsTableRefs,
|
|
referencedItemsForCurrentItem: (item,
|
|
referencedItems) =>
|
|
referencedItems.where((e) => e.recipeId == item.id),
|
|
typedResults: items)
|
|
];
|
|
},
|
|
);
|
|
},
|
|
));
|
|
}
|
|
|
|
typedef $$RecipesTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$RecipesTableTable,
|
|
RecipeRecord,
|
|
$$RecipesTableTableFilterComposer,
|
|
$$RecipesTableTableOrderingComposer,
|
|
$$RecipesTableTableAnnotationComposer,
|
|
$$RecipesTableTableCreateCompanionBuilder,
|
|
$$RecipesTableTableUpdateCompanionBuilder,
|
|
(RecipeRecord, $$RecipesTableTableReferences),
|
|
RecipeRecord,
|
|
PrefetchHooks Function({bool mealPlanSlotsTableRefs})>;
|
|
typedef $$MealPlanSlotsTableTableCreateCompanionBuilder
|
|
= MealPlanSlotsTableCompanion Function({
|
|
required String id,
|
|
required DateTime plannedDate,
|
|
required String mealType,
|
|
Value<String?> recipeId,
|
|
Value<String?> customNotes,
|
|
Value<bool> isCompleted,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$MealPlanSlotsTableTableUpdateCompanionBuilder
|
|
= MealPlanSlotsTableCompanion Function({
|
|
Value<String> id,
|
|
Value<DateTime> plannedDate,
|
|
Value<String> mealType,
|
|
Value<String?> recipeId,
|
|
Value<String?> customNotes,
|
|
Value<bool> isCompleted,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$MealPlanSlotsTableTableReferences extends BaseReferences<
|
|
_$AppDatabase, $MealPlanSlotsTableTable, MealPlanSlotRecord> {
|
|
$$MealPlanSlotsTableTableReferences(
|
|
super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $RecipesTableTable _recipeIdTable(_$AppDatabase db) => db.recipesTable
|
|
.createAlias('meal_plan_slots_table__recipe_id__recipes_table__id');
|
|
|
|
$$RecipesTableTableProcessedTableManager? get recipeId {
|
|
final $_column = $_itemColumn<String>('recipe_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$RecipesTableTableTableManager($_db, $_db.recipesTable)
|
|
.filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_recipeIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]));
|
|
}
|
|
}
|
|
|
|
class $$MealPlanSlotsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MealPlanSlotsTableTable> {
|
|
$$MealPlanSlotsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get plannedDate => $composableBuilder(
|
|
column: $table.plannedDate, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get mealType => $composableBuilder(
|
|
column: $table.mealType, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get customNotes => $composableBuilder(
|
|
column: $table.customNotes, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<bool> get isCompleted => $composableBuilder(
|
|
column: $table.isCompleted, builder: (column) => ColumnFilters(column));
|
|
|
|
$$RecipesTableTableFilterComposer get recipeId {
|
|
final $$RecipesTableTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.recipeId,
|
|
referencedTable: $db.recipesTable,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder: (joinBuilder,
|
|
{$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer}) =>
|
|
$$RecipesTableTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.recipesTable,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
));
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$MealPlanSlotsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MealPlanSlotsTableTable> {
|
|
$$MealPlanSlotsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get plannedDate => $composableBuilder(
|
|
column: $table.plannedDate, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get mealType => $composableBuilder(
|
|
column: $table.mealType, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get customNotes => $composableBuilder(
|
|
column: $table.customNotes, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<bool> get isCompleted => $composableBuilder(
|
|
column: $table.isCompleted, builder: (column) => ColumnOrderings(column));
|
|
|
|
$$RecipesTableTableOrderingComposer get recipeId {
|
|
final $$RecipesTableTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.recipeId,
|
|
referencedTable: $db.recipesTable,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder: (joinBuilder,
|
|
{$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer}) =>
|
|
$$RecipesTableTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.recipesTable,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
));
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$MealPlanSlotsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MealPlanSlotsTableTable> {
|
|
$$MealPlanSlotsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get plannedDate => $composableBuilder(
|
|
column: $table.plannedDate, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get mealType =>
|
|
$composableBuilder(column: $table.mealType, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get customNotes => $composableBuilder(
|
|
column: $table.customNotes, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isCompleted => $composableBuilder(
|
|
column: $table.isCompleted, builder: (column) => column);
|
|
|
|
$$RecipesTableTableAnnotationComposer get recipeId {
|
|
final $$RecipesTableTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.recipeId,
|
|
referencedTable: $db.recipesTable,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder: (joinBuilder,
|
|
{$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer}) =>
|
|
$$RecipesTableTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.recipesTable,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
));
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$MealPlanSlotsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$MealPlanSlotsTableTable,
|
|
MealPlanSlotRecord,
|
|
$$MealPlanSlotsTableTableFilterComposer,
|
|
$$MealPlanSlotsTableTableOrderingComposer,
|
|
$$MealPlanSlotsTableTableAnnotationComposer,
|
|
$$MealPlanSlotsTableTableCreateCompanionBuilder,
|
|
$$MealPlanSlotsTableTableUpdateCompanionBuilder,
|
|
(MealPlanSlotRecord, $$MealPlanSlotsTableTableReferences),
|
|
MealPlanSlotRecord,
|
|
PrefetchHooks Function({bool recipeId})> {
|
|
$$MealPlanSlotsTableTableTableManager(
|
|
_$AppDatabase db, $MealPlanSlotsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MealPlanSlotsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MealPlanSlotsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MealPlanSlotsTableTableAnnotationComposer(
|
|
$db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<String> id = const Value.absent(),
|
|
Value<DateTime> plannedDate = const Value.absent(),
|
|
Value<String> mealType = const Value.absent(),
|
|
Value<String?> recipeId = const Value.absent(),
|
|
Value<String?> customNotes = const Value.absent(),
|
|
Value<bool> isCompleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
MealPlanSlotsTableCompanion(
|
|
id: id,
|
|
plannedDate: plannedDate,
|
|
mealType: mealType,
|
|
recipeId: recipeId,
|
|
customNotes: customNotes,
|
|
isCompleted: isCompleted,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback: ({
|
|
required String id,
|
|
required DateTime plannedDate,
|
|
required String mealType,
|
|
Value<String?> recipeId = const Value.absent(),
|
|
Value<String?> customNotes = const Value.absent(),
|
|
Value<bool> isCompleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
MealPlanSlotsTableCompanion.insert(
|
|
id: id,
|
|
plannedDate: plannedDate,
|
|
mealType: mealType,
|
|
recipeId: recipeId,
|
|
customNotes: customNotes,
|
|
isCompleted: isCompleted,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$MealPlanSlotsTableTable, MealPlanSlotRecord>(
|
|
table),
|
|
$$MealPlanSlotsTableTableReferences(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: ({recipeId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins: <
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic>>(state) {
|
|
if (recipeId) {
|
|
state = state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.recipeId,
|
|
referencedTable:
|
|
$$MealPlanSlotsTableTableReferences._recipeIdTable(db),
|
|
referencedColumn: $$MealPlanSlotsTableTableReferences
|
|
._recipeIdTable(db)
|
|
.id,
|
|
) as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
));
|
|
}
|
|
|
|
typedef $$MealPlanSlotsTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MealPlanSlotsTableTable,
|
|
MealPlanSlotRecord,
|
|
$$MealPlanSlotsTableTableFilterComposer,
|
|
$$MealPlanSlotsTableTableOrderingComposer,
|
|
$$MealPlanSlotsTableTableAnnotationComposer,
|
|
$$MealPlanSlotsTableTableCreateCompanionBuilder,
|
|
$$MealPlanSlotsTableTableUpdateCompanionBuilder,
|
|
(MealPlanSlotRecord, $$MealPlanSlotsTableTableReferences),
|
|
MealPlanSlotRecord,
|
|
PrefetchHooks Function({bool recipeId})>;
|
|
typedef $$PantryItemsTableTableCreateCompanionBuilder
|
|
= PantryItemsTableCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required double quantityOnHand,
|
|
required String unit,
|
|
required String category,
|
|
Value<DateTime?> expirationDate,
|
|
required DateTime lastUpdated,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PantryItemsTableTableUpdateCompanionBuilder
|
|
= PantryItemsTableCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<double> quantityOnHand,
|
|
Value<String> unit,
|
|
Value<String> category,
|
|
Value<DateTime?> expirationDate,
|
|
Value<DateTime> lastUpdated,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$PantryItemsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $PantryItemsTableTable> {
|
|
$$PantryItemsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get quantityOnHand => $composableBuilder(
|
|
column: $table.quantityOnHand,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get unit => $composableBuilder(
|
|
column: $table.unit, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get category => $composableBuilder(
|
|
column: $table.category, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get expirationDate => $composableBuilder(
|
|
column: $table.expirationDate,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<DateTime> get lastUpdated => $composableBuilder(
|
|
column: $table.lastUpdated, builder: (column) => ColumnFilters(column));
|
|
}
|
|
|
|
class $$PantryItemsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $PantryItemsTableTable> {
|
|
$$PantryItemsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get quantityOnHand => $composableBuilder(
|
|
column: $table.quantityOnHand,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get unit => $composableBuilder(
|
|
column: $table.unit, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get category => $composableBuilder(
|
|
column: $table.category, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get expirationDate => $composableBuilder(
|
|
column: $table.expirationDate,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<DateTime> get lastUpdated => $composableBuilder(
|
|
column: $table.lastUpdated, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$PantryItemsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $PantryItemsTableTable> {
|
|
$$PantryItemsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get quantityOnHand => $composableBuilder(
|
|
column: $table.quantityOnHand, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get unit =>
|
|
$composableBuilder(column: $table.unit, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get category =>
|
|
$composableBuilder(column: $table.category, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get expirationDate => $composableBuilder(
|
|
column: $table.expirationDate, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get lastUpdated => $composableBuilder(
|
|
column: $table.lastUpdated, builder: (column) => column);
|
|
}
|
|
|
|
class $$PantryItemsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$PantryItemsTableTable,
|
|
PantryItemRecord,
|
|
$$PantryItemsTableTableFilterComposer,
|
|
$$PantryItemsTableTableOrderingComposer,
|
|
$$PantryItemsTableTableAnnotationComposer,
|
|
$$PantryItemsTableTableCreateCompanionBuilder,
|
|
$$PantryItemsTableTableUpdateCompanionBuilder,
|
|
(
|
|
PantryItemRecord,
|
|
BaseReferences<_$AppDatabase, $PantryItemsTableTable, PantryItemRecord>
|
|
),
|
|
PantryItemRecord,
|
|
PrefetchHooks Function()> {
|
|
$$PantryItemsTableTableTableManager(
|
|
_$AppDatabase db, $PantryItemsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PantryItemsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PantryItemsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PantryItemsTableTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<double> quantityOnHand = const Value.absent(),
|
|
Value<String> unit = const Value.absent(),
|
|
Value<String> category = const Value.absent(),
|
|
Value<DateTime?> expirationDate = const Value.absent(),
|
|
Value<DateTime> lastUpdated = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
PantryItemsTableCompanion(
|
|
id: id,
|
|
name: name,
|
|
quantityOnHand: quantityOnHand,
|
|
unit: unit,
|
|
category: category,
|
|
expirationDate: expirationDate,
|
|
lastUpdated: lastUpdated,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback: ({
|
|
required String id,
|
|
required String name,
|
|
required double quantityOnHand,
|
|
required String unit,
|
|
required String category,
|
|
Value<DateTime?> expirationDate = const Value.absent(),
|
|
required DateTime lastUpdated,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
PantryItemsTableCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
quantityOnHand: quantityOnHand,
|
|
unit: unit,
|
|
category: category,
|
|
expirationDate: expirationDate,
|
|
lastUpdated: lastUpdated,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$PantryItemsTableTable, PantryItemRecord>(
|
|
table),
|
|
BaseReferences<_$AppDatabase, $PantryItemsTableTable,
|
|
PantryItemRecord>(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
));
|
|
}
|
|
|
|
typedef $$PantryItemsTableTableProcessedTableManager = ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$PantryItemsTableTable,
|
|
PantryItemRecord,
|
|
$$PantryItemsTableTableFilterComposer,
|
|
$$PantryItemsTableTableOrderingComposer,
|
|
$$PantryItemsTableTableAnnotationComposer,
|
|
$$PantryItemsTableTableCreateCompanionBuilder,
|
|
$$PantryItemsTableTableUpdateCompanionBuilder,
|
|
(
|
|
PantryItemRecord,
|
|
BaseReferences<_$AppDatabase, $PantryItemsTableTable, PantryItemRecord>
|
|
),
|
|
PantryItemRecord,
|
|
PrefetchHooks Function()>;
|
|
typedef $$ShoppingListItemsTableTableCreateCompanionBuilder
|
|
= ShoppingListItemsTableCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required double requiredQuantity,
|
|
required String unit,
|
|
Value<bool> isPurchased,
|
|
Value<bool> isAutoGenerated,
|
|
Value<String?> sourceNotes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ShoppingListItemsTableTableUpdateCompanionBuilder
|
|
= ShoppingListItemsTableCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<double> requiredQuantity,
|
|
Value<String> unit,
|
|
Value<bool> isPurchased,
|
|
Value<bool> isAutoGenerated,
|
|
Value<String?> sourceNotes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ShoppingListItemsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ShoppingListItemsTableTable> {
|
|
$$ShoppingListItemsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<double> get requiredQuantity => $composableBuilder(
|
|
column: $table.requiredQuantity,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get unit => $composableBuilder(
|
|
column: $table.unit, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<bool> get isPurchased => $composableBuilder(
|
|
column: $table.isPurchased, builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<bool> get isAutoGenerated => $composableBuilder(
|
|
column: $table.isAutoGenerated,
|
|
builder: (column) => ColumnFilters(column));
|
|
|
|
ColumnFilters<String> get sourceNotes => $composableBuilder(
|
|
column: $table.sourceNotes, builder: (column) => ColumnFilters(column));
|
|
}
|
|
|
|
class $$ShoppingListItemsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ShoppingListItemsTableTable> {
|
|
$$ShoppingListItemsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<double> get requiredQuantity => $composableBuilder(
|
|
column: $table.requiredQuantity,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get unit => $composableBuilder(
|
|
column: $table.unit, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<bool> get isPurchased => $composableBuilder(
|
|
column: $table.isPurchased, builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<bool> get isAutoGenerated => $composableBuilder(
|
|
column: $table.isAutoGenerated,
|
|
builder: (column) => ColumnOrderings(column));
|
|
|
|
ColumnOrderings<String> get sourceNotes => $composableBuilder(
|
|
column: $table.sourceNotes, builder: (column) => ColumnOrderings(column));
|
|
}
|
|
|
|
class $$ShoppingListItemsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ShoppingListItemsTableTable> {
|
|
$$ShoppingListItemsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get requiredQuantity => $composableBuilder(
|
|
column: $table.requiredQuantity, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get unit =>
|
|
$composableBuilder(column: $table.unit, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isPurchased => $composableBuilder(
|
|
column: $table.isPurchased, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get isAutoGenerated => $composableBuilder(
|
|
column: $table.isAutoGenerated, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get sourceNotes => $composableBuilder(
|
|
column: $table.sourceNotes, builder: (column) => column);
|
|
}
|
|
|
|
class $$ShoppingListItemsTableTableTableManager extends RootTableManager<
|
|
_$AppDatabase,
|
|
$ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord,
|
|
$$ShoppingListItemsTableTableFilterComposer,
|
|
$$ShoppingListItemsTableTableOrderingComposer,
|
|
$$ShoppingListItemsTableTableAnnotationComposer,
|
|
$$ShoppingListItemsTableTableCreateCompanionBuilder,
|
|
$$ShoppingListItemsTableTableUpdateCompanionBuilder,
|
|
(
|
|
ShoppingListItemRecord,
|
|
BaseReferences<_$AppDatabase, $ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord>
|
|
),
|
|
ShoppingListItemRecord,
|
|
PrefetchHooks Function()> {
|
|
$$ShoppingListItemsTableTableTableManager(
|
|
_$AppDatabase db, $ShoppingListItemsTableTable table)
|
|
: super(TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ShoppingListItemsTableTableFilterComposer(
|
|
$db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ShoppingListItemsTableTableOrderingComposer(
|
|
$db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ShoppingListItemsTableTableAnnotationComposer(
|
|
$db: db, $table: table),
|
|
updateCompanionCallback: ({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<double> requiredQuantity = const Value.absent(),
|
|
Value<String> unit = const Value.absent(),
|
|
Value<bool> isPurchased = const Value.absent(),
|
|
Value<bool> isAutoGenerated = const Value.absent(),
|
|
Value<String?> sourceNotes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
ShoppingListItemsTableCompanion(
|
|
id: id,
|
|
name: name,
|
|
requiredQuantity: requiredQuantity,
|
|
unit: unit,
|
|
isPurchased: isPurchased,
|
|
isAutoGenerated: isAutoGenerated,
|
|
sourceNotes: sourceNotes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback: ({
|
|
required String id,
|
|
required String name,
|
|
required double requiredQuantity,
|
|
required String unit,
|
|
Value<bool> isPurchased = const Value.absent(),
|
|
Value<bool> isAutoGenerated = const Value.absent(),
|
|
Value<String?> sourceNotes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
ShoppingListItemsTableCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
requiredQuantity: requiredQuantity,
|
|
unit: unit,
|
|
isPurchased: isPurchased,
|
|
isAutoGenerated: isAutoGenerated,
|
|
sourceNotes: sourceNotes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (
|
|
e.readTable<$ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord>(table),
|
|
BaseReferences<_$AppDatabase, $ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord>(db, table, e)
|
|
))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
));
|
|
}
|
|
|
|
typedef $$ShoppingListItemsTableTableProcessedTableManager
|
|
= ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord,
|
|
$$ShoppingListItemsTableTableFilterComposer,
|
|
$$ShoppingListItemsTableTableOrderingComposer,
|
|
$$ShoppingListItemsTableTableAnnotationComposer,
|
|
$$ShoppingListItemsTableTableCreateCompanionBuilder,
|
|
$$ShoppingListItemsTableTableUpdateCompanionBuilder,
|
|
(
|
|
ShoppingListItemRecord,
|
|
BaseReferences<_$AppDatabase, $ShoppingListItemsTableTable,
|
|
ShoppingListItemRecord>
|
|
),
|
|
ShoppingListItemRecord,
|
|
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);
|
|
$$RecipesTableTableTableManager get recipesTable =>
|
|
$$RecipesTableTableTableManager(_db, _db.recipesTable);
|
|
$$MealPlanSlotsTableTableTableManager get mealPlanSlotsTable =>
|
|
$$MealPlanSlotsTableTableTableManager(_db, _db.mealPlanSlotsTable);
|
|
$$PantryItemsTableTableTableManager get pantryItemsTable =>
|
|
$$PantryItemsTableTableTableManager(_db, _db.pantryItemsTable);
|
|
$$ShoppingListItemsTableTableTableManager get shoppingListItemsTable =>
|
|
$$ShoppingListItemsTableTableTableManager(
|
|
_db, _db.shoppingListItemsTable);
|
|
}
|