- Drift 21 tables (8 catalog + 11 user + habit_dose_variants + meta_kv) with R1~R10 CHECK constraints and 19 indexes - 8 hand-crafted seed JSON catalogs in app/assets/seed/ (refs 84, protocols 34, methodologies 21, frame_patterns 30, reward_menu_items 30, break_protocols 8, common_frames 5, diet_patterns 5) - 6 domain functions: recommend_variant, compute_streak, validate_frame_level, active_habit_quota, weekly_minimum_ratio, seed_importer (transactional, idempotent) - 4 vertical-slice Riverpod screens: HabitList, HabitCreate, CheckIn, Streak - 31 unit tests passing; flutter analyze clean - OQ-5 streak semantics: missing entry ≠ explicit blank (missing = end of history; only TrackerValue.blank triggers Never-miss-twice) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21755 lines
711 KiB
Dart
21755 lines
711 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $ProtocolsTable extends Protocols
|
|
with TableInfo<$ProtocolsTable, Protocol> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProtocolsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _categoryMeta = const VerificationMeta(
|
|
'category',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"category IN ('health','meditation','motivation','habit','learning','diet')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleEnMeta = const VerificationMeta(
|
|
'titleEn',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> titleEn = GeneratedColumn<String>(
|
|
'title_en',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _whatMeta = const VerificationMeta('what');
|
|
@override
|
|
late final GeneratedColumn<String> what = GeneratedColumn<String>(
|
|
'what',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _whenTextMeta = const VerificationMeta(
|
|
'whenText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> whenText = GeneratedColumn<String>(
|
|
'when_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _doseMeta = const VerificationMeta('dose');
|
|
@override
|
|
late final GeneratedColumn<String> dose = GeneratedColumn<String>(
|
|
'dose',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _whyMeta = const VerificationMeta('why');
|
|
@override
|
|
late final GeneratedColumn<String> why = GeneratedColumn<String>(
|
|
'why',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _howJsonMeta = const VerificationMeta(
|
|
'howJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> howJson = GeneratedColumn<String>(
|
|
'how_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _checkTextMeta = const VerificationMeta(
|
|
'checkText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> checkText = GeneratedColumn<String>(
|
|
'check_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _cautionMeta = const VerificationMeta(
|
|
'caution',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> caution = GeneratedColumn<String>(
|
|
'caution',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _defaultAnchorJsonMeta = const VerificationMeta(
|
|
'defaultAnchorJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> defaultAnchorJson =
|
|
GeneratedColumn<String>(
|
|
'default_anchor_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _minDoseForStartMeta = const VerificationMeta(
|
|
'minDoseForStart',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> minDoseForStart = GeneratedColumn<String>(
|
|
'min_dose_for_start',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta(
|
|
'referenceIdsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> referenceIdsJson = GeneratedColumn<String>(
|
|
'reference_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta(
|
|
'evidenceStrength',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> evidenceStrength = GeneratedColumn<String>(
|
|
'evidence_strength',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"evidence_strength IS NULL OR evidence_strength IN ('strong_rct','meta_analysis','observational','mechanistic','expert_opinion')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _sourceDocMeta = const VerificationMeta(
|
|
'sourceDoc',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sourceDoc = GeneratedColumn<String>(
|
|
'source_doc',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"source_doc IS NULL OR source_doc IN ('huberman-protocols.md','diet-protocols.md')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
category,
|
|
title,
|
|
titleEn,
|
|
what,
|
|
whenText,
|
|
dose,
|
|
why,
|
|
howJson,
|
|
checkText,
|
|
caution,
|
|
defaultAnchorJson,
|
|
minDoseForStart,
|
|
referenceIdsJson,
|
|
evidenceStrength,
|
|
sourceDoc,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'protocols';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Protocol> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('category')) {
|
|
context.handle(
|
|
_categoryMeta,
|
|
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_categoryMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('title_en')) {
|
|
context.handle(
|
|
_titleEnMeta,
|
|
titleEn.isAcceptableOrUnknown(data['title_en']!, _titleEnMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('what')) {
|
|
context.handle(
|
|
_whatMeta,
|
|
what.isAcceptableOrUnknown(data['what']!, _whatMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_whatMeta);
|
|
}
|
|
if (data.containsKey('when_text')) {
|
|
context.handle(
|
|
_whenTextMeta,
|
|
whenText.isAcceptableOrUnknown(data['when_text']!, _whenTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_whenTextMeta);
|
|
}
|
|
if (data.containsKey('dose')) {
|
|
context.handle(
|
|
_doseMeta,
|
|
dose.isAcceptableOrUnknown(data['dose']!, _doseMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_doseMeta);
|
|
}
|
|
if (data.containsKey('why')) {
|
|
context.handle(
|
|
_whyMeta,
|
|
why.isAcceptableOrUnknown(data['why']!, _whyMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_whyMeta);
|
|
}
|
|
if (data.containsKey('how_json')) {
|
|
context.handle(
|
|
_howJsonMeta,
|
|
howJson.isAcceptableOrUnknown(data['how_json']!, _howJsonMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_howJsonMeta);
|
|
}
|
|
if (data.containsKey('check_text')) {
|
|
context.handle(
|
|
_checkTextMeta,
|
|
checkText.isAcceptableOrUnknown(data['check_text']!, _checkTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_checkTextMeta);
|
|
}
|
|
if (data.containsKey('caution')) {
|
|
context.handle(
|
|
_cautionMeta,
|
|
caution.isAcceptableOrUnknown(data['caution']!, _cautionMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('default_anchor_json')) {
|
|
context.handle(
|
|
_defaultAnchorJsonMeta,
|
|
defaultAnchorJson.isAcceptableOrUnknown(
|
|
data['default_anchor_json']!,
|
|
_defaultAnchorJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('min_dose_for_start')) {
|
|
context.handle(
|
|
_minDoseForStartMeta,
|
|
minDoseForStart.isAcceptableOrUnknown(
|
|
data['min_dose_for_start']!,
|
|
_minDoseForStartMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reference_ids_json')) {
|
|
context.handle(
|
|
_referenceIdsJsonMeta,
|
|
referenceIdsJson.isAcceptableOrUnknown(
|
|
data['reference_ids_json']!,
|
|
_referenceIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('evidence_strength')) {
|
|
context.handle(
|
|
_evidenceStrengthMeta,
|
|
evidenceStrength.isAcceptableOrUnknown(
|
|
data['evidence_strength']!,
|
|
_evidenceStrengthMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('source_doc')) {
|
|
context.handle(
|
|
_sourceDocMeta,
|
|
sourceDoc.isAcceptableOrUnknown(data['source_doc']!, _sourceDocMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Protocol map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Protocol(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
category: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
titleEn: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title_en'],
|
|
),
|
|
what: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}what'],
|
|
)!,
|
|
whenText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}when_text'],
|
|
)!,
|
|
dose: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}dose'],
|
|
)!,
|
|
why: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}why'],
|
|
)!,
|
|
howJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}how_json'],
|
|
)!,
|
|
checkText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}check_text'],
|
|
)!,
|
|
caution: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}caution'],
|
|
),
|
|
defaultAnchorJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}default_anchor_json'],
|
|
),
|
|
minDoseForStart: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}min_dose_for_start'],
|
|
),
|
|
referenceIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reference_ids_json'],
|
|
),
|
|
evidenceStrength: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}evidence_strength'],
|
|
),
|
|
sourceDoc: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}source_doc'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProtocolsTable createAlias(String alias) {
|
|
return $ProtocolsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Protocol extends DataClass implements Insertable<Protocol> {
|
|
final String id;
|
|
final String category;
|
|
final String title;
|
|
final String? titleEn;
|
|
final String what;
|
|
final String whenText;
|
|
final String dose;
|
|
final String why;
|
|
final String howJson;
|
|
final String checkText;
|
|
final String? caution;
|
|
final String? defaultAnchorJson;
|
|
final String? minDoseForStart;
|
|
final String? referenceIdsJson;
|
|
final String? evidenceStrength;
|
|
final String? sourceDoc;
|
|
const Protocol({
|
|
required this.id,
|
|
required this.category,
|
|
required this.title,
|
|
this.titleEn,
|
|
required this.what,
|
|
required this.whenText,
|
|
required this.dose,
|
|
required this.why,
|
|
required this.howJson,
|
|
required this.checkText,
|
|
this.caution,
|
|
this.defaultAnchorJson,
|
|
this.minDoseForStart,
|
|
this.referenceIdsJson,
|
|
this.evidenceStrength,
|
|
this.sourceDoc,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['category'] = Variable<String>(category);
|
|
map['title'] = Variable<String>(title);
|
|
if (!nullToAbsent || titleEn != null) {
|
|
map['title_en'] = Variable<String>(titleEn);
|
|
}
|
|
map['what'] = Variable<String>(what);
|
|
map['when_text'] = Variable<String>(whenText);
|
|
map['dose'] = Variable<String>(dose);
|
|
map['why'] = Variable<String>(why);
|
|
map['how_json'] = Variable<String>(howJson);
|
|
map['check_text'] = Variable<String>(checkText);
|
|
if (!nullToAbsent || caution != null) {
|
|
map['caution'] = Variable<String>(caution);
|
|
}
|
|
if (!nullToAbsent || defaultAnchorJson != null) {
|
|
map['default_anchor_json'] = Variable<String>(defaultAnchorJson);
|
|
}
|
|
if (!nullToAbsent || minDoseForStart != null) {
|
|
map['min_dose_for_start'] = Variable<String>(minDoseForStart);
|
|
}
|
|
if (!nullToAbsent || referenceIdsJson != null) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson);
|
|
}
|
|
if (!nullToAbsent || evidenceStrength != null) {
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength);
|
|
}
|
|
if (!nullToAbsent || sourceDoc != null) {
|
|
map['source_doc'] = Variable<String>(sourceDoc);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ProtocolsCompanion toCompanion(bool nullToAbsent) {
|
|
return ProtocolsCompanion(
|
|
id: Value(id),
|
|
category: Value(category),
|
|
title: Value(title),
|
|
titleEn: titleEn == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(titleEn),
|
|
what: Value(what),
|
|
whenText: Value(whenText),
|
|
dose: Value(dose),
|
|
why: Value(why),
|
|
howJson: Value(howJson),
|
|
checkText: Value(checkText),
|
|
caution: caution == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(caution),
|
|
defaultAnchorJson: defaultAnchorJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(defaultAnchorJson),
|
|
minDoseForStart: minDoseForStart == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(minDoseForStart),
|
|
referenceIdsJson: referenceIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(referenceIdsJson),
|
|
evidenceStrength: evidenceStrength == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(evidenceStrength),
|
|
sourceDoc: sourceDoc == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sourceDoc),
|
|
);
|
|
}
|
|
|
|
factory Protocol.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Protocol(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
category: serializer.fromJson<String>(json['category']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
titleEn: serializer.fromJson<String?>(json['titleEn']),
|
|
what: serializer.fromJson<String>(json['what']),
|
|
whenText: serializer.fromJson<String>(json['whenText']),
|
|
dose: serializer.fromJson<String>(json['dose']),
|
|
why: serializer.fromJson<String>(json['why']),
|
|
howJson: serializer.fromJson<String>(json['howJson']),
|
|
checkText: serializer.fromJson<String>(json['checkText']),
|
|
caution: serializer.fromJson<String?>(json['caution']),
|
|
defaultAnchorJson: serializer.fromJson<String?>(
|
|
json['defaultAnchorJson'],
|
|
),
|
|
minDoseForStart: serializer.fromJson<String?>(json['minDoseForStart']),
|
|
referenceIdsJson: serializer.fromJson<String?>(json['referenceIdsJson']),
|
|
evidenceStrength: serializer.fromJson<String?>(json['evidenceStrength']),
|
|
sourceDoc: serializer.fromJson<String?>(json['sourceDoc']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'category': serializer.toJson<String>(category),
|
|
'title': serializer.toJson<String>(title),
|
|
'titleEn': serializer.toJson<String?>(titleEn),
|
|
'what': serializer.toJson<String>(what),
|
|
'whenText': serializer.toJson<String>(whenText),
|
|
'dose': serializer.toJson<String>(dose),
|
|
'why': serializer.toJson<String>(why),
|
|
'howJson': serializer.toJson<String>(howJson),
|
|
'checkText': serializer.toJson<String>(checkText),
|
|
'caution': serializer.toJson<String?>(caution),
|
|
'defaultAnchorJson': serializer.toJson<String?>(defaultAnchorJson),
|
|
'minDoseForStart': serializer.toJson<String?>(minDoseForStart),
|
|
'referenceIdsJson': serializer.toJson<String?>(referenceIdsJson),
|
|
'evidenceStrength': serializer.toJson<String?>(evidenceStrength),
|
|
'sourceDoc': serializer.toJson<String?>(sourceDoc),
|
|
};
|
|
}
|
|
|
|
Protocol copyWith({
|
|
String? id,
|
|
String? category,
|
|
String? title,
|
|
Value<String?> titleEn = const Value.absent(),
|
|
String? what,
|
|
String? whenText,
|
|
String? dose,
|
|
String? why,
|
|
String? howJson,
|
|
String? checkText,
|
|
Value<String?> caution = const Value.absent(),
|
|
Value<String?> defaultAnchorJson = const Value.absent(),
|
|
Value<String?> minDoseForStart = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<String?> sourceDoc = const Value.absent(),
|
|
}) => Protocol(
|
|
id: id ?? this.id,
|
|
category: category ?? this.category,
|
|
title: title ?? this.title,
|
|
titleEn: titleEn.present ? titleEn.value : this.titleEn,
|
|
what: what ?? this.what,
|
|
whenText: whenText ?? this.whenText,
|
|
dose: dose ?? this.dose,
|
|
why: why ?? this.why,
|
|
howJson: howJson ?? this.howJson,
|
|
checkText: checkText ?? this.checkText,
|
|
caution: caution.present ? caution.value : this.caution,
|
|
defaultAnchorJson: defaultAnchorJson.present
|
|
? defaultAnchorJson.value
|
|
: this.defaultAnchorJson,
|
|
minDoseForStart: minDoseForStart.present
|
|
? minDoseForStart.value
|
|
: this.minDoseForStart,
|
|
referenceIdsJson: referenceIdsJson.present
|
|
? referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
evidenceStrength: evidenceStrength.present
|
|
? evidenceStrength.value
|
|
: this.evidenceStrength,
|
|
sourceDoc: sourceDoc.present ? sourceDoc.value : this.sourceDoc,
|
|
);
|
|
Protocol copyWithCompanion(ProtocolsCompanion data) {
|
|
return Protocol(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
titleEn: data.titleEn.present ? data.titleEn.value : this.titleEn,
|
|
what: data.what.present ? data.what.value : this.what,
|
|
whenText: data.whenText.present ? data.whenText.value : this.whenText,
|
|
dose: data.dose.present ? data.dose.value : this.dose,
|
|
why: data.why.present ? data.why.value : this.why,
|
|
howJson: data.howJson.present ? data.howJson.value : this.howJson,
|
|
checkText: data.checkText.present ? data.checkText.value : this.checkText,
|
|
caution: data.caution.present ? data.caution.value : this.caution,
|
|
defaultAnchorJson: data.defaultAnchorJson.present
|
|
? data.defaultAnchorJson.value
|
|
: this.defaultAnchorJson,
|
|
minDoseForStart: data.minDoseForStart.present
|
|
? data.minDoseForStart.value
|
|
: this.minDoseForStart,
|
|
referenceIdsJson: data.referenceIdsJson.present
|
|
? data.referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
evidenceStrength: data.evidenceStrength.present
|
|
? data.evidenceStrength.value
|
|
: this.evidenceStrength,
|
|
sourceDoc: data.sourceDoc.present ? data.sourceDoc.value : this.sourceDoc,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Protocol(')
|
|
..write('id: $id, ')
|
|
..write('category: $category, ')
|
|
..write('title: $title, ')
|
|
..write('titleEn: $titleEn, ')
|
|
..write('what: $what, ')
|
|
..write('whenText: $whenText, ')
|
|
..write('dose: $dose, ')
|
|
..write('why: $why, ')
|
|
..write('howJson: $howJson, ')
|
|
..write('checkText: $checkText, ')
|
|
..write('caution: $caution, ')
|
|
..write('defaultAnchorJson: $defaultAnchorJson, ')
|
|
..write('minDoseForStart: $minDoseForStart, ')
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('sourceDoc: $sourceDoc')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
category,
|
|
title,
|
|
titleEn,
|
|
what,
|
|
whenText,
|
|
dose,
|
|
why,
|
|
howJson,
|
|
checkText,
|
|
caution,
|
|
defaultAnchorJson,
|
|
minDoseForStart,
|
|
referenceIdsJson,
|
|
evidenceStrength,
|
|
sourceDoc,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Protocol &&
|
|
other.id == this.id &&
|
|
other.category == this.category &&
|
|
other.title == this.title &&
|
|
other.titleEn == this.titleEn &&
|
|
other.what == this.what &&
|
|
other.whenText == this.whenText &&
|
|
other.dose == this.dose &&
|
|
other.why == this.why &&
|
|
other.howJson == this.howJson &&
|
|
other.checkText == this.checkText &&
|
|
other.caution == this.caution &&
|
|
other.defaultAnchorJson == this.defaultAnchorJson &&
|
|
other.minDoseForStart == this.minDoseForStart &&
|
|
other.referenceIdsJson == this.referenceIdsJson &&
|
|
other.evidenceStrength == this.evidenceStrength &&
|
|
other.sourceDoc == this.sourceDoc);
|
|
}
|
|
|
|
class ProtocolsCompanion extends UpdateCompanion<Protocol> {
|
|
final Value<String> id;
|
|
final Value<String> category;
|
|
final Value<String> title;
|
|
final Value<String?> titleEn;
|
|
final Value<String> what;
|
|
final Value<String> whenText;
|
|
final Value<String> dose;
|
|
final Value<String> why;
|
|
final Value<String> howJson;
|
|
final Value<String> checkText;
|
|
final Value<String?> caution;
|
|
final Value<String?> defaultAnchorJson;
|
|
final Value<String?> minDoseForStart;
|
|
final Value<String?> referenceIdsJson;
|
|
final Value<String?> evidenceStrength;
|
|
final Value<String?> sourceDoc;
|
|
final Value<int> rowid;
|
|
const ProtocolsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.titleEn = const Value.absent(),
|
|
this.what = const Value.absent(),
|
|
this.whenText = const Value.absent(),
|
|
this.dose = const Value.absent(),
|
|
this.why = const Value.absent(),
|
|
this.howJson = const Value.absent(),
|
|
this.checkText = const Value.absent(),
|
|
this.caution = const Value.absent(),
|
|
this.defaultAnchorJson = const Value.absent(),
|
|
this.minDoseForStart = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.evidenceStrength = const Value.absent(),
|
|
this.sourceDoc = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProtocolsCompanion.insert({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
this.titleEn = const Value.absent(),
|
|
required String what,
|
|
required String whenText,
|
|
required String dose,
|
|
required String why,
|
|
required String howJson,
|
|
required String checkText,
|
|
this.caution = const Value.absent(),
|
|
this.defaultAnchorJson = const Value.absent(),
|
|
this.minDoseForStart = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.evidenceStrength = const Value.absent(),
|
|
this.sourceDoc = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
category = Value(category),
|
|
title = Value(title),
|
|
what = Value(what),
|
|
whenText = Value(whenText),
|
|
dose = Value(dose),
|
|
why = Value(why),
|
|
howJson = Value(howJson),
|
|
checkText = Value(checkText);
|
|
static Insertable<Protocol> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? category,
|
|
Expression<String>? title,
|
|
Expression<String>? titleEn,
|
|
Expression<String>? what,
|
|
Expression<String>? whenText,
|
|
Expression<String>? dose,
|
|
Expression<String>? why,
|
|
Expression<String>? howJson,
|
|
Expression<String>? checkText,
|
|
Expression<String>? caution,
|
|
Expression<String>? defaultAnchorJson,
|
|
Expression<String>? minDoseForStart,
|
|
Expression<String>? referenceIdsJson,
|
|
Expression<String>? evidenceStrength,
|
|
Expression<String>? sourceDoc,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (category != null) 'category': category,
|
|
if (title != null) 'title': title,
|
|
if (titleEn != null) 'title_en': titleEn,
|
|
if (what != null) 'what': what,
|
|
if (whenText != null) 'when_text': whenText,
|
|
if (dose != null) 'dose': dose,
|
|
if (why != null) 'why': why,
|
|
if (howJson != null) 'how_json': howJson,
|
|
if (checkText != null) 'check_text': checkText,
|
|
if (caution != null) 'caution': caution,
|
|
if (defaultAnchorJson != null) 'default_anchor_json': defaultAnchorJson,
|
|
if (minDoseForStart != null) 'min_dose_for_start': minDoseForStart,
|
|
if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson,
|
|
if (evidenceStrength != null) 'evidence_strength': evidenceStrength,
|
|
if (sourceDoc != null) 'source_doc': sourceDoc,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProtocolsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? category,
|
|
Value<String>? title,
|
|
Value<String?>? titleEn,
|
|
Value<String>? what,
|
|
Value<String>? whenText,
|
|
Value<String>? dose,
|
|
Value<String>? why,
|
|
Value<String>? howJson,
|
|
Value<String>? checkText,
|
|
Value<String?>? caution,
|
|
Value<String?>? defaultAnchorJson,
|
|
Value<String?>? minDoseForStart,
|
|
Value<String?>? referenceIdsJson,
|
|
Value<String?>? evidenceStrength,
|
|
Value<String?>? sourceDoc,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProtocolsCompanion(
|
|
id: id ?? this.id,
|
|
category: category ?? this.category,
|
|
title: title ?? this.title,
|
|
titleEn: titleEn ?? this.titleEn,
|
|
what: what ?? this.what,
|
|
whenText: whenText ?? this.whenText,
|
|
dose: dose ?? this.dose,
|
|
why: why ?? this.why,
|
|
howJson: howJson ?? this.howJson,
|
|
checkText: checkText ?? this.checkText,
|
|
caution: caution ?? this.caution,
|
|
defaultAnchorJson: defaultAnchorJson ?? this.defaultAnchorJson,
|
|
minDoseForStart: minDoseForStart ?? this.minDoseForStart,
|
|
referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson,
|
|
evidenceStrength: evidenceStrength ?? this.evidenceStrength,
|
|
sourceDoc: sourceDoc ?? this.sourceDoc,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (titleEn.present) {
|
|
map['title_en'] = Variable<String>(titleEn.value);
|
|
}
|
|
if (what.present) {
|
|
map['what'] = Variable<String>(what.value);
|
|
}
|
|
if (whenText.present) {
|
|
map['when_text'] = Variable<String>(whenText.value);
|
|
}
|
|
if (dose.present) {
|
|
map['dose'] = Variable<String>(dose.value);
|
|
}
|
|
if (why.present) {
|
|
map['why'] = Variable<String>(why.value);
|
|
}
|
|
if (howJson.present) {
|
|
map['how_json'] = Variable<String>(howJson.value);
|
|
}
|
|
if (checkText.present) {
|
|
map['check_text'] = Variable<String>(checkText.value);
|
|
}
|
|
if (caution.present) {
|
|
map['caution'] = Variable<String>(caution.value);
|
|
}
|
|
if (defaultAnchorJson.present) {
|
|
map['default_anchor_json'] = Variable<String>(defaultAnchorJson.value);
|
|
}
|
|
if (minDoseForStart.present) {
|
|
map['min_dose_for_start'] = Variable<String>(minDoseForStart.value);
|
|
}
|
|
if (referenceIdsJson.present) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson.value);
|
|
}
|
|
if (evidenceStrength.present) {
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength.value);
|
|
}
|
|
if (sourceDoc.present) {
|
|
map['source_doc'] = Variable<String>(sourceDoc.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProtocolsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('category: $category, ')
|
|
..write('title: $title, ')
|
|
..write('titleEn: $titleEn, ')
|
|
..write('what: $what, ')
|
|
..write('whenText: $whenText, ')
|
|
..write('dose: $dose, ')
|
|
..write('why: $why, ')
|
|
..write('howJson: $howJson, ')
|
|
..write('checkText: $checkText, ')
|
|
..write('caution: $caution, ')
|
|
..write('defaultAnchorJson: $defaultAnchorJson, ')
|
|
..write('minDoseForStart: $minDoseForStart, ')
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('sourceDoc: $sourceDoc, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $BreakProtocolsTable extends BreakProtocols
|
|
with TableInfo<$BreakProtocolsTable, BreakProtocol> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$BreakProtocolsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _categoryMeta = const VerificationMeta(
|
|
'category',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"category IN ('alcohol','nicotine','porn_masturbation','social_media','sugar','caffeine','cannabis','behavioral')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _hubermanSummaryMeta = const VerificationMeta(
|
|
'hubermanSummary',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> hubermanSummary = GeneratedColumn<String>(
|
|
'huberman_summary',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _frameExamplesJsonMeta = const VerificationMeta(
|
|
'frameExamplesJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> frameExamplesJson =
|
|
GeneratedColumn<String>(
|
|
'frame_examples_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _phasesJsonMeta = const VerificationMeta(
|
|
'phasesJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> phasesJson = GeneratedColumn<String>(
|
|
'phases_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _defaultCommonFramesJsonMeta =
|
|
const VerificationMeta('defaultCommonFramesJson');
|
|
@override
|
|
late final GeneratedColumn<String> defaultCommonFramesJson =
|
|
GeneratedColumn<String>(
|
|
'default_common_frames_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _toolsJsonMeta = const VerificationMeta(
|
|
'toolsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> toolsJson = GeneratedColumn<String>(
|
|
'tools_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _medicalWarningMeta = const VerificationMeta(
|
|
'medicalWarning',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> medicalWarning = GeneratedColumn<String>(
|
|
'medical_warning',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta(
|
|
'referenceIdsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> referenceIdsJson = GeneratedColumn<String>(
|
|
'reference_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
category,
|
|
title,
|
|
hubermanSummary,
|
|
frameExamplesJson,
|
|
phasesJson,
|
|
defaultCommonFramesJson,
|
|
toolsJson,
|
|
medicalWarning,
|
|
referenceIdsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'break_protocols';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<BreakProtocol> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('category')) {
|
|
context.handle(
|
|
_categoryMeta,
|
|
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_categoryMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('huberman_summary')) {
|
|
context.handle(
|
|
_hubermanSummaryMeta,
|
|
hubermanSummary.isAcceptableOrUnknown(
|
|
data['huberman_summary']!,
|
|
_hubermanSummaryMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_hubermanSummaryMeta);
|
|
}
|
|
if (data.containsKey('frame_examples_json')) {
|
|
context.handle(
|
|
_frameExamplesJsonMeta,
|
|
frameExamplesJson.isAcceptableOrUnknown(
|
|
data['frame_examples_json']!,
|
|
_frameExamplesJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('phases_json')) {
|
|
context.handle(
|
|
_phasesJsonMeta,
|
|
phasesJson.isAcceptableOrUnknown(data['phases_json']!, _phasesJsonMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_phasesJsonMeta);
|
|
}
|
|
if (data.containsKey('default_common_frames_json')) {
|
|
context.handle(
|
|
_defaultCommonFramesJsonMeta,
|
|
defaultCommonFramesJson.isAcceptableOrUnknown(
|
|
data['default_common_frames_json']!,
|
|
_defaultCommonFramesJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_defaultCommonFramesJsonMeta);
|
|
}
|
|
if (data.containsKey('tools_json')) {
|
|
context.handle(
|
|
_toolsJsonMeta,
|
|
toolsJson.isAcceptableOrUnknown(data['tools_json']!, _toolsJsonMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('medical_warning')) {
|
|
context.handle(
|
|
_medicalWarningMeta,
|
|
medicalWarning.isAcceptableOrUnknown(
|
|
data['medical_warning']!,
|
|
_medicalWarningMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reference_ids_json')) {
|
|
context.handle(
|
|
_referenceIdsJsonMeta,
|
|
referenceIdsJson.isAcceptableOrUnknown(
|
|
data['reference_ids_json']!,
|
|
_referenceIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
BreakProtocol map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return BreakProtocol(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
category: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
hubermanSummary: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}huberman_summary'],
|
|
)!,
|
|
frameExamplesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}frame_examples_json'],
|
|
),
|
|
phasesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}phases_json'],
|
|
)!,
|
|
defaultCommonFramesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}default_common_frames_json'],
|
|
)!,
|
|
toolsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tools_json'],
|
|
),
|
|
medicalWarning: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}medical_warning'],
|
|
),
|
|
referenceIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reference_ids_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$BreakProtocolsTable createAlias(String alias) {
|
|
return $BreakProtocolsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class BreakProtocol extends DataClass implements Insertable<BreakProtocol> {
|
|
final String id;
|
|
final String category;
|
|
final String title;
|
|
final String hubermanSummary;
|
|
final String? frameExamplesJson;
|
|
final String phasesJson;
|
|
final String defaultCommonFramesJson;
|
|
final String? toolsJson;
|
|
final String? medicalWarning;
|
|
final String? referenceIdsJson;
|
|
const BreakProtocol({
|
|
required this.id,
|
|
required this.category,
|
|
required this.title,
|
|
required this.hubermanSummary,
|
|
this.frameExamplesJson,
|
|
required this.phasesJson,
|
|
required this.defaultCommonFramesJson,
|
|
this.toolsJson,
|
|
this.medicalWarning,
|
|
this.referenceIdsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['category'] = Variable<String>(category);
|
|
map['title'] = Variable<String>(title);
|
|
map['huberman_summary'] = Variable<String>(hubermanSummary);
|
|
if (!nullToAbsent || frameExamplesJson != null) {
|
|
map['frame_examples_json'] = Variable<String>(frameExamplesJson);
|
|
}
|
|
map['phases_json'] = Variable<String>(phasesJson);
|
|
map['default_common_frames_json'] = Variable<String>(
|
|
defaultCommonFramesJson,
|
|
);
|
|
if (!nullToAbsent || toolsJson != null) {
|
|
map['tools_json'] = Variable<String>(toolsJson);
|
|
}
|
|
if (!nullToAbsent || medicalWarning != null) {
|
|
map['medical_warning'] = Variable<String>(medicalWarning);
|
|
}
|
|
if (!nullToAbsent || referenceIdsJson != null) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
BreakProtocolsCompanion toCompanion(bool nullToAbsent) {
|
|
return BreakProtocolsCompanion(
|
|
id: Value(id),
|
|
category: Value(category),
|
|
title: Value(title),
|
|
hubermanSummary: Value(hubermanSummary),
|
|
frameExamplesJson: frameExamplesJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(frameExamplesJson),
|
|
phasesJson: Value(phasesJson),
|
|
defaultCommonFramesJson: Value(defaultCommonFramesJson),
|
|
toolsJson: toolsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(toolsJson),
|
|
medicalWarning: medicalWarning == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(medicalWarning),
|
|
referenceIdsJson: referenceIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(referenceIdsJson),
|
|
);
|
|
}
|
|
|
|
factory BreakProtocol.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return BreakProtocol(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
category: serializer.fromJson<String>(json['category']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
hubermanSummary: serializer.fromJson<String>(json['hubermanSummary']),
|
|
frameExamplesJson: serializer.fromJson<String?>(
|
|
json['frameExamplesJson'],
|
|
),
|
|
phasesJson: serializer.fromJson<String>(json['phasesJson']),
|
|
defaultCommonFramesJson: serializer.fromJson<String>(
|
|
json['defaultCommonFramesJson'],
|
|
),
|
|
toolsJson: serializer.fromJson<String?>(json['toolsJson']),
|
|
medicalWarning: serializer.fromJson<String?>(json['medicalWarning']),
|
|
referenceIdsJson: serializer.fromJson<String?>(json['referenceIdsJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'category': serializer.toJson<String>(category),
|
|
'title': serializer.toJson<String>(title),
|
|
'hubermanSummary': serializer.toJson<String>(hubermanSummary),
|
|
'frameExamplesJson': serializer.toJson<String?>(frameExamplesJson),
|
|
'phasesJson': serializer.toJson<String>(phasesJson),
|
|
'defaultCommonFramesJson': serializer.toJson<String>(
|
|
defaultCommonFramesJson,
|
|
),
|
|
'toolsJson': serializer.toJson<String?>(toolsJson),
|
|
'medicalWarning': serializer.toJson<String?>(medicalWarning),
|
|
'referenceIdsJson': serializer.toJson<String?>(referenceIdsJson),
|
|
};
|
|
}
|
|
|
|
BreakProtocol copyWith({
|
|
String? id,
|
|
String? category,
|
|
String? title,
|
|
String? hubermanSummary,
|
|
Value<String?> frameExamplesJson = const Value.absent(),
|
|
String? phasesJson,
|
|
String? defaultCommonFramesJson,
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
}) => BreakProtocol(
|
|
id: id ?? this.id,
|
|
category: category ?? this.category,
|
|
title: title ?? this.title,
|
|
hubermanSummary: hubermanSummary ?? this.hubermanSummary,
|
|
frameExamplesJson: frameExamplesJson.present
|
|
? frameExamplesJson.value
|
|
: this.frameExamplesJson,
|
|
phasesJson: phasesJson ?? this.phasesJson,
|
|
defaultCommonFramesJson:
|
|
defaultCommonFramesJson ?? this.defaultCommonFramesJson,
|
|
toolsJson: toolsJson.present ? toolsJson.value : this.toolsJson,
|
|
medicalWarning: medicalWarning.present
|
|
? medicalWarning.value
|
|
: this.medicalWarning,
|
|
referenceIdsJson: referenceIdsJson.present
|
|
? referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
BreakProtocol copyWithCompanion(BreakProtocolsCompanion data) {
|
|
return BreakProtocol(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
hubermanSummary: data.hubermanSummary.present
|
|
? data.hubermanSummary.value
|
|
: this.hubermanSummary,
|
|
frameExamplesJson: data.frameExamplesJson.present
|
|
? data.frameExamplesJson.value
|
|
: this.frameExamplesJson,
|
|
phasesJson: data.phasesJson.present
|
|
? data.phasesJson.value
|
|
: this.phasesJson,
|
|
defaultCommonFramesJson: data.defaultCommonFramesJson.present
|
|
? data.defaultCommonFramesJson.value
|
|
: this.defaultCommonFramesJson,
|
|
toolsJson: data.toolsJson.present ? data.toolsJson.value : this.toolsJson,
|
|
medicalWarning: data.medicalWarning.present
|
|
? data.medicalWarning.value
|
|
: this.medicalWarning,
|
|
referenceIdsJson: data.referenceIdsJson.present
|
|
? data.referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BreakProtocol(')
|
|
..write('id: $id, ')
|
|
..write('category: $category, ')
|
|
..write('title: $title, ')
|
|
..write('hubermanSummary: $hubermanSummary, ')
|
|
..write('frameExamplesJson: $frameExamplesJson, ')
|
|
..write('phasesJson: $phasesJson, ')
|
|
..write('defaultCommonFramesJson: $defaultCommonFramesJson, ')
|
|
..write('toolsJson: $toolsJson, ')
|
|
..write('medicalWarning: $medicalWarning, ')
|
|
..write('referenceIdsJson: $referenceIdsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
category,
|
|
title,
|
|
hubermanSummary,
|
|
frameExamplesJson,
|
|
phasesJson,
|
|
defaultCommonFramesJson,
|
|
toolsJson,
|
|
medicalWarning,
|
|
referenceIdsJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is BreakProtocol &&
|
|
other.id == this.id &&
|
|
other.category == this.category &&
|
|
other.title == this.title &&
|
|
other.hubermanSummary == this.hubermanSummary &&
|
|
other.frameExamplesJson == this.frameExamplesJson &&
|
|
other.phasesJson == this.phasesJson &&
|
|
other.defaultCommonFramesJson == this.defaultCommonFramesJson &&
|
|
other.toolsJson == this.toolsJson &&
|
|
other.medicalWarning == this.medicalWarning &&
|
|
other.referenceIdsJson == this.referenceIdsJson);
|
|
}
|
|
|
|
class BreakProtocolsCompanion extends UpdateCompanion<BreakProtocol> {
|
|
final Value<String> id;
|
|
final Value<String> category;
|
|
final Value<String> title;
|
|
final Value<String> hubermanSummary;
|
|
final Value<String?> frameExamplesJson;
|
|
final Value<String> phasesJson;
|
|
final Value<String> defaultCommonFramesJson;
|
|
final Value<String?> toolsJson;
|
|
final Value<String?> medicalWarning;
|
|
final Value<String?> referenceIdsJson;
|
|
final Value<int> rowid;
|
|
const BreakProtocolsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.hubermanSummary = const Value.absent(),
|
|
this.frameExamplesJson = const Value.absent(),
|
|
this.phasesJson = const Value.absent(),
|
|
this.defaultCommonFramesJson = const Value.absent(),
|
|
this.toolsJson = const Value.absent(),
|
|
this.medicalWarning = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
BreakProtocolsCompanion.insert({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
required String hubermanSummary,
|
|
this.frameExamplesJson = const Value.absent(),
|
|
required String phasesJson,
|
|
required String defaultCommonFramesJson,
|
|
this.toolsJson = const Value.absent(),
|
|
this.medicalWarning = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
category = Value(category),
|
|
title = Value(title),
|
|
hubermanSummary = Value(hubermanSummary),
|
|
phasesJson = Value(phasesJson),
|
|
defaultCommonFramesJson = Value(defaultCommonFramesJson);
|
|
static Insertable<BreakProtocol> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? category,
|
|
Expression<String>? title,
|
|
Expression<String>? hubermanSummary,
|
|
Expression<String>? frameExamplesJson,
|
|
Expression<String>? phasesJson,
|
|
Expression<String>? defaultCommonFramesJson,
|
|
Expression<String>? toolsJson,
|
|
Expression<String>? medicalWarning,
|
|
Expression<String>? referenceIdsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (category != null) 'category': category,
|
|
if (title != null) 'title': title,
|
|
if (hubermanSummary != null) 'huberman_summary': hubermanSummary,
|
|
if (frameExamplesJson != null) 'frame_examples_json': frameExamplesJson,
|
|
if (phasesJson != null) 'phases_json': phasesJson,
|
|
if (defaultCommonFramesJson != null)
|
|
'default_common_frames_json': defaultCommonFramesJson,
|
|
if (toolsJson != null) 'tools_json': toolsJson,
|
|
if (medicalWarning != null) 'medical_warning': medicalWarning,
|
|
if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
BreakProtocolsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? category,
|
|
Value<String>? title,
|
|
Value<String>? hubermanSummary,
|
|
Value<String?>? frameExamplesJson,
|
|
Value<String>? phasesJson,
|
|
Value<String>? defaultCommonFramesJson,
|
|
Value<String?>? toolsJson,
|
|
Value<String?>? medicalWarning,
|
|
Value<String?>? referenceIdsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return BreakProtocolsCompanion(
|
|
id: id ?? this.id,
|
|
category: category ?? this.category,
|
|
title: title ?? this.title,
|
|
hubermanSummary: hubermanSummary ?? this.hubermanSummary,
|
|
frameExamplesJson: frameExamplesJson ?? this.frameExamplesJson,
|
|
phasesJson: phasesJson ?? this.phasesJson,
|
|
defaultCommonFramesJson:
|
|
defaultCommonFramesJson ?? this.defaultCommonFramesJson,
|
|
toolsJson: toolsJson ?? this.toolsJson,
|
|
medicalWarning: medicalWarning ?? this.medicalWarning,
|
|
referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (hubermanSummary.present) {
|
|
map['huberman_summary'] = Variable<String>(hubermanSummary.value);
|
|
}
|
|
if (frameExamplesJson.present) {
|
|
map['frame_examples_json'] = Variable<String>(frameExamplesJson.value);
|
|
}
|
|
if (phasesJson.present) {
|
|
map['phases_json'] = Variable<String>(phasesJson.value);
|
|
}
|
|
if (defaultCommonFramesJson.present) {
|
|
map['default_common_frames_json'] = Variable<String>(
|
|
defaultCommonFramesJson.value,
|
|
);
|
|
}
|
|
if (toolsJson.present) {
|
|
map['tools_json'] = Variable<String>(toolsJson.value);
|
|
}
|
|
if (medicalWarning.present) {
|
|
map['medical_warning'] = Variable<String>(medicalWarning.value);
|
|
}
|
|
if (referenceIdsJson.present) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BreakProtocolsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('category: $category, ')
|
|
..write('title: $title, ')
|
|
..write('hubermanSummary: $hubermanSummary, ')
|
|
..write('frameExamplesJson: $frameExamplesJson, ')
|
|
..write('phasesJson: $phasesJson, ')
|
|
..write('defaultCommonFramesJson: $defaultCommonFramesJson, ')
|
|
..write('toolsJson: $toolsJson, ')
|
|
..write('medicalWarning: $medicalWarning, ')
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $CommonFramesTable extends CommonFrames
|
|
with TableInfo<$CommonFramesTable, CommonFrame> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$CommonFramesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"id IN ('dopamine_reset','urge_surf','environment_design','relapse_recovery','recovery_stack')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _whatMeta = const VerificationMeta('what');
|
|
@override
|
|
late final GeneratedColumn<String> what = GeneratedColumn<String>(
|
|
'what',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _whyMeta = const VerificationMeta('why');
|
|
@override
|
|
late final GeneratedColumn<String> why = GeneratedColumn<String>(
|
|
'why',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _doseMeta = const VerificationMeta('dose');
|
|
@override
|
|
late final GeneratedColumn<String> dose = GeneratedColumn<String>(
|
|
'dose',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _howJsonMeta = const VerificationMeta(
|
|
'howJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> howJson = GeneratedColumn<String>(
|
|
'how_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _checkTextMeta = const VerificationMeta(
|
|
'checkText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> checkText = GeneratedColumn<String>(
|
|
'check_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _applicableBreakCategoriesJsonMeta =
|
|
const VerificationMeta('applicableBreakCategoriesJson');
|
|
@override
|
|
late final GeneratedColumn<String> applicableBreakCategoriesJson =
|
|
GeneratedColumn<String>(
|
|
'applicable_break_categories_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta(
|
|
'referenceIdsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> referenceIdsJson = GeneratedColumn<String>(
|
|
'reference_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
title,
|
|
what,
|
|
why,
|
|
dose,
|
|
howJson,
|
|
checkText,
|
|
applicableBreakCategoriesJson,
|
|
referenceIdsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'common_frames';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<CommonFrame> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('what')) {
|
|
context.handle(
|
|
_whatMeta,
|
|
what.isAcceptableOrUnknown(data['what']!, _whatMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_whatMeta);
|
|
}
|
|
if (data.containsKey('why')) {
|
|
context.handle(
|
|
_whyMeta,
|
|
why.isAcceptableOrUnknown(data['why']!, _whyMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_whyMeta);
|
|
}
|
|
if (data.containsKey('dose')) {
|
|
context.handle(
|
|
_doseMeta,
|
|
dose.isAcceptableOrUnknown(data['dose']!, _doseMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('how_json')) {
|
|
context.handle(
|
|
_howJsonMeta,
|
|
howJson.isAcceptableOrUnknown(data['how_json']!, _howJsonMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('check_text')) {
|
|
context.handle(
|
|
_checkTextMeta,
|
|
checkText.isAcceptableOrUnknown(data['check_text']!, _checkTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_checkTextMeta);
|
|
}
|
|
if (data.containsKey('applicable_break_categories_json')) {
|
|
context.handle(
|
|
_applicableBreakCategoriesJsonMeta,
|
|
applicableBreakCategoriesJson.isAcceptableOrUnknown(
|
|
data['applicable_break_categories_json']!,
|
|
_applicableBreakCategoriesJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reference_ids_json')) {
|
|
context.handle(
|
|
_referenceIdsJsonMeta,
|
|
referenceIdsJson.isAcceptableOrUnknown(
|
|
data['reference_ids_json']!,
|
|
_referenceIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
CommonFrame map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return CommonFrame(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
what: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}what'],
|
|
)!,
|
|
why: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}why'],
|
|
)!,
|
|
dose: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}dose'],
|
|
),
|
|
howJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}how_json'],
|
|
),
|
|
checkText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}check_text'],
|
|
)!,
|
|
applicableBreakCategoriesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}applicable_break_categories_json'],
|
|
),
|
|
referenceIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reference_ids_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$CommonFramesTable createAlias(String alias) {
|
|
return $CommonFramesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class CommonFrame extends DataClass implements Insertable<CommonFrame> {
|
|
final String id;
|
|
final String title;
|
|
final String what;
|
|
final String why;
|
|
final String? dose;
|
|
final String? howJson;
|
|
final String checkText;
|
|
final String? applicableBreakCategoriesJson;
|
|
final String? referenceIdsJson;
|
|
const CommonFrame({
|
|
required this.id,
|
|
required this.title,
|
|
required this.what,
|
|
required this.why,
|
|
this.dose,
|
|
this.howJson,
|
|
required this.checkText,
|
|
this.applicableBreakCategoriesJson,
|
|
this.referenceIdsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['what'] = Variable<String>(what);
|
|
map['why'] = Variable<String>(why);
|
|
if (!nullToAbsent || dose != null) {
|
|
map['dose'] = Variable<String>(dose);
|
|
}
|
|
if (!nullToAbsent || howJson != null) {
|
|
map['how_json'] = Variable<String>(howJson);
|
|
}
|
|
map['check_text'] = Variable<String>(checkText);
|
|
if (!nullToAbsent || applicableBreakCategoriesJson != null) {
|
|
map['applicable_break_categories_json'] = Variable<String>(
|
|
applicableBreakCategoriesJson,
|
|
);
|
|
}
|
|
if (!nullToAbsent || referenceIdsJson != null) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
CommonFramesCompanion toCompanion(bool nullToAbsent) {
|
|
return CommonFramesCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
what: Value(what),
|
|
why: Value(why),
|
|
dose: dose == null && nullToAbsent ? const Value.absent() : Value(dose),
|
|
howJson: howJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(howJson),
|
|
checkText: Value(checkText),
|
|
applicableBreakCategoriesJson:
|
|
applicableBreakCategoriesJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(applicableBreakCategoriesJson),
|
|
referenceIdsJson: referenceIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(referenceIdsJson),
|
|
);
|
|
}
|
|
|
|
factory CommonFrame.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return CommonFrame(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
what: serializer.fromJson<String>(json['what']),
|
|
why: serializer.fromJson<String>(json['why']),
|
|
dose: serializer.fromJson<String?>(json['dose']),
|
|
howJson: serializer.fromJson<String?>(json['howJson']),
|
|
checkText: serializer.fromJson<String>(json['checkText']),
|
|
applicableBreakCategoriesJson: serializer.fromJson<String?>(
|
|
json['applicableBreakCategoriesJson'],
|
|
),
|
|
referenceIdsJson: serializer.fromJson<String?>(json['referenceIdsJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'what': serializer.toJson<String>(what),
|
|
'why': serializer.toJson<String>(why),
|
|
'dose': serializer.toJson<String?>(dose),
|
|
'howJson': serializer.toJson<String?>(howJson),
|
|
'checkText': serializer.toJson<String>(checkText),
|
|
'applicableBreakCategoriesJson': serializer.toJson<String?>(
|
|
applicableBreakCategoriesJson,
|
|
),
|
|
'referenceIdsJson': serializer.toJson<String?>(referenceIdsJson),
|
|
};
|
|
}
|
|
|
|
CommonFrame copyWith({
|
|
String? id,
|
|
String? title,
|
|
String? what,
|
|
String? why,
|
|
Value<String?> dose = const Value.absent(),
|
|
Value<String?> howJson = const Value.absent(),
|
|
String? checkText,
|
|
Value<String?> applicableBreakCategoriesJson = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
}) => CommonFrame(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
what: what ?? this.what,
|
|
why: why ?? this.why,
|
|
dose: dose.present ? dose.value : this.dose,
|
|
howJson: howJson.present ? howJson.value : this.howJson,
|
|
checkText: checkText ?? this.checkText,
|
|
applicableBreakCategoriesJson: applicableBreakCategoriesJson.present
|
|
? applicableBreakCategoriesJson.value
|
|
: this.applicableBreakCategoriesJson,
|
|
referenceIdsJson: referenceIdsJson.present
|
|
? referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
CommonFrame copyWithCompanion(CommonFramesCompanion data) {
|
|
return CommonFrame(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
what: data.what.present ? data.what.value : this.what,
|
|
why: data.why.present ? data.why.value : this.why,
|
|
dose: data.dose.present ? data.dose.value : this.dose,
|
|
howJson: data.howJson.present ? data.howJson.value : this.howJson,
|
|
checkText: data.checkText.present ? data.checkText.value : this.checkText,
|
|
applicableBreakCategoriesJson: data.applicableBreakCategoriesJson.present
|
|
? data.applicableBreakCategoriesJson.value
|
|
: this.applicableBreakCategoriesJson,
|
|
referenceIdsJson: data.referenceIdsJson.present
|
|
? data.referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('CommonFrame(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('what: $what, ')
|
|
..write('why: $why, ')
|
|
..write('dose: $dose, ')
|
|
..write('howJson: $howJson, ')
|
|
..write('checkText: $checkText, ')
|
|
..write(
|
|
'applicableBreakCategoriesJson: $applicableBreakCategoriesJson, ',
|
|
)
|
|
..write('referenceIdsJson: $referenceIdsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
title,
|
|
what,
|
|
why,
|
|
dose,
|
|
howJson,
|
|
checkText,
|
|
applicableBreakCategoriesJson,
|
|
referenceIdsJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is CommonFrame &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.what == this.what &&
|
|
other.why == this.why &&
|
|
other.dose == this.dose &&
|
|
other.howJson == this.howJson &&
|
|
other.checkText == this.checkText &&
|
|
other.applicableBreakCategoriesJson ==
|
|
this.applicableBreakCategoriesJson &&
|
|
other.referenceIdsJson == this.referenceIdsJson);
|
|
}
|
|
|
|
class CommonFramesCompanion extends UpdateCompanion<CommonFrame> {
|
|
final Value<String> id;
|
|
final Value<String> title;
|
|
final Value<String> what;
|
|
final Value<String> why;
|
|
final Value<String?> dose;
|
|
final Value<String?> howJson;
|
|
final Value<String> checkText;
|
|
final Value<String?> applicableBreakCategoriesJson;
|
|
final Value<String?> referenceIdsJson;
|
|
final Value<int> rowid;
|
|
const CommonFramesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.what = const Value.absent(),
|
|
this.why = const Value.absent(),
|
|
this.dose = const Value.absent(),
|
|
this.howJson = const Value.absent(),
|
|
this.checkText = const Value.absent(),
|
|
this.applicableBreakCategoriesJson = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
CommonFramesCompanion.insert({
|
|
required String id,
|
|
required String title,
|
|
required String what,
|
|
required String why,
|
|
this.dose = const Value.absent(),
|
|
this.howJson = const Value.absent(),
|
|
required String checkText,
|
|
this.applicableBreakCategoriesJson = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
title = Value(title),
|
|
what = Value(what),
|
|
why = Value(why),
|
|
checkText = Value(checkText);
|
|
static Insertable<CommonFrame> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? what,
|
|
Expression<String>? why,
|
|
Expression<String>? dose,
|
|
Expression<String>? howJson,
|
|
Expression<String>? checkText,
|
|
Expression<String>? applicableBreakCategoriesJson,
|
|
Expression<String>? referenceIdsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (what != null) 'what': what,
|
|
if (why != null) 'why': why,
|
|
if (dose != null) 'dose': dose,
|
|
if (howJson != null) 'how_json': howJson,
|
|
if (checkText != null) 'check_text': checkText,
|
|
if (applicableBreakCategoriesJson != null)
|
|
'applicable_break_categories_json': applicableBreakCategoriesJson,
|
|
if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
CommonFramesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? title,
|
|
Value<String>? what,
|
|
Value<String>? why,
|
|
Value<String?>? dose,
|
|
Value<String?>? howJson,
|
|
Value<String>? checkText,
|
|
Value<String?>? applicableBreakCategoriesJson,
|
|
Value<String?>? referenceIdsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return CommonFramesCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
what: what ?? this.what,
|
|
why: why ?? this.why,
|
|
dose: dose ?? this.dose,
|
|
howJson: howJson ?? this.howJson,
|
|
checkText: checkText ?? this.checkText,
|
|
applicableBreakCategoriesJson:
|
|
applicableBreakCategoriesJson ?? this.applicableBreakCategoriesJson,
|
|
referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<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 (what.present) {
|
|
map['what'] = Variable<String>(what.value);
|
|
}
|
|
if (why.present) {
|
|
map['why'] = Variable<String>(why.value);
|
|
}
|
|
if (dose.present) {
|
|
map['dose'] = Variable<String>(dose.value);
|
|
}
|
|
if (howJson.present) {
|
|
map['how_json'] = Variable<String>(howJson.value);
|
|
}
|
|
if (checkText.present) {
|
|
map['check_text'] = Variable<String>(checkText.value);
|
|
}
|
|
if (applicableBreakCategoriesJson.present) {
|
|
map['applicable_break_categories_json'] = Variable<String>(
|
|
applicableBreakCategoriesJson.value,
|
|
);
|
|
}
|
|
if (referenceIdsJson.present) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('CommonFramesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('what: $what, ')
|
|
..write('why: $why, ')
|
|
..write('dose: $dose, ')
|
|
..write('howJson: $howJson, ')
|
|
..write('checkText: $checkText, ')
|
|
..write(
|
|
'applicableBreakCategoriesJson: $applicableBreakCategoriesJson, ',
|
|
)
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $MethodologiesTable extends Methodologies
|
|
with TableInfo<$MethodologiesTable, Methodology> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MethodologiesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<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,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _originatorMeta = const VerificationMeta(
|
|
'originator',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originator = GeneratedColumn<String>(
|
|
'originator',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _oneLineDefinitionMeta = const VerificationMeta(
|
|
'oneLineDefinition',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> oneLineDefinition =
|
|
GeneratedColumn<String>(
|
|
'one_line_definition',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _coreUnitMeta = const VerificationMeta(
|
|
'coreUnit',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> coreUnit = GeneratedColumn<String>(
|
|
'core_unit',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _procedureJsonMeta = const VerificationMeta(
|
|
'procedureJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> procedureJson = GeneratedColumn<String>(
|
|
'procedure_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _toolsJsonMeta = const VerificationMeta(
|
|
'toolsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> toolsJson = GeneratedColumn<String>(
|
|
'tools_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _strengthsJsonMeta = const VerificationMeta(
|
|
'strengthsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> strengthsJson = GeneratedColumn<String>(
|
|
'strengths_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _weaknessesJsonMeta = const VerificationMeta(
|
|
'weaknessesJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> weaknessesJson = GeneratedColumn<String>(
|
|
'weaknesses_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _goodForMeta = const VerificationMeta(
|
|
'goodFor',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> goodFor = GeneratedColumn<String>(
|
|
'good_for',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _hubermanFitScoreMeta = const VerificationMeta(
|
|
'hubermanFitScore',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> hubermanFitScore = GeneratedColumn<int>(
|
|
'huberman_fit_score',
|
|
aliasedName,
|
|
false,
|
|
check: () =>
|
|
const CustomExpression<bool>("huberman_fit_score BETWEEN 1 AND 5"),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isCoreEngineMeta = const VerificationMeta(
|
|
'isCoreEngine',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isCoreEngine = GeneratedColumn<bool>(
|
|
'is_core_engine',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_core_engine" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta(
|
|
'referenceIdsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> referenceIdsJson = GeneratedColumn<String>(
|
|
'reference_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
originator,
|
|
oneLineDefinition,
|
|
coreUnit,
|
|
procedureJson,
|
|
toolsJson,
|
|
strengthsJson,
|
|
weaknessesJson,
|
|
goodFor,
|
|
hubermanFitScore,
|
|
isCoreEngine,
|
|
referenceIdsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'methodologies';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Methodology> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('originator')) {
|
|
context.handle(
|
|
_originatorMeta,
|
|
originator.isAcceptableOrUnknown(data['originator']!, _originatorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originatorMeta);
|
|
}
|
|
if (data.containsKey('one_line_definition')) {
|
|
context.handle(
|
|
_oneLineDefinitionMeta,
|
|
oneLineDefinition.isAcceptableOrUnknown(
|
|
data['one_line_definition']!,
|
|
_oneLineDefinitionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_oneLineDefinitionMeta);
|
|
}
|
|
if (data.containsKey('core_unit')) {
|
|
context.handle(
|
|
_coreUnitMeta,
|
|
coreUnit.isAcceptableOrUnknown(data['core_unit']!, _coreUnitMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_coreUnitMeta);
|
|
}
|
|
if (data.containsKey('procedure_json')) {
|
|
context.handle(
|
|
_procedureJsonMeta,
|
|
procedureJson.isAcceptableOrUnknown(
|
|
data['procedure_json']!,
|
|
_procedureJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('tools_json')) {
|
|
context.handle(
|
|
_toolsJsonMeta,
|
|
toolsJson.isAcceptableOrUnknown(data['tools_json']!, _toolsJsonMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('strengths_json')) {
|
|
context.handle(
|
|
_strengthsJsonMeta,
|
|
strengthsJson.isAcceptableOrUnknown(
|
|
data['strengths_json']!,
|
|
_strengthsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('weaknesses_json')) {
|
|
context.handle(
|
|
_weaknessesJsonMeta,
|
|
weaknessesJson.isAcceptableOrUnknown(
|
|
data['weaknesses_json']!,
|
|
_weaknessesJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('good_for')) {
|
|
context.handle(
|
|
_goodForMeta,
|
|
goodFor.isAcceptableOrUnknown(data['good_for']!, _goodForMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('huberman_fit_score')) {
|
|
context.handle(
|
|
_hubermanFitScoreMeta,
|
|
hubermanFitScore.isAcceptableOrUnknown(
|
|
data['huberman_fit_score']!,
|
|
_hubermanFitScoreMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_hubermanFitScoreMeta);
|
|
}
|
|
if (data.containsKey('is_core_engine')) {
|
|
context.handle(
|
|
_isCoreEngineMeta,
|
|
isCoreEngine.isAcceptableOrUnknown(
|
|
data['is_core_engine']!,
|
|
_isCoreEngineMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reference_ids_json')) {
|
|
context.handle(
|
|
_referenceIdsJsonMeta,
|
|
referenceIdsJson.isAcceptableOrUnknown(
|
|
data['reference_ids_json']!,
|
|
_referenceIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Methodology map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Methodology(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
originator: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}originator'],
|
|
)!,
|
|
oneLineDefinition: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}one_line_definition'],
|
|
)!,
|
|
coreUnit: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}core_unit'],
|
|
)!,
|
|
procedureJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}procedure_json'],
|
|
),
|
|
toolsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tools_json'],
|
|
),
|
|
strengthsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}strengths_json'],
|
|
),
|
|
weaknessesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}weaknesses_json'],
|
|
),
|
|
goodFor: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}good_for'],
|
|
),
|
|
hubermanFitScore: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}huberman_fit_score'],
|
|
)!,
|
|
isCoreEngine: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_core_engine'],
|
|
)!,
|
|
referenceIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reference_ids_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MethodologiesTable createAlias(String alias) {
|
|
return $MethodologiesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Methodology extends DataClass implements Insertable<Methodology> {
|
|
final String id;
|
|
final String name;
|
|
final String originator;
|
|
final String oneLineDefinition;
|
|
final String coreUnit;
|
|
final String? procedureJson;
|
|
final String? toolsJson;
|
|
final String? strengthsJson;
|
|
final String? weaknessesJson;
|
|
final String? goodFor;
|
|
final int hubermanFitScore;
|
|
final bool isCoreEngine;
|
|
final String? referenceIdsJson;
|
|
const Methodology({
|
|
required this.id,
|
|
required this.name,
|
|
required this.originator,
|
|
required this.oneLineDefinition,
|
|
required this.coreUnit,
|
|
this.procedureJson,
|
|
this.toolsJson,
|
|
this.strengthsJson,
|
|
this.weaknessesJson,
|
|
this.goodFor,
|
|
required this.hubermanFitScore,
|
|
required this.isCoreEngine,
|
|
this.referenceIdsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['originator'] = Variable<String>(originator);
|
|
map['one_line_definition'] = Variable<String>(oneLineDefinition);
|
|
map['core_unit'] = Variable<String>(coreUnit);
|
|
if (!nullToAbsent || procedureJson != null) {
|
|
map['procedure_json'] = Variable<String>(procedureJson);
|
|
}
|
|
if (!nullToAbsent || toolsJson != null) {
|
|
map['tools_json'] = Variable<String>(toolsJson);
|
|
}
|
|
if (!nullToAbsent || strengthsJson != null) {
|
|
map['strengths_json'] = Variable<String>(strengthsJson);
|
|
}
|
|
if (!nullToAbsent || weaknessesJson != null) {
|
|
map['weaknesses_json'] = Variable<String>(weaknessesJson);
|
|
}
|
|
if (!nullToAbsent || goodFor != null) {
|
|
map['good_for'] = Variable<String>(goodFor);
|
|
}
|
|
map['huberman_fit_score'] = Variable<int>(hubermanFitScore);
|
|
map['is_core_engine'] = Variable<bool>(isCoreEngine);
|
|
if (!nullToAbsent || referenceIdsJson != null) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
MethodologiesCompanion toCompanion(bool nullToAbsent) {
|
|
return MethodologiesCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
originator: Value(originator),
|
|
oneLineDefinition: Value(oneLineDefinition),
|
|
coreUnit: Value(coreUnit),
|
|
procedureJson: procedureJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(procedureJson),
|
|
toolsJson: toolsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(toolsJson),
|
|
strengthsJson: strengthsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(strengthsJson),
|
|
weaknessesJson: weaknessesJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(weaknessesJson),
|
|
goodFor: goodFor == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(goodFor),
|
|
hubermanFitScore: Value(hubermanFitScore),
|
|
isCoreEngine: Value(isCoreEngine),
|
|
referenceIdsJson: referenceIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(referenceIdsJson),
|
|
);
|
|
}
|
|
|
|
factory Methodology.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Methodology(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
originator: serializer.fromJson<String>(json['originator']),
|
|
oneLineDefinition: serializer.fromJson<String>(json['oneLineDefinition']),
|
|
coreUnit: serializer.fromJson<String>(json['coreUnit']),
|
|
procedureJson: serializer.fromJson<String?>(json['procedureJson']),
|
|
toolsJson: serializer.fromJson<String?>(json['toolsJson']),
|
|
strengthsJson: serializer.fromJson<String?>(json['strengthsJson']),
|
|
weaknessesJson: serializer.fromJson<String?>(json['weaknessesJson']),
|
|
goodFor: serializer.fromJson<String?>(json['goodFor']),
|
|
hubermanFitScore: serializer.fromJson<int>(json['hubermanFitScore']),
|
|
isCoreEngine: serializer.fromJson<bool>(json['isCoreEngine']),
|
|
referenceIdsJson: serializer.fromJson<String?>(json['referenceIdsJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'originator': serializer.toJson<String>(originator),
|
|
'oneLineDefinition': serializer.toJson<String>(oneLineDefinition),
|
|
'coreUnit': serializer.toJson<String>(coreUnit),
|
|
'procedureJson': serializer.toJson<String?>(procedureJson),
|
|
'toolsJson': serializer.toJson<String?>(toolsJson),
|
|
'strengthsJson': serializer.toJson<String?>(strengthsJson),
|
|
'weaknessesJson': serializer.toJson<String?>(weaknessesJson),
|
|
'goodFor': serializer.toJson<String?>(goodFor),
|
|
'hubermanFitScore': serializer.toJson<int>(hubermanFitScore),
|
|
'isCoreEngine': serializer.toJson<bool>(isCoreEngine),
|
|
'referenceIdsJson': serializer.toJson<String?>(referenceIdsJson),
|
|
};
|
|
}
|
|
|
|
Methodology copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? originator,
|
|
String? oneLineDefinition,
|
|
String? coreUnit,
|
|
Value<String?> procedureJson = const Value.absent(),
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
Value<String?> goodFor = const Value.absent(),
|
|
int? hubermanFitScore,
|
|
bool? isCoreEngine,
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
}) => Methodology(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
originator: originator ?? this.originator,
|
|
oneLineDefinition: oneLineDefinition ?? this.oneLineDefinition,
|
|
coreUnit: coreUnit ?? this.coreUnit,
|
|
procedureJson: procedureJson.present
|
|
? procedureJson.value
|
|
: this.procedureJson,
|
|
toolsJson: toolsJson.present ? toolsJson.value : this.toolsJson,
|
|
strengthsJson: strengthsJson.present
|
|
? strengthsJson.value
|
|
: this.strengthsJson,
|
|
weaknessesJson: weaknessesJson.present
|
|
? weaknessesJson.value
|
|
: this.weaknessesJson,
|
|
goodFor: goodFor.present ? goodFor.value : this.goodFor,
|
|
hubermanFitScore: hubermanFitScore ?? this.hubermanFitScore,
|
|
isCoreEngine: isCoreEngine ?? this.isCoreEngine,
|
|
referenceIdsJson: referenceIdsJson.present
|
|
? referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
Methodology copyWithCompanion(MethodologiesCompanion data) {
|
|
return Methodology(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
originator: data.originator.present
|
|
? data.originator.value
|
|
: this.originator,
|
|
oneLineDefinition: data.oneLineDefinition.present
|
|
? data.oneLineDefinition.value
|
|
: this.oneLineDefinition,
|
|
coreUnit: data.coreUnit.present ? data.coreUnit.value : this.coreUnit,
|
|
procedureJson: data.procedureJson.present
|
|
? data.procedureJson.value
|
|
: this.procedureJson,
|
|
toolsJson: data.toolsJson.present ? data.toolsJson.value : this.toolsJson,
|
|
strengthsJson: data.strengthsJson.present
|
|
? data.strengthsJson.value
|
|
: this.strengthsJson,
|
|
weaknessesJson: data.weaknessesJson.present
|
|
? data.weaknessesJson.value
|
|
: this.weaknessesJson,
|
|
goodFor: data.goodFor.present ? data.goodFor.value : this.goodFor,
|
|
hubermanFitScore: data.hubermanFitScore.present
|
|
? data.hubermanFitScore.value
|
|
: this.hubermanFitScore,
|
|
isCoreEngine: data.isCoreEngine.present
|
|
? data.isCoreEngine.value
|
|
: this.isCoreEngine,
|
|
referenceIdsJson: data.referenceIdsJson.present
|
|
? data.referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Methodology(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('originator: $originator, ')
|
|
..write('oneLineDefinition: $oneLineDefinition, ')
|
|
..write('coreUnit: $coreUnit, ')
|
|
..write('procedureJson: $procedureJson, ')
|
|
..write('toolsJson: $toolsJson, ')
|
|
..write('strengthsJson: $strengthsJson, ')
|
|
..write('weaknessesJson: $weaknessesJson, ')
|
|
..write('goodFor: $goodFor, ')
|
|
..write('hubermanFitScore: $hubermanFitScore, ')
|
|
..write('isCoreEngine: $isCoreEngine, ')
|
|
..write('referenceIdsJson: $referenceIdsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
originator,
|
|
oneLineDefinition,
|
|
coreUnit,
|
|
procedureJson,
|
|
toolsJson,
|
|
strengthsJson,
|
|
weaknessesJson,
|
|
goodFor,
|
|
hubermanFitScore,
|
|
isCoreEngine,
|
|
referenceIdsJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Methodology &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.originator == this.originator &&
|
|
other.oneLineDefinition == this.oneLineDefinition &&
|
|
other.coreUnit == this.coreUnit &&
|
|
other.procedureJson == this.procedureJson &&
|
|
other.toolsJson == this.toolsJson &&
|
|
other.strengthsJson == this.strengthsJson &&
|
|
other.weaknessesJson == this.weaknessesJson &&
|
|
other.goodFor == this.goodFor &&
|
|
other.hubermanFitScore == this.hubermanFitScore &&
|
|
other.isCoreEngine == this.isCoreEngine &&
|
|
other.referenceIdsJson == this.referenceIdsJson);
|
|
}
|
|
|
|
class MethodologiesCompanion extends UpdateCompanion<Methodology> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String> originator;
|
|
final Value<String> oneLineDefinition;
|
|
final Value<String> coreUnit;
|
|
final Value<String?> procedureJson;
|
|
final Value<String?> toolsJson;
|
|
final Value<String?> strengthsJson;
|
|
final Value<String?> weaknessesJson;
|
|
final Value<String?> goodFor;
|
|
final Value<int> hubermanFitScore;
|
|
final Value<bool> isCoreEngine;
|
|
final Value<String?> referenceIdsJson;
|
|
final Value<int> rowid;
|
|
const MethodologiesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.originator = const Value.absent(),
|
|
this.oneLineDefinition = const Value.absent(),
|
|
this.coreUnit = const Value.absent(),
|
|
this.procedureJson = const Value.absent(),
|
|
this.toolsJson = const Value.absent(),
|
|
this.strengthsJson = const Value.absent(),
|
|
this.weaknessesJson = const Value.absent(),
|
|
this.goodFor = const Value.absent(),
|
|
this.hubermanFitScore = const Value.absent(),
|
|
this.isCoreEngine = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
MethodologiesCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required String originator,
|
|
required String oneLineDefinition,
|
|
required String coreUnit,
|
|
this.procedureJson = const Value.absent(),
|
|
this.toolsJson = const Value.absent(),
|
|
this.strengthsJson = const Value.absent(),
|
|
this.weaknessesJson = const Value.absent(),
|
|
this.goodFor = const Value.absent(),
|
|
required int hubermanFitScore,
|
|
this.isCoreEngine = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
originator = Value(originator),
|
|
oneLineDefinition = Value(oneLineDefinition),
|
|
coreUnit = Value(coreUnit),
|
|
hubermanFitScore = Value(hubermanFitScore);
|
|
static Insertable<Methodology> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? originator,
|
|
Expression<String>? oneLineDefinition,
|
|
Expression<String>? coreUnit,
|
|
Expression<String>? procedureJson,
|
|
Expression<String>? toolsJson,
|
|
Expression<String>? strengthsJson,
|
|
Expression<String>? weaknessesJson,
|
|
Expression<String>? goodFor,
|
|
Expression<int>? hubermanFitScore,
|
|
Expression<bool>? isCoreEngine,
|
|
Expression<String>? referenceIdsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (originator != null) 'originator': originator,
|
|
if (oneLineDefinition != null) 'one_line_definition': oneLineDefinition,
|
|
if (coreUnit != null) 'core_unit': coreUnit,
|
|
if (procedureJson != null) 'procedure_json': procedureJson,
|
|
if (toolsJson != null) 'tools_json': toolsJson,
|
|
if (strengthsJson != null) 'strengths_json': strengthsJson,
|
|
if (weaknessesJson != null) 'weaknesses_json': weaknessesJson,
|
|
if (goodFor != null) 'good_for': goodFor,
|
|
if (hubermanFitScore != null) 'huberman_fit_score': hubermanFitScore,
|
|
if (isCoreEngine != null) 'is_core_engine': isCoreEngine,
|
|
if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
MethodologiesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String>? originator,
|
|
Value<String>? oneLineDefinition,
|
|
Value<String>? coreUnit,
|
|
Value<String?>? procedureJson,
|
|
Value<String?>? toolsJson,
|
|
Value<String?>? strengthsJson,
|
|
Value<String?>? weaknessesJson,
|
|
Value<String?>? goodFor,
|
|
Value<int>? hubermanFitScore,
|
|
Value<bool>? isCoreEngine,
|
|
Value<String?>? referenceIdsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return MethodologiesCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
originator: originator ?? this.originator,
|
|
oneLineDefinition: oneLineDefinition ?? this.oneLineDefinition,
|
|
coreUnit: coreUnit ?? this.coreUnit,
|
|
procedureJson: procedureJson ?? this.procedureJson,
|
|
toolsJson: toolsJson ?? this.toolsJson,
|
|
strengthsJson: strengthsJson ?? this.strengthsJson,
|
|
weaknessesJson: weaknessesJson ?? this.weaknessesJson,
|
|
goodFor: goodFor ?? this.goodFor,
|
|
hubermanFitScore: hubermanFitScore ?? this.hubermanFitScore,
|
|
isCoreEngine: isCoreEngine ?? this.isCoreEngine,
|
|
referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<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 (originator.present) {
|
|
map['originator'] = Variable<String>(originator.value);
|
|
}
|
|
if (oneLineDefinition.present) {
|
|
map['one_line_definition'] = Variable<String>(oneLineDefinition.value);
|
|
}
|
|
if (coreUnit.present) {
|
|
map['core_unit'] = Variable<String>(coreUnit.value);
|
|
}
|
|
if (procedureJson.present) {
|
|
map['procedure_json'] = Variable<String>(procedureJson.value);
|
|
}
|
|
if (toolsJson.present) {
|
|
map['tools_json'] = Variable<String>(toolsJson.value);
|
|
}
|
|
if (strengthsJson.present) {
|
|
map['strengths_json'] = Variable<String>(strengthsJson.value);
|
|
}
|
|
if (weaknessesJson.present) {
|
|
map['weaknesses_json'] = Variable<String>(weaknessesJson.value);
|
|
}
|
|
if (goodFor.present) {
|
|
map['good_for'] = Variable<String>(goodFor.value);
|
|
}
|
|
if (hubermanFitScore.present) {
|
|
map['huberman_fit_score'] = Variable<int>(hubermanFitScore.value);
|
|
}
|
|
if (isCoreEngine.present) {
|
|
map['is_core_engine'] = Variable<bool>(isCoreEngine.value);
|
|
}
|
|
if (referenceIdsJson.present) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MethodologiesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('originator: $originator, ')
|
|
..write('oneLineDefinition: $oneLineDefinition, ')
|
|
..write('coreUnit: $coreUnit, ')
|
|
..write('procedureJson: $procedureJson, ')
|
|
..write('toolsJson: $toolsJson, ')
|
|
..write('strengthsJson: $strengthsJson, ')
|
|
..write('weaknessesJson: $weaknessesJson, ')
|
|
..write('goodFor: $goodFor, ')
|
|
..write('hubermanFitScore: $hubermanFitScore, ')
|
|
..write('isCoreEngine: $isCoreEngine, ')
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $FramePatternsTable extends FramePatterns
|
|
with TableInfo<$FramePatternsTable, FramePattern> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$FramePatternsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _domainMeta = const VerificationMeta('domain');
|
|
@override
|
|
late final GeneratedColumn<String> domain = GeneratedColumn<String>(
|
|
'domain',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"domain IS NULL OR domain IN ('food','drink','smoking','screen','porn','sleep','exercise','general')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _avoidanceKeywordMeta = const VerificationMeta(
|
|
'avoidanceKeyword',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> avoidanceKeyword = GeneratedColumn<String>(
|
|
'avoidance_keyword',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _l0ExampleMeta = const VerificationMeta(
|
|
'l0Example',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> l0Example = GeneratedColumn<String>(
|
|
'l0_example',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _l1SimpleReplaceMeta = const VerificationMeta(
|
|
'l1SimpleReplace',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> l1SimpleReplace = GeneratedColumn<String>(
|
|
'l1_simple_replace',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _l2SuggestionMeta = const VerificationMeta(
|
|
'l2Suggestion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> l2Suggestion = GeneratedColumn<String>(
|
|
'l2_suggestion',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _l3IdentityMeta = const VerificationMeta(
|
|
'l3Identity',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> l3Identity = GeneratedColumn<String>(
|
|
'l3_identity',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
domain,
|
|
avoidanceKeyword,
|
|
l0Example,
|
|
l1SimpleReplace,
|
|
l2Suggestion,
|
|
l3Identity,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'frame_patterns';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<FramePattern> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('domain')) {
|
|
context.handle(
|
|
_domainMeta,
|
|
domain.isAcceptableOrUnknown(data['domain']!, _domainMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('avoidance_keyword')) {
|
|
context.handle(
|
|
_avoidanceKeywordMeta,
|
|
avoidanceKeyword.isAcceptableOrUnknown(
|
|
data['avoidance_keyword']!,
|
|
_avoidanceKeywordMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_avoidanceKeywordMeta);
|
|
}
|
|
if (data.containsKey('l0_example')) {
|
|
context.handle(
|
|
_l0ExampleMeta,
|
|
l0Example.isAcceptableOrUnknown(data['l0_example']!, _l0ExampleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_l0ExampleMeta);
|
|
}
|
|
if (data.containsKey('l1_simple_replace')) {
|
|
context.handle(
|
|
_l1SimpleReplaceMeta,
|
|
l1SimpleReplace.isAcceptableOrUnknown(
|
|
data['l1_simple_replace']!,
|
|
_l1SimpleReplaceMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('l2_suggestion')) {
|
|
context.handle(
|
|
_l2SuggestionMeta,
|
|
l2Suggestion.isAcceptableOrUnknown(
|
|
data['l2_suggestion']!,
|
|
_l2SuggestionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_l2SuggestionMeta);
|
|
}
|
|
if (data.containsKey('l3_identity')) {
|
|
context.handle(
|
|
_l3IdentityMeta,
|
|
l3Identity.isAcceptableOrUnknown(data['l3_identity']!, _l3IdentityMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
FramePattern map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return FramePattern(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
domain: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}domain'],
|
|
),
|
|
avoidanceKeyword: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}avoidance_keyword'],
|
|
)!,
|
|
l0Example: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}l0_example'],
|
|
)!,
|
|
l1SimpleReplace: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}l1_simple_replace'],
|
|
),
|
|
l2Suggestion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}l2_suggestion'],
|
|
)!,
|
|
l3Identity: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}l3_identity'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$FramePatternsTable createAlias(String alias) {
|
|
return $FramePatternsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class FramePattern extends DataClass implements Insertable<FramePattern> {
|
|
final String id;
|
|
final String? domain;
|
|
final String avoidanceKeyword;
|
|
final String l0Example;
|
|
final String? l1SimpleReplace;
|
|
final String l2Suggestion;
|
|
final String? l3Identity;
|
|
const FramePattern({
|
|
required this.id,
|
|
this.domain,
|
|
required this.avoidanceKeyword,
|
|
required this.l0Example,
|
|
this.l1SimpleReplace,
|
|
required this.l2Suggestion,
|
|
this.l3Identity,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
if (!nullToAbsent || domain != null) {
|
|
map['domain'] = Variable<String>(domain);
|
|
}
|
|
map['avoidance_keyword'] = Variable<String>(avoidanceKeyword);
|
|
map['l0_example'] = Variable<String>(l0Example);
|
|
if (!nullToAbsent || l1SimpleReplace != null) {
|
|
map['l1_simple_replace'] = Variable<String>(l1SimpleReplace);
|
|
}
|
|
map['l2_suggestion'] = Variable<String>(l2Suggestion);
|
|
if (!nullToAbsent || l3Identity != null) {
|
|
map['l3_identity'] = Variable<String>(l3Identity);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
FramePatternsCompanion toCompanion(bool nullToAbsent) {
|
|
return FramePatternsCompanion(
|
|
id: Value(id),
|
|
domain: domain == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(domain),
|
|
avoidanceKeyword: Value(avoidanceKeyword),
|
|
l0Example: Value(l0Example),
|
|
l1SimpleReplace: l1SimpleReplace == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(l1SimpleReplace),
|
|
l2Suggestion: Value(l2Suggestion),
|
|
l3Identity: l3Identity == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(l3Identity),
|
|
);
|
|
}
|
|
|
|
factory FramePattern.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return FramePattern(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
domain: serializer.fromJson<String?>(json['domain']),
|
|
avoidanceKeyword: serializer.fromJson<String>(json['avoidanceKeyword']),
|
|
l0Example: serializer.fromJson<String>(json['l0Example']),
|
|
l1SimpleReplace: serializer.fromJson<String?>(json['l1SimpleReplace']),
|
|
l2Suggestion: serializer.fromJson<String>(json['l2Suggestion']),
|
|
l3Identity: serializer.fromJson<String?>(json['l3Identity']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'domain': serializer.toJson<String?>(domain),
|
|
'avoidanceKeyword': serializer.toJson<String>(avoidanceKeyword),
|
|
'l0Example': serializer.toJson<String>(l0Example),
|
|
'l1SimpleReplace': serializer.toJson<String?>(l1SimpleReplace),
|
|
'l2Suggestion': serializer.toJson<String>(l2Suggestion),
|
|
'l3Identity': serializer.toJson<String?>(l3Identity),
|
|
};
|
|
}
|
|
|
|
FramePattern copyWith({
|
|
String? id,
|
|
Value<String?> domain = const Value.absent(),
|
|
String? avoidanceKeyword,
|
|
String? l0Example,
|
|
Value<String?> l1SimpleReplace = const Value.absent(),
|
|
String? l2Suggestion,
|
|
Value<String?> l3Identity = const Value.absent(),
|
|
}) => FramePattern(
|
|
id: id ?? this.id,
|
|
domain: domain.present ? domain.value : this.domain,
|
|
avoidanceKeyword: avoidanceKeyword ?? this.avoidanceKeyword,
|
|
l0Example: l0Example ?? this.l0Example,
|
|
l1SimpleReplace: l1SimpleReplace.present
|
|
? l1SimpleReplace.value
|
|
: this.l1SimpleReplace,
|
|
l2Suggestion: l2Suggestion ?? this.l2Suggestion,
|
|
l3Identity: l3Identity.present ? l3Identity.value : this.l3Identity,
|
|
);
|
|
FramePattern copyWithCompanion(FramePatternsCompanion data) {
|
|
return FramePattern(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
domain: data.domain.present ? data.domain.value : this.domain,
|
|
avoidanceKeyword: data.avoidanceKeyword.present
|
|
? data.avoidanceKeyword.value
|
|
: this.avoidanceKeyword,
|
|
l0Example: data.l0Example.present ? data.l0Example.value : this.l0Example,
|
|
l1SimpleReplace: data.l1SimpleReplace.present
|
|
? data.l1SimpleReplace.value
|
|
: this.l1SimpleReplace,
|
|
l2Suggestion: data.l2Suggestion.present
|
|
? data.l2Suggestion.value
|
|
: this.l2Suggestion,
|
|
l3Identity: data.l3Identity.present
|
|
? data.l3Identity.value
|
|
: this.l3Identity,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FramePattern(')
|
|
..write('id: $id, ')
|
|
..write('domain: $domain, ')
|
|
..write('avoidanceKeyword: $avoidanceKeyword, ')
|
|
..write('l0Example: $l0Example, ')
|
|
..write('l1SimpleReplace: $l1SimpleReplace, ')
|
|
..write('l2Suggestion: $l2Suggestion, ')
|
|
..write('l3Identity: $l3Identity')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
domain,
|
|
avoidanceKeyword,
|
|
l0Example,
|
|
l1SimpleReplace,
|
|
l2Suggestion,
|
|
l3Identity,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is FramePattern &&
|
|
other.id == this.id &&
|
|
other.domain == this.domain &&
|
|
other.avoidanceKeyword == this.avoidanceKeyword &&
|
|
other.l0Example == this.l0Example &&
|
|
other.l1SimpleReplace == this.l1SimpleReplace &&
|
|
other.l2Suggestion == this.l2Suggestion &&
|
|
other.l3Identity == this.l3Identity);
|
|
}
|
|
|
|
class FramePatternsCompanion extends UpdateCompanion<FramePattern> {
|
|
final Value<String> id;
|
|
final Value<String?> domain;
|
|
final Value<String> avoidanceKeyword;
|
|
final Value<String> l0Example;
|
|
final Value<String?> l1SimpleReplace;
|
|
final Value<String> l2Suggestion;
|
|
final Value<String?> l3Identity;
|
|
final Value<int> rowid;
|
|
const FramePatternsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.domain = const Value.absent(),
|
|
this.avoidanceKeyword = const Value.absent(),
|
|
this.l0Example = const Value.absent(),
|
|
this.l1SimpleReplace = const Value.absent(),
|
|
this.l2Suggestion = const Value.absent(),
|
|
this.l3Identity = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
FramePatternsCompanion.insert({
|
|
required String id,
|
|
this.domain = const Value.absent(),
|
|
required String avoidanceKeyword,
|
|
required String l0Example,
|
|
this.l1SimpleReplace = const Value.absent(),
|
|
required String l2Suggestion,
|
|
this.l3Identity = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
avoidanceKeyword = Value(avoidanceKeyword),
|
|
l0Example = Value(l0Example),
|
|
l2Suggestion = Value(l2Suggestion);
|
|
static Insertable<FramePattern> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? domain,
|
|
Expression<String>? avoidanceKeyword,
|
|
Expression<String>? l0Example,
|
|
Expression<String>? l1SimpleReplace,
|
|
Expression<String>? l2Suggestion,
|
|
Expression<String>? l3Identity,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (domain != null) 'domain': domain,
|
|
if (avoidanceKeyword != null) 'avoidance_keyword': avoidanceKeyword,
|
|
if (l0Example != null) 'l0_example': l0Example,
|
|
if (l1SimpleReplace != null) 'l1_simple_replace': l1SimpleReplace,
|
|
if (l2Suggestion != null) 'l2_suggestion': l2Suggestion,
|
|
if (l3Identity != null) 'l3_identity': l3Identity,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
FramePatternsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String?>? domain,
|
|
Value<String>? avoidanceKeyword,
|
|
Value<String>? l0Example,
|
|
Value<String?>? l1SimpleReplace,
|
|
Value<String>? l2Suggestion,
|
|
Value<String?>? l3Identity,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return FramePatternsCompanion(
|
|
id: id ?? this.id,
|
|
domain: domain ?? this.domain,
|
|
avoidanceKeyword: avoidanceKeyword ?? this.avoidanceKeyword,
|
|
l0Example: l0Example ?? this.l0Example,
|
|
l1SimpleReplace: l1SimpleReplace ?? this.l1SimpleReplace,
|
|
l2Suggestion: l2Suggestion ?? this.l2Suggestion,
|
|
l3Identity: l3Identity ?? this.l3Identity,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (domain.present) {
|
|
map['domain'] = Variable<String>(domain.value);
|
|
}
|
|
if (avoidanceKeyword.present) {
|
|
map['avoidance_keyword'] = Variable<String>(avoidanceKeyword.value);
|
|
}
|
|
if (l0Example.present) {
|
|
map['l0_example'] = Variable<String>(l0Example.value);
|
|
}
|
|
if (l1SimpleReplace.present) {
|
|
map['l1_simple_replace'] = Variable<String>(l1SimpleReplace.value);
|
|
}
|
|
if (l2Suggestion.present) {
|
|
map['l2_suggestion'] = Variable<String>(l2Suggestion.value);
|
|
}
|
|
if (l3Identity.present) {
|
|
map['l3_identity'] = Variable<String>(l3Identity.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FramePatternsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('domain: $domain, ')
|
|
..write('avoidanceKeyword: $avoidanceKeyword, ')
|
|
..write('l0Example: $l0Example, ')
|
|
..write('l1SimpleReplace: $l1SimpleReplace, ')
|
|
..write('l2Suggestion: $l2Suggestion, ')
|
|
..write('l3Identity: $l3Identity, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $RewardMenuItemsTable extends RewardMenuItems
|
|
with TableInfo<$RewardMenuItemsTable, RewardMenuItem> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$RewardMenuItemsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _tierRecommendedMeta = const VerificationMeta(
|
|
'tierRecommended',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> tierRecommended = GeneratedColumn<String>(
|
|
'tier_recommended',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"tier_recommended IN ('T0','T1','T2','T3','T4')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
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 _estimatedCostKrwMinMeta =
|
|
const VerificationMeta('estimatedCostKrwMin');
|
|
@override
|
|
late final GeneratedColumn<int> estimatedCostKrwMin = GeneratedColumn<int>(
|
|
'estimated_cost_krw_min',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _estimatedCostKrwMaxMeta =
|
|
const VerificationMeta('estimatedCostKrwMax');
|
|
@override
|
|
late final GeneratedColumn<int> estimatedCostKrwMax = GeneratedColumn<int>(
|
|
'estimated_cost_krw_max',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isEffortTiedMeta = const VerificationMeta(
|
|
'isEffortTied',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isEffortTied = GeneratedColumn<bool>(
|
|
'is_effort_tied',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_effort_tied" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _tagsJsonMeta = const VerificationMeta(
|
|
'tagsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> tagsJson = GeneratedColumn<String>(
|
|
'tags_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _avoidForBreakHabitsJsonMeta =
|
|
const VerificationMeta('avoidForBreakHabitsJson');
|
|
@override
|
|
late final GeneratedColumn<String> avoidForBreakHabitsJson =
|
|
GeneratedColumn<String>(
|
|
'avoid_for_break_habits_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
tierRecommended,
|
|
title,
|
|
description,
|
|
estimatedCostKrwMin,
|
|
estimatedCostKrwMax,
|
|
isEffortTied,
|
|
tagsJson,
|
|
avoidForBreakHabitsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'reward_menu_items';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<RewardMenuItem> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('tier_recommended')) {
|
|
context.handle(
|
|
_tierRecommendedMeta,
|
|
tierRecommended.isAcceptableOrUnknown(
|
|
data['tier_recommended']!,
|
|
_tierRecommendedMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_tierRecommendedMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!,
|
|
_descriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('estimated_cost_krw_min')) {
|
|
context.handle(
|
|
_estimatedCostKrwMinMeta,
|
|
estimatedCostKrwMin.isAcceptableOrUnknown(
|
|
data['estimated_cost_krw_min']!,
|
|
_estimatedCostKrwMinMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('estimated_cost_krw_max')) {
|
|
context.handle(
|
|
_estimatedCostKrwMaxMeta,
|
|
estimatedCostKrwMax.isAcceptableOrUnknown(
|
|
data['estimated_cost_krw_max']!,
|
|
_estimatedCostKrwMaxMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_effort_tied')) {
|
|
context.handle(
|
|
_isEffortTiedMeta,
|
|
isEffortTied.isAcceptableOrUnknown(
|
|
data['is_effort_tied']!,
|
|
_isEffortTiedMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('tags_json')) {
|
|
context.handle(
|
|
_tagsJsonMeta,
|
|
tagsJson.isAcceptableOrUnknown(data['tags_json']!, _tagsJsonMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('avoid_for_break_habits_json')) {
|
|
context.handle(
|
|
_avoidForBreakHabitsJsonMeta,
|
|
avoidForBreakHabitsJson.isAcceptableOrUnknown(
|
|
data['avoid_for_break_habits_json']!,
|
|
_avoidForBreakHabitsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
RewardMenuItem map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return RewardMenuItem(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
tierRecommended: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tier_recommended'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
description: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}description'],
|
|
),
|
|
estimatedCostKrwMin: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}estimated_cost_krw_min'],
|
|
),
|
|
estimatedCostKrwMax: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}estimated_cost_krw_max'],
|
|
),
|
|
isEffortTied: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_effort_tied'],
|
|
),
|
|
tagsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tags_json'],
|
|
),
|
|
avoidForBreakHabitsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}avoid_for_break_habits_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$RewardMenuItemsTable createAlias(String alias) {
|
|
return $RewardMenuItemsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class RewardMenuItem extends DataClass implements Insertable<RewardMenuItem> {
|
|
final String id;
|
|
final String tierRecommended;
|
|
final String title;
|
|
final String? description;
|
|
final int? estimatedCostKrwMin;
|
|
final int? estimatedCostKrwMax;
|
|
final bool? isEffortTied;
|
|
final String? tagsJson;
|
|
final String? avoidForBreakHabitsJson;
|
|
const RewardMenuItem({
|
|
required this.id,
|
|
required this.tierRecommended,
|
|
required this.title,
|
|
this.description,
|
|
this.estimatedCostKrwMin,
|
|
this.estimatedCostKrwMax,
|
|
this.isEffortTied,
|
|
this.tagsJson,
|
|
this.avoidForBreakHabitsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['tier_recommended'] = Variable<String>(tierRecommended);
|
|
map['title'] = Variable<String>(title);
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
if (!nullToAbsent || estimatedCostKrwMin != null) {
|
|
map['estimated_cost_krw_min'] = Variable<int>(estimatedCostKrwMin);
|
|
}
|
|
if (!nullToAbsent || estimatedCostKrwMax != null) {
|
|
map['estimated_cost_krw_max'] = Variable<int>(estimatedCostKrwMax);
|
|
}
|
|
if (!nullToAbsent || isEffortTied != null) {
|
|
map['is_effort_tied'] = Variable<bool>(isEffortTied);
|
|
}
|
|
if (!nullToAbsent || tagsJson != null) {
|
|
map['tags_json'] = Variable<String>(tagsJson);
|
|
}
|
|
if (!nullToAbsent || avoidForBreakHabitsJson != null) {
|
|
map['avoid_for_break_habits_json'] = Variable<String>(
|
|
avoidForBreakHabitsJson,
|
|
);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
RewardMenuItemsCompanion toCompanion(bool nullToAbsent) {
|
|
return RewardMenuItemsCompanion(
|
|
id: Value(id),
|
|
tierRecommended: Value(tierRecommended),
|
|
title: Value(title),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
estimatedCostKrwMin: estimatedCostKrwMin == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(estimatedCostKrwMin),
|
|
estimatedCostKrwMax: estimatedCostKrwMax == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(estimatedCostKrwMax),
|
|
isEffortTied: isEffortTied == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(isEffortTied),
|
|
tagsJson: tagsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(tagsJson),
|
|
avoidForBreakHabitsJson: avoidForBreakHabitsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(avoidForBreakHabitsJson),
|
|
);
|
|
}
|
|
|
|
factory RewardMenuItem.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return RewardMenuItem(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
tierRecommended: serializer.fromJson<String>(json['tierRecommended']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
estimatedCostKrwMin: serializer.fromJson<int?>(
|
|
json['estimatedCostKrwMin'],
|
|
),
|
|
estimatedCostKrwMax: serializer.fromJson<int?>(
|
|
json['estimatedCostKrwMax'],
|
|
),
|
|
isEffortTied: serializer.fromJson<bool?>(json['isEffortTied']),
|
|
tagsJson: serializer.fromJson<String?>(json['tagsJson']),
|
|
avoidForBreakHabitsJson: serializer.fromJson<String?>(
|
|
json['avoidForBreakHabitsJson'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'tierRecommended': serializer.toJson<String>(tierRecommended),
|
|
'title': serializer.toJson<String>(title),
|
|
'description': serializer.toJson<String?>(description),
|
|
'estimatedCostKrwMin': serializer.toJson<int?>(estimatedCostKrwMin),
|
|
'estimatedCostKrwMax': serializer.toJson<int?>(estimatedCostKrwMax),
|
|
'isEffortTied': serializer.toJson<bool?>(isEffortTied),
|
|
'tagsJson': serializer.toJson<String?>(tagsJson),
|
|
'avoidForBreakHabitsJson': serializer.toJson<String?>(
|
|
avoidForBreakHabitsJson,
|
|
),
|
|
};
|
|
}
|
|
|
|
RewardMenuItem copyWith({
|
|
String? id,
|
|
String? tierRecommended,
|
|
String? title,
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMin = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMax = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
Value<String?> avoidForBreakHabitsJson = const Value.absent(),
|
|
}) => RewardMenuItem(
|
|
id: id ?? this.id,
|
|
tierRecommended: tierRecommended ?? this.tierRecommended,
|
|
title: title ?? this.title,
|
|
description: description.present ? description.value : this.description,
|
|
estimatedCostKrwMin: estimatedCostKrwMin.present
|
|
? estimatedCostKrwMin.value
|
|
: this.estimatedCostKrwMin,
|
|
estimatedCostKrwMax: estimatedCostKrwMax.present
|
|
? estimatedCostKrwMax.value
|
|
: this.estimatedCostKrwMax,
|
|
isEffortTied: isEffortTied.present ? isEffortTied.value : this.isEffortTied,
|
|
tagsJson: tagsJson.present ? tagsJson.value : this.tagsJson,
|
|
avoidForBreakHabitsJson: avoidForBreakHabitsJson.present
|
|
? avoidForBreakHabitsJson.value
|
|
: this.avoidForBreakHabitsJson,
|
|
);
|
|
RewardMenuItem copyWithCompanion(RewardMenuItemsCompanion data) {
|
|
return RewardMenuItem(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
tierRecommended: data.tierRecommended.present
|
|
? data.tierRecommended.value
|
|
: this.tierRecommended,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
description: data.description.present
|
|
? data.description.value
|
|
: this.description,
|
|
estimatedCostKrwMin: data.estimatedCostKrwMin.present
|
|
? data.estimatedCostKrwMin.value
|
|
: this.estimatedCostKrwMin,
|
|
estimatedCostKrwMax: data.estimatedCostKrwMax.present
|
|
? data.estimatedCostKrwMax.value
|
|
: this.estimatedCostKrwMax,
|
|
isEffortTied: data.isEffortTied.present
|
|
? data.isEffortTied.value
|
|
: this.isEffortTied,
|
|
tagsJson: data.tagsJson.present ? data.tagsJson.value : this.tagsJson,
|
|
avoidForBreakHabitsJson: data.avoidForBreakHabitsJson.present
|
|
? data.avoidForBreakHabitsJson.value
|
|
: this.avoidForBreakHabitsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardMenuItem(')
|
|
..write('id: $id, ')
|
|
..write('tierRecommended: $tierRecommended, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('estimatedCostKrwMin: $estimatedCostKrwMin, ')
|
|
..write('estimatedCostKrwMax: $estimatedCostKrwMax, ')
|
|
..write('isEffortTied: $isEffortTied, ')
|
|
..write('tagsJson: $tagsJson, ')
|
|
..write('avoidForBreakHabitsJson: $avoidForBreakHabitsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
tierRecommended,
|
|
title,
|
|
description,
|
|
estimatedCostKrwMin,
|
|
estimatedCostKrwMax,
|
|
isEffortTied,
|
|
tagsJson,
|
|
avoidForBreakHabitsJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is RewardMenuItem &&
|
|
other.id == this.id &&
|
|
other.tierRecommended == this.tierRecommended &&
|
|
other.title == this.title &&
|
|
other.description == this.description &&
|
|
other.estimatedCostKrwMin == this.estimatedCostKrwMin &&
|
|
other.estimatedCostKrwMax == this.estimatedCostKrwMax &&
|
|
other.isEffortTied == this.isEffortTied &&
|
|
other.tagsJson == this.tagsJson &&
|
|
other.avoidForBreakHabitsJson == this.avoidForBreakHabitsJson);
|
|
}
|
|
|
|
class RewardMenuItemsCompanion extends UpdateCompanion<RewardMenuItem> {
|
|
final Value<String> id;
|
|
final Value<String> tierRecommended;
|
|
final Value<String> title;
|
|
final Value<String?> description;
|
|
final Value<int?> estimatedCostKrwMin;
|
|
final Value<int?> estimatedCostKrwMax;
|
|
final Value<bool?> isEffortTied;
|
|
final Value<String?> tagsJson;
|
|
final Value<String?> avoidForBreakHabitsJson;
|
|
final Value<int> rowid;
|
|
const RewardMenuItemsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.tierRecommended = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.estimatedCostKrwMin = const Value.absent(),
|
|
this.estimatedCostKrwMax = const Value.absent(),
|
|
this.isEffortTied = const Value.absent(),
|
|
this.tagsJson = const Value.absent(),
|
|
this.avoidForBreakHabitsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
RewardMenuItemsCompanion.insert({
|
|
required String id,
|
|
required String tierRecommended,
|
|
required String title,
|
|
this.description = const Value.absent(),
|
|
this.estimatedCostKrwMin = const Value.absent(),
|
|
this.estimatedCostKrwMax = const Value.absent(),
|
|
this.isEffortTied = const Value.absent(),
|
|
this.tagsJson = const Value.absent(),
|
|
this.avoidForBreakHabitsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
tierRecommended = Value(tierRecommended),
|
|
title = Value(title);
|
|
static Insertable<RewardMenuItem> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? tierRecommended,
|
|
Expression<String>? title,
|
|
Expression<String>? description,
|
|
Expression<int>? estimatedCostKrwMin,
|
|
Expression<int>? estimatedCostKrwMax,
|
|
Expression<bool>? isEffortTied,
|
|
Expression<String>? tagsJson,
|
|
Expression<String>? avoidForBreakHabitsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (tierRecommended != null) 'tier_recommended': tierRecommended,
|
|
if (title != null) 'title': title,
|
|
if (description != null) 'description': description,
|
|
if (estimatedCostKrwMin != null)
|
|
'estimated_cost_krw_min': estimatedCostKrwMin,
|
|
if (estimatedCostKrwMax != null)
|
|
'estimated_cost_krw_max': estimatedCostKrwMax,
|
|
if (isEffortTied != null) 'is_effort_tied': isEffortTied,
|
|
if (tagsJson != null) 'tags_json': tagsJson,
|
|
if (avoidForBreakHabitsJson != null)
|
|
'avoid_for_break_habits_json': avoidForBreakHabitsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
RewardMenuItemsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? tierRecommended,
|
|
Value<String>? title,
|
|
Value<String?>? description,
|
|
Value<int?>? estimatedCostKrwMin,
|
|
Value<int?>? estimatedCostKrwMax,
|
|
Value<bool?>? isEffortTied,
|
|
Value<String?>? tagsJson,
|
|
Value<String?>? avoidForBreakHabitsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return RewardMenuItemsCompanion(
|
|
id: id ?? this.id,
|
|
tierRecommended: tierRecommended ?? this.tierRecommended,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
estimatedCostKrwMin: estimatedCostKrwMin ?? this.estimatedCostKrwMin,
|
|
estimatedCostKrwMax: estimatedCostKrwMax ?? this.estimatedCostKrwMax,
|
|
isEffortTied: isEffortTied ?? this.isEffortTied,
|
|
tagsJson: tagsJson ?? this.tagsJson,
|
|
avoidForBreakHabitsJson:
|
|
avoidForBreakHabitsJson ?? this.avoidForBreakHabitsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (tierRecommended.present) {
|
|
map['tier_recommended'] = Variable<String>(tierRecommended.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (estimatedCostKrwMin.present) {
|
|
map['estimated_cost_krw_min'] = Variable<int>(estimatedCostKrwMin.value);
|
|
}
|
|
if (estimatedCostKrwMax.present) {
|
|
map['estimated_cost_krw_max'] = Variable<int>(estimatedCostKrwMax.value);
|
|
}
|
|
if (isEffortTied.present) {
|
|
map['is_effort_tied'] = Variable<bool>(isEffortTied.value);
|
|
}
|
|
if (tagsJson.present) {
|
|
map['tags_json'] = Variable<String>(tagsJson.value);
|
|
}
|
|
if (avoidForBreakHabitsJson.present) {
|
|
map['avoid_for_break_habits_json'] = Variable<String>(
|
|
avoidForBreakHabitsJson.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardMenuItemsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('tierRecommended: $tierRecommended, ')
|
|
..write('title: $title, ')
|
|
..write('description: $description, ')
|
|
..write('estimatedCostKrwMin: $estimatedCostKrwMin, ')
|
|
..write('estimatedCostKrwMax: $estimatedCostKrwMax, ')
|
|
..write('isEffortTied: $isEffortTied, ')
|
|
..write('tagsJson: $tagsJson, ')
|
|
..write('avoidForBreakHabitsJson: $avoidForBreakHabitsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ReferencesTable extends References
|
|
with TableInfo<$ReferencesTable, ReferenceRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ReferencesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _kindMeta = const VerificationMeta('kind');
|
|
@override
|
|
late final GeneratedColumn<String> kind = GeneratedColumn<String>(
|
|
'kind',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"kind IN ('paper','podcast_episode','book','url','korean_explainer')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _authorsJsonMeta = const VerificationMeta(
|
|
'authorsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> authorsJson = GeneratedColumn<String>(
|
|
'authors_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _yearMeta = const VerificationMeta('year');
|
|
@override
|
|
late final GeneratedColumn<int> year = GeneratedColumn<int>(
|
|
'year',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"year IS NULL OR (year BETWEEN 1900 AND 2100)",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _journalMeta = const VerificationMeta(
|
|
'journal',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> journal = GeneratedColumn<String>(
|
|
'journal',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _doiMeta = const VerificationMeta('doi');
|
|
@override
|
|
late final GeneratedColumn<String> doi = GeneratedColumn<String>(
|
|
'doi',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _urlMeta = const VerificationMeta('url');
|
|
@override
|
|
late final GeneratedColumn<String> url = GeneratedColumn<String>(
|
|
'url',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _episodeNumberMeta = const VerificationMeta(
|
|
'episodeNumber',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> episodeNumber = GeneratedColumn<int>(
|
|
'episode_number',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _publisherMeta = const VerificationMeta(
|
|
'publisher',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> publisher = GeneratedColumn<String>(
|
|
'publisher',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta(
|
|
'evidenceStrength',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> evidenceStrength = GeneratedColumn<String>(
|
|
'evidence_strength',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"evidence_strength IS NULL OR evidence_strength IN ('strong_rct','meta_analysis','observational','mechanistic','expert_opinion')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _verifiedMeta = const VerificationMeta(
|
|
'verified',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> verified = GeneratedColumn<bool>(
|
|
'verified',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("verified" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
kind,
|
|
title,
|
|
authorsJson,
|
|
year,
|
|
journal,
|
|
doi,
|
|
url,
|
|
episodeNumber,
|
|
publisher,
|
|
evidenceStrength,
|
|
verified,
|
|
note,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'references';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ReferenceRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('kind')) {
|
|
context.handle(
|
|
_kindMeta,
|
|
kind.isAcceptableOrUnknown(data['kind']!, _kindMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_kindMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('authors_json')) {
|
|
context.handle(
|
|
_authorsJsonMeta,
|
|
authorsJson.isAcceptableOrUnknown(
|
|
data['authors_json']!,
|
|
_authorsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('year')) {
|
|
context.handle(
|
|
_yearMeta,
|
|
year.isAcceptableOrUnknown(data['year']!, _yearMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('journal')) {
|
|
context.handle(
|
|
_journalMeta,
|
|
journal.isAcceptableOrUnknown(data['journal']!, _journalMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('doi')) {
|
|
context.handle(
|
|
_doiMeta,
|
|
doi.isAcceptableOrUnknown(data['doi']!, _doiMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('url')) {
|
|
context.handle(
|
|
_urlMeta,
|
|
url.isAcceptableOrUnknown(data['url']!, _urlMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('episode_number')) {
|
|
context.handle(
|
|
_episodeNumberMeta,
|
|
episodeNumber.isAcceptableOrUnknown(
|
|
data['episode_number']!,
|
|
_episodeNumberMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('publisher')) {
|
|
context.handle(
|
|
_publisherMeta,
|
|
publisher.isAcceptableOrUnknown(data['publisher']!, _publisherMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('evidence_strength')) {
|
|
context.handle(
|
|
_evidenceStrengthMeta,
|
|
evidenceStrength.isAcceptableOrUnknown(
|
|
data['evidence_strength']!,
|
|
_evidenceStrengthMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('verified')) {
|
|
context.handle(
|
|
_verifiedMeta,
|
|
verified.isAcceptableOrUnknown(data['verified']!, _verifiedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ReferenceRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ReferenceRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
kind: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kind'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
authorsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}authors_json'],
|
|
),
|
|
year: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}year'],
|
|
),
|
|
journal: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}journal'],
|
|
),
|
|
doi: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}doi'],
|
|
),
|
|
url: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}url'],
|
|
),
|
|
episodeNumber: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}episode_number'],
|
|
),
|
|
publisher: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}publisher'],
|
|
),
|
|
evidenceStrength: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}evidence_strength'],
|
|
),
|
|
verified: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}verified'],
|
|
),
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ReferencesTable createAlias(String alias) {
|
|
return $ReferencesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ReferenceRow extends DataClass implements Insertable<ReferenceRow> {
|
|
final String id;
|
|
final String kind;
|
|
final String title;
|
|
final String? authorsJson;
|
|
final int? year;
|
|
final String? journal;
|
|
final String? doi;
|
|
final String? url;
|
|
final int? episodeNumber;
|
|
final String? publisher;
|
|
final String? evidenceStrength;
|
|
final bool? verified;
|
|
final String? note;
|
|
const ReferenceRow({
|
|
required this.id,
|
|
required this.kind,
|
|
required this.title,
|
|
this.authorsJson,
|
|
this.year,
|
|
this.journal,
|
|
this.doi,
|
|
this.url,
|
|
this.episodeNumber,
|
|
this.publisher,
|
|
this.evidenceStrength,
|
|
this.verified,
|
|
this.note,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['kind'] = Variable<String>(kind);
|
|
map['title'] = Variable<String>(title);
|
|
if (!nullToAbsent || authorsJson != null) {
|
|
map['authors_json'] = Variable<String>(authorsJson);
|
|
}
|
|
if (!nullToAbsent || year != null) {
|
|
map['year'] = Variable<int>(year);
|
|
}
|
|
if (!nullToAbsent || journal != null) {
|
|
map['journal'] = Variable<String>(journal);
|
|
}
|
|
if (!nullToAbsent || doi != null) {
|
|
map['doi'] = Variable<String>(doi);
|
|
}
|
|
if (!nullToAbsent || url != null) {
|
|
map['url'] = Variable<String>(url);
|
|
}
|
|
if (!nullToAbsent || episodeNumber != null) {
|
|
map['episode_number'] = Variable<int>(episodeNumber);
|
|
}
|
|
if (!nullToAbsent || publisher != null) {
|
|
map['publisher'] = Variable<String>(publisher);
|
|
}
|
|
if (!nullToAbsent || evidenceStrength != null) {
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength);
|
|
}
|
|
if (!nullToAbsent || verified != null) {
|
|
map['verified'] = Variable<bool>(verified);
|
|
}
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ReferencesCompanion toCompanion(bool nullToAbsent) {
|
|
return ReferencesCompanion(
|
|
id: Value(id),
|
|
kind: Value(kind),
|
|
title: Value(title),
|
|
authorsJson: authorsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(authorsJson),
|
|
year: year == null && nullToAbsent ? const Value.absent() : Value(year),
|
|
journal: journal == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(journal),
|
|
doi: doi == null && nullToAbsent ? const Value.absent() : Value(doi),
|
|
url: url == null && nullToAbsent ? const Value.absent() : Value(url),
|
|
episodeNumber: episodeNumber == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(episodeNumber),
|
|
publisher: publisher == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(publisher),
|
|
evidenceStrength: evidenceStrength == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(evidenceStrength),
|
|
verified: verified == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(verified),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
);
|
|
}
|
|
|
|
factory ReferenceRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ReferenceRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
kind: serializer.fromJson<String>(json['kind']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
authorsJson: serializer.fromJson<String?>(json['authorsJson']),
|
|
year: serializer.fromJson<int?>(json['year']),
|
|
journal: serializer.fromJson<String?>(json['journal']),
|
|
doi: serializer.fromJson<String?>(json['doi']),
|
|
url: serializer.fromJson<String?>(json['url']),
|
|
episodeNumber: serializer.fromJson<int?>(json['episodeNumber']),
|
|
publisher: serializer.fromJson<String?>(json['publisher']),
|
|
evidenceStrength: serializer.fromJson<String?>(json['evidenceStrength']),
|
|
verified: serializer.fromJson<bool?>(json['verified']),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'kind': serializer.toJson<String>(kind),
|
|
'title': serializer.toJson<String>(title),
|
|
'authorsJson': serializer.toJson<String?>(authorsJson),
|
|
'year': serializer.toJson<int?>(year),
|
|
'journal': serializer.toJson<String?>(journal),
|
|
'doi': serializer.toJson<String?>(doi),
|
|
'url': serializer.toJson<String?>(url),
|
|
'episodeNumber': serializer.toJson<int?>(episodeNumber),
|
|
'publisher': serializer.toJson<String?>(publisher),
|
|
'evidenceStrength': serializer.toJson<String?>(evidenceStrength),
|
|
'verified': serializer.toJson<bool?>(verified),
|
|
'note': serializer.toJson<String?>(note),
|
|
};
|
|
}
|
|
|
|
ReferenceRow copyWith({
|
|
String? id,
|
|
String? kind,
|
|
String? title,
|
|
Value<String?> authorsJson = const Value.absent(),
|
|
Value<int?> year = const Value.absent(),
|
|
Value<String?> journal = const Value.absent(),
|
|
Value<String?> doi = const Value.absent(),
|
|
Value<String?> url = const Value.absent(),
|
|
Value<int?> episodeNumber = const Value.absent(),
|
|
Value<String?> publisher = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<bool?> verified = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
}) => ReferenceRow(
|
|
id: id ?? this.id,
|
|
kind: kind ?? this.kind,
|
|
title: title ?? this.title,
|
|
authorsJson: authorsJson.present ? authorsJson.value : this.authorsJson,
|
|
year: year.present ? year.value : this.year,
|
|
journal: journal.present ? journal.value : this.journal,
|
|
doi: doi.present ? doi.value : this.doi,
|
|
url: url.present ? url.value : this.url,
|
|
episodeNumber: episodeNumber.present
|
|
? episodeNumber.value
|
|
: this.episodeNumber,
|
|
publisher: publisher.present ? publisher.value : this.publisher,
|
|
evidenceStrength: evidenceStrength.present
|
|
? evidenceStrength.value
|
|
: this.evidenceStrength,
|
|
verified: verified.present ? verified.value : this.verified,
|
|
note: note.present ? note.value : this.note,
|
|
);
|
|
ReferenceRow copyWithCompanion(ReferencesCompanion data) {
|
|
return ReferenceRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
kind: data.kind.present ? data.kind.value : this.kind,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
authorsJson: data.authorsJson.present
|
|
? data.authorsJson.value
|
|
: this.authorsJson,
|
|
year: data.year.present ? data.year.value : this.year,
|
|
journal: data.journal.present ? data.journal.value : this.journal,
|
|
doi: data.doi.present ? data.doi.value : this.doi,
|
|
url: data.url.present ? data.url.value : this.url,
|
|
episodeNumber: data.episodeNumber.present
|
|
? data.episodeNumber.value
|
|
: this.episodeNumber,
|
|
publisher: data.publisher.present ? data.publisher.value : this.publisher,
|
|
evidenceStrength: data.evidenceStrength.present
|
|
? data.evidenceStrength.value
|
|
: this.evidenceStrength,
|
|
verified: data.verified.present ? data.verified.value : this.verified,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ReferenceRow(')
|
|
..write('id: $id, ')
|
|
..write('kind: $kind, ')
|
|
..write('title: $title, ')
|
|
..write('authorsJson: $authorsJson, ')
|
|
..write('year: $year, ')
|
|
..write('journal: $journal, ')
|
|
..write('doi: $doi, ')
|
|
..write('url: $url, ')
|
|
..write('episodeNumber: $episodeNumber, ')
|
|
..write('publisher: $publisher, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('verified: $verified, ')
|
|
..write('note: $note')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
kind,
|
|
title,
|
|
authorsJson,
|
|
year,
|
|
journal,
|
|
doi,
|
|
url,
|
|
episodeNumber,
|
|
publisher,
|
|
evidenceStrength,
|
|
verified,
|
|
note,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ReferenceRow &&
|
|
other.id == this.id &&
|
|
other.kind == this.kind &&
|
|
other.title == this.title &&
|
|
other.authorsJson == this.authorsJson &&
|
|
other.year == this.year &&
|
|
other.journal == this.journal &&
|
|
other.doi == this.doi &&
|
|
other.url == this.url &&
|
|
other.episodeNumber == this.episodeNumber &&
|
|
other.publisher == this.publisher &&
|
|
other.evidenceStrength == this.evidenceStrength &&
|
|
other.verified == this.verified &&
|
|
other.note == this.note);
|
|
}
|
|
|
|
class ReferencesCompanion extends UpdateCompanion<ReferenceRow> {
|
|
final Value<String> id;
|
|
final Value<String> kind;
|
|
final Value<String> title;
|
|
final Value<String?> authorsJson;
|
|
final Value<int?> year;
|
|
final Value<String?> journal;
|
|
final Value<String?> doi;
|
|
final Value<String?> url;
|
|
final Value<int?> episodeNumber;
|
|
final Value<String?> publisher;
|
|
final Value<String?> evidenceStrength;
|
|
final Value<bool?> verified;
|
|
final Value<String?> note;
|
|
final Value<int> rowid;
|
|
const ReferencesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.kind = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.authorsJson = const Value.absent(),
|
|
this.year = const Value.absent(),
|
|
this.journal = const Value.absent(),
|
|
this.doi = const Value.absent(),
|
|
this.url = const Value.absent(),
|
|
this.episodeNumber = const Value.absent(),
|
|
this.publisher = const Value.absent(),
|
|
this.evidenceStrength = const Value.absent(),
|
|
this.verified = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ReferencesCompanion.insert({
|
|
required String id,
|
|
required String kind,
|
|
required String title,
|
|
this.authorsJson = const Value.absent(),
|
|
this.year = const Value.absent(),
|
|
this.journal = const Value.absent(),
|
|
this.doi = const Value.absent(),
|
|
this.url = const Value.absent(),
|
|
this.episodeNumber = const Value.absent(),
|
|
this.publisher = const Value.absent(),
|
|
this.evidenceStrength = const Value.absent(),
|
|
this.verified = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
kind = Value(kind),
|
|
title = Value(title);
|
|
static Insertable<ReferenceRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? kind,
|
|
Expression<String>? title,
|
|
Expression<String>? authorsJson,
|
|
Expression<int>? year,
|
|
Expression<String>? journal,
|
|
Expression<String>? doi,
|
|
Expression<String>? url,
|
|
Expression<int>? episodeNumber,
|
|
Expression<String>? publisher,
|
|
Expression<String>? evidenceStrength,
|
|
Expression<bool>? verified,
|
|
Expression<String>? note,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (kind != null) 'kind': kind,
|
|
if (title != null) 'title': title,
|
|
if (authorsJson != null) 'authors_json': authorsJson,
|
|
if (year != null) 'year': year,
|
|
if (journal != null) 'journal': journal,
|
|
if (doi != null) 'doi': doi,
|
|
if (url != null) 'url': url,
|
|
if (episodeNumber != null) 'episode_number': episodeNumber,
|
|
if (publisher != null) 'publisher': publisher,
|
|
if (evidenceStrength != null) 'evidence_strength': evidenceStrength,
|
|
if (verified != null) 'verified': verified,
|
|
if (note != null) 'note': note,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ReferencesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? kind,
|
|
Value<String>? title,
|
|
Value<String?>? authorsJson,
|
|
Value<int?>? year,
|
|
Value<String?>? journal,
|
|
Value<String?>? doi,
|
|
Value<String?>? url,
|
|
Value<int?>? episodeNumber,
|
|
Value<String?>? publisher,
|
|
Value<String?>? evidenceStrength,
|
|
Value<bool?>? verified,
|
|
Value<String?>? note,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ReferencesCompanion(
|
|
id: id ?? this.id,
|
|
kind: kind ?? this.kind,
|
|
title: title ?? this.title,
|
|
authorsJson: authorsJson ?? this.authorsJson,
|
|
year: year ?? this.year,
|
|
journal: journal ?? this.journal,
|
|
doi: doi ?? this.doi,
|
|
url: url ?? this.url,
|
|
episodeNumber: episodeNumber ?? this.episodeNumber,
|
|
publisher: publisher ?? this.publisher,
|
|
evidenceStrength: evidenceStrength ?? this.evidenceStrength,
|
|
verified: verified ?? this.verified,
|
|
note: note ?? this.note,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (kind.present) {
|
|
map['kind'] = Variable<String>(kind.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (authorsJson.present) {
|
|
map['authors_json'] = Variable<String>(authorsJson.value);
|
|
}
|
|
if (year.present) {
|
|
map['year'] = Variable<int>(year.value);
|
|
}
|
|
if (journal.present) {
|
|
map['journal'] = Variable<String>(journal.value);
|
|
}
|
|
if (doi.present) {
|
|
map['doi'] = Variable<String>(doi.value);
|
|
}
|
|
if (url.present) {
|
|
map['url'] = Variable<String>(url.value);
|
|
}
|
|
if (episodeNumber.present) {
|
|
map['episode_number'] = Variable<int>(episodeNumber.value);
|
|
}
|
|
if (publisher.present) {
|
|
map['publisher'] = Variable<String>(publisher.value);
|
|
}
|
|
if (evidenceStrength.present) {
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength.value);
|
|
}
|
|
if (verified.present) {
|
|
map['verified'] = Variable<bool>(verified.value);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ReferencesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('kind: $kind, ')
|
|
..write('title: $title, ')
|
|
..write('authorsJson: $authorsJson, ')
|
|
..write('year: $year, ')
|
|
..write('journal: $journal, ')
|
|
..write('doi: $doi, ')
|
|
..write('url: $url, ')
|
|
..write('episodeNumber: $episodeNumber, ')
|
|
..write('publisher: $publisher, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('verified: $verified, ')
|
|
..write('note: $note, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $DietPatternsTable extends DietPatterns
|
|
with TableInfo<$DietPatternsTable, DietPattern> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$DietPatternsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<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,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _coreMeta = const VerificationMeta('core');
|
|
@override
|
|
late final GeneratedColumn<String> core = GeneratedColumn<String>(
|
|
'core',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _strengthsJsonMeta = const VerificationMeta(
|
|
'strengthsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> strengthsJson = GeneratedColumn<String>(
|
|
'strengths_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _weaknessesJsonMeta = const VerificationMeta(
|
|
'weaknessesJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> weaknessesJson = GeneratedColumn<String>(
|
|
'weaknesses_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _evidenceStrengthMeta = const VerificationMeta(
|
|
'evidenceStrength',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> evidenceStrength = GeneratedColumn<String>(
|
|
'evidence_strength',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"evidence_strength IN ('strong','moderate','mixed','weak')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _koreanContextFitMeta = const VerificationMeta(
|
|
'koreanContextFit',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> koreanContextFit = GeneratedColumn<String>(
|
|
'korean_context_fit',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"korean_context_fit IS NULL OR korean_context_fit IN ('high','medium','low')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _starterLeversJsonMeta = const VerificationMeta(
|
|
'starterLeversJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> starterLeversJson =
|
|
GeneratedColumn<String>(
|
|
'starter_levers_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _medicalWarningMeta = const VerificationMeta(
|
|
'medicalWarning',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> medicalWarning = GeneratedColumn<String>(
|
|
'medical_warning',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _linkedProtocolIdsJsonMeta =
|
|
const VerificationMeta('linkedProtocolIdsJson');
|
|
@override
|
|
late final GeneratedColumn<String> linkedProtocolIdsJson =
|
|
GeneratedColumn<String>(
|
|
'linked_protocol_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _referenceIdsJsonMeta = const VerificationMeta(
|
|
'referenceIdsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> referenceIdsJson = GeneratedColumn<String>(
|
|
'reference_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
core,
|
|
strengthsJson,
|
|
weaknessesJson,
|
|
evidenceStrength,
|
|
koreanContextFit,
|
|
starterLeversJson,
|
|
medicalWarning,
|
|
linkedProtocolIdsJson,
|
|
referenceIdsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'diet_patterns';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<DietPattern> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('core')) {
|
|
context.handle(
|
|
_coreMeta,
|
|
core.isAcceptableOrUnknown(data['core']!, _coreMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_coreMeta);
|
|
}
|
|
if (data.containsKey('strengths_json')) {
|
|
context.handle(
|
|
_strengthsJsonMeta,
|
|
strengthsJson.isAcceptableOrUnknown(
|
|
data['strengths_json']!,
|
|
_strengthsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('weaknesses_json')) {
|
|
context.handle(
|
|
_weaknessesJsonMeta,
|
|
weaknessesJson.isAcceptableOrUnknown(
|
|
data['weaknesses_json']!,
|
|
_weaknessesJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('evidence_strength')) {
|
|
context.handle(
|
|
_evidenceStrengthMeta,
|
|
evidenceStrength.isAcceptableOrUnknown(
|
|
data['evidence_strength']!,
|
|
_evidenceStrengthMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_evidenceStrengthMeta);
|
|
}
|
|
if (data.containsKey('korean_context_fit')) {
|
|
context.handle(
|
|
_koreanContextFitMeta,
|
|
koreanContextFit.isAcceptableOrUnknown(
|
|
data['korean_context_fit']!,
|
|
_koreanContextFitMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('starter_levers_json')) {
|
|
context.handle(
|
|
_starterLeversJsonMeta,
|
|
starterLeversJson.isAcceptableOrUnknown(
|
|
data['starter_levers_json']!,
|
|
_starterLeversJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('medical_warning')) {
|
|
context.handle(
|
|
_medicalWarningMeta,
|
|
medicalWarning.isAcceptableOrUnknown(
|
|
data['medical_warning']!,
|
|
_medicalWarningMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('linked_protocol_ids_json')) {
|
|
context.handle(
|
|
_linkedProtocolIdsJsonMeta,
|
|
linkedProtocolIdsJson.isAcceptableOrUnknown(
|
|
data['linked_protocol_ids_json']!,
|
|
_linkedProtocolIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reference_ids_json')) {
|
|
context.handle(
|
|
_referenceIdsJsonMeta,
|
|
referenceIdsJson.isAcceptableOrUnknown(
|
|
data['reference_ids_json']!,
|
|
_referenceIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
DietPattern map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return DietPattern(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
core: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}core'],
|
|
)!,
|
|
strengthsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}strengths_json'],
|
|
),
|
|
weaknessesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}weaknesses_json'],
|
|
),
|
|
evidenceStrength: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}evidence_strength'],
|
|
)!,
|
|
koreanContextFit: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}korean_context_fit'],
|
|
),
|
|
starterLeversJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}starter_levers_json'],
|
|
),
|
|
medicalWarning: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}medical_warning'],
|
|
),
|
|
linkedProtocolIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}linked_protocol_ids_json'],
|
|
),
|
|
referenceIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reference_ids_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$DietPatternsTable createAlias(String alias) {
|
|
return $DietPatternsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class DietPattern extends DataClass implements Insertable<DietPattern> {
|
|
final String id;
|
|
final String name;
|
|
final String core;
|
|
final String? strengthsJson;
|
|
final String? weaknessesJson;
|
|
final String evidenceStrength;
|
|
final String? koreanContextFit;
|
|
final String? starterLeversJson;
|
|
final String? medicalWarning;
|
|
final String? linkedProtocolIdsJson;
|
|
final String? referenceIdsJson;
|
|
const DietPattern({
|
|
required this.id,
|
|
required this.name,
|
|
required this.core,
|
|
this.strengthsJson,
|
|
this.weaknessesJson,
|
|
required this.evidenceStrength,
|
|
this.koreanContextFit,
|
|
this.starterLeversJson,
|
|
this.medicalWarning,
|
|
this.linkedProtocolIdsJson,
|
|
this.referenceIdsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['core'] = Variable<String>(core);
|
|
if (!nullToAbsent || strengthsJson != null) {
|
|
map['strengths_json'] = Variable<String>(strengthsJson);
|
|
}
|
|
if (!nullToAbsent || weaknessesJson != null) {
|
|
map['weaknesses_json'] = Variable<String>(weaknessesJson);
|
|
}
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength);
|
|
if (!nullToAbsent || koreanContextFit != null) {
|
|
map['korean_context_fit'] = Variable<String>(koreanContextFit);
|
|
}
|
|
if (!nullToAbsent || starterLeversJson != null) {
|
|
map['starter_levers_json'] = Variable<String>(starterLeversJson);
|
|
}
|
|
if (!nullToAbsent || medicalWarning != null) {
|
|
map['medical_warning'] = Variable<String>(medicalWarning);
|
|
}
|
|
if (!nullToAbsent || linkedProtocolIdsJson != null) {
|
|
map['linked_protocol_ids_json'] = Variable<String>(linkedProtocolIdsJson);
|
|
}
|
|
if (!nullToAbsent || referenceIdsJson != null) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
DietPatternsCompanion toCompanion(bool nullToAbsent) {
|
|
return DietPatternsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
core: Value(core),
|
|
strengthsJson: strengthsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(strengthsJson),
|
|
weaknessesJson: weaknessesJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(weaknessesJson),
|
|
evidenceStrength: Value(evidenceStrength),
|
|
koreanContextFit: koreanContextFit == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(koreanContextFit),
|
|
starterLeversJson: starterLeversJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(starterLeversJson),
|
|
medicalWarning: medicalWarning == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(medicalWarning),
|
|
linkedProtocolIdsJson: linkedProtocolIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(linkedProtocolIdsJson),
|
|
referenceIdsJson: referenceIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(referenceIdsJson),
|
|
);
|
|
}
|
|
|
|
factory DietPattern.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return DietPattern(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
core: serializer.fromJson<String>(json['core']),
|
|
strengthsJson: serializer.fromJson<String?>(json['strengthsJson']),
|
|
weaknessesJson: serializer.fromJson<String?>(json['weaknessesJson']),
|
|
evidenceStrength: serializer.fromJson<String>(json['evidenceStrength']),
|
|
koreanContextFit: serializer.fromJson<String?>(json['koreanContextFit']),
|
|
starterLeversJson: serializer.fromJson<String?>(
|
|
json['starterLeversJson'],
|
|
),
|
|
medicalWarning: serializer.fromJson<String?>(json['medicalWarning']),
|
|
linkedProtocolIdsJson: serializer.fromJson<String?>(
|
|
json['linkedProtocolIdsJson'],
|
|
),
|
|
referenceIdsJson: serializer.fromJson<String?>(json['referenceIdsJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'core': serializer.toJson<String>(core),
|
|
'strengthsJson': serializer.toJson<String?>(strengthsJson),
|
|
'weaknessesJson': serializer.toJson<String?>(weaknessesJson),
|
|
'evidenceStrength': serializer.toJson<String>(evidenceStrength),
|
|
'koreanContextFit': serializer.toJson<String?>(koreanContextFit),
|
|
'starterLeversJson': serializer.toJson<String?>(starterLeversJson),
|
|
'medicalWarning': serializer.toJson<String?>(medicalWarning),
|
|
'linkedProtocolIdsJson': serializer.toJson<String?>(
|
|
linkedProtocolIdsJson,
|
|
),
|
|
'referenceIdsJson': serializer.toJson<String?>(referenceIdsJson),
|
|
};
|
|
}
|
|
|
|
DietPattern copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? core,
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
String? evidenceStrength,
|
|
Value<String?> koreanContextFit = const Value.absent(),
|
|
Value<String?> starterLeversJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> linkedProtocolIdsJson = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
}) => DietPattern(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
core: core ?? this.core,
|
|
strengthsJson: strengthsJson.present
|
|
? strengthsJson.value
|
|
: this.strengthsJson,
|
|
weaknessesJson: weaknessesJson.present
|
|
? weaknessesJson.value
|
|
: this.weaknessesJson,
|
|
evidenceStrength: evidenceStrength ?? this.evidenceStrength,
|
|
koreanContextFit: koreanContextFit.present
|
|
? koreanContextFit.value
|
|
: this.koreanContextFit,
|
|
starterLeversJson: starterLeversJson.present
|
|
? starterLeversJson.value
|
|
: this.starterLeversJson,
|
|
medicalWarning: medicalWarning.present
|
|
? medicalWarning.value
|
|
: this.medicalWarning,
|
|
linkedProtocolIdsJson: linkedProtocolIdsJson.present
|
|
? linkedProtocolIdsJson.value
|
|
: this.linkedProtocolIdsJson,
|
|
referenceIdsJson: referenceIdsJson.present
|
|
? referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
DietPattern copyWithCompanion(DietPatternsCompanion data) {
|
|
return DietPattern(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
core: data.core.present ? data.core.value : this.core,
|
|
strengthsJson: data.strengthsJson.present
|
|
? data.strengthsJson.value
|
|
: this.strengthsJson,
|
|
weaknessesJson: data.weaknessesJson.present
|
|
? data.weaknessesJson.value
|
|
: this.weaknessesJson,
|
|
evidenceStrength: data.evidenceStrength.present
|
|
? data.evidenceStrength.value
|
|
: this.evidenceStrength,
|
|
koreanContextFit: data.koreanContextFit.present
|
|
? data.koreanContextFit.value
|
|
: this.koreanContextFit,
|
|
starterLeversJson: data.starterLeversJson.present
|
|
? data.starterLeversJson.value
|
|
: this.starterLeversJson,
|
|
medicalWarning: data.medicalWarning.present
|
|
? data.medicalWarning.value
|
|
: this.medicalWarning,
|
|
linkedProtocolIdsJson: data.linkedProtocolIdsJson.present
|
|
? data.linkedProtocolIdsJson.value
|
|
: this.linkedProtocolIdsJson,
|
|
referenceIdsJson: data.referenceIdsJson.present
|
|
? data.referenceIdsJson.value
|
|
: this.referenceIdsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DietPattern(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('core: $core, ')
|
|
..write('strengthsJson: $strengthsJson, ')
|
|
..write('weaknessesJson: $weaknessesJson, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('koreanContextFit: $koreanContextFit, ')
|
|
..write('starterLeversJson: $starterLeversJson, ')
|
|
..write('medicalWarning: $medicalWarning, ')
|
|
..write('linkedProtocolIdsJson: $linkedProtocolIdsJson, ')
|
|
..write('referenceIdsJson: $referenceIdsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
core,
|
|
strengthsJson,
|
|
weaknessesJson,
|
|
evidenceStrength,
|
|
koreanContextFit,
|
|
starterLeversJson,
|
|
medicalWarning,
|
|
linkedProtocolIdsJson,
|
|
referenceIdsJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is DietPattern &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.core == this.core &&
|
|
other.strengthsJson == this.strengthsJson &&
|
|
other.weaknessesJson == this.weaknessesJson &&
|
|
other.evidenceStrength == this.evidenceStrength &&
|
|
other.koreanContextFit == this.koreanContextFit &&
|
|
other.starterLeversJson == this.starterLeversJson &&
|
|
other.medicalWarning == this.medicalWarning &&
|
|
other.linkedProtocolIdsJson == this.linkedProtocolIdsJson &&
|
|
other.referenceIdsJson == this.referenceIdsJson);
|
|
}
|
|
|
|
class DietPatternsCompanion extends UpdateCompanion<DietPattern> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String> core;
|
|
final Value<String?> strengthsJson;
|
|
final Value<String?> weaknessesJson;
|
|
final Value<String> evidenceStrength;
|
|
final Value<String?> koreanContextFit;
|
|
final Value<String?> starterLeversJson;
|
|
final Value<String?> medicalWarning;
|
|
final Value<String?> linkedProtocolIdsJson;
|
|
final Value<String?> referenceIdsJson;
|
|
final Value<int> rowid;
|
|
const DietPatternsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.core = const Value.absent(),
|
|
this.strengthsJson = const Value.absent(),
|
|
this.weaknessesJson = const Value.absent(),
|
|
this.evidenceStrength = const Value.absent(),
|
|
this.koreanContextFit = const Value.absent(),
|
|
this.starterLeversJson = const Value.absent(),
|
|
this.medicalWarning = const Value.absent(),
|
|
this.linkedProtocolIdsJson = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
DietPatternsCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required String core,
|
|
this.strengthsJson = const Value.absent(),
|
|
this.weaknessesJson = const Value.absent(),
|
|
required String evidenceStrength,
|
|
this.koreanContextFit = const Value.absent(),
|
|
this.starterLeversJson = const Value.absent(),
|
|
this.medicalWarning = const Value.absent(),
|
|
this.linkedProtocolIdsJson = const Value.absent(),
|
|
this.referenceIdsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
core = Value(core),
|
|
evidenceStrength = Value(evidenceStrength);
|
|
static Insertable<DietPattern> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? core,
|
|
Expression<String>? strengthsJson,
|
|
Expression<String>? weaknessesJson,
|
|
Expression<String>? evidenceStrength,
|
|
Expression<String>? koreanContextFit,
|
|
Expression<String>? starterLeversJson,
|
|
Expression<String>? medicalWarning,
|
|
Expression<String>? linkedProtocolIdsJson,
|
|
Expression<String>? referenceIdsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (core != null) 'core': core,
|
|
if (strengthsJson != null) 'strengths_json': strengthsJson,
|
|
if (weaknessesJson != null) 'weaknesses_json': weaknessesJson,
|
|
if (evidenceStrength != null) 'evidence_strength': evidenceStrength,
|
|
if (koreanContextFit != null) 'korean_context_fit': koreanContextFit,
|
|
if (starterLeversJson != null) 'starter_levers_json': starterLeversJson,
|
|
if (medicalWarning != null) 'medical_warning': medicalWarning,
|
|
if (linkedProtocolIdsJson != null)
|
|
'linked_protocol_ids_json': linkedProtocolIdsJson,
|
|
if (referenceIdsJson != null) 'reference_ids_json': referenceIdsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
DietPatternsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String>? core,
|
|
Value<String?>? strengthsJson,
|
|
Value<String?>? weaknessesJson,
|
|
Value<String>? evidenceStrength,
|
|
Value<String?>? koreanContextFit,
|
|
Value<String?>? starterLeversJson,
|
|
Value<String?>? medicalWarning,
|
|
Value<String?>? linkedProtocolIdsJson,
|
|
Value<String?>? referenceIdsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return DietPatternsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
core: core ?? this.core,
|
|
strengthsJson: strengthsJson ?? this.strengthsJson,
|
|
weaknessesJson: weaknessesJson ?? this.weaknessesJson,
|
|
evidenceStrength: evidenceStrength ?? this.evidenceStrength,
|
|
koreanContextFit: koreanContextFit ?? this.koreanContextFit,
|
|
starterLeversJson: starterLeversJson ?? this.starterLeversJson,
|
|
medicalWarning: medicalWarning ?? this.medicalWarning,
|
|
linkedProtocolIdsJson:
|
|
linkedProtocolIdsJson ?? this.linkedProtocolIdsJson,
|
|
referenceIdsJson: referenceIdsJson ?? this.referenceIdsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<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 (core.present) {
|
|
map['core'] = Variable<String>(core.value);
|
|
}
|
|
if (strengthsJson.present) {
|
|
map['strengths_json'] = Variable<String>(strengthsJson.value);
|
|
}
|
|
if (weaknessesJson.present) {
|
|
map['weaknesses_json'] = Variable<String>(weaknessesJson.value);
|
|
}
|
|
if (evidenceStrength.present) {
|
|
map['evidence_strength'] = Variable<String>(evidenceStrength.value);
|
|
}
|
|
if (koreanContextFit.present) {
|
|
map['korean_context_fit'] = Variable<String>(koreanContextFit.value);
|
|
}
|
|
if (starterLeversJson.present) {
|
|
map['starter_levers_json'] = Variable<String>(starterLeversJson.value);
|
|
}
|
|
if (medicalWarning.present) {
|
|
map['medical_warning'] = Variable<String>(medicalWarning.value);
|
|
}
|
|
if (linkedProtocolIdsJson.present) {
|
|
map['linked_protocol_ids_json'] = Variable<String>(
|
|
linkedProtocolIdsJson.value,
|
|
);
|
|
}
|
|
if (referenceIdsJson.present) {
|
|
map['reference_ids_json'] = Variable<String>(referenceIdsJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DietPatternsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('core: $core, ')
|
|
..write('strengthsJson: $strengthsJson, ')
|
|
..write('weaknessesJson: $weaknessesJson, ')
|
|
..write('evidenceStrength: $evidenceStrength, ')
|
|
..write('koreanContextFit: $koreanContextFit, ')
|
|
..write('starterLeversJson: $starterLeversJson, ')
|
|
..write('medicalWarning: $medicalWarning, ')
|
|
..write('linkedProtocolIdsJson: $linkedProtocolIdsJson, ')
|
|
..write('referenceIdsJson: $referenceIdsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $UsersTable extends Users with TableInfo<$UsersTable, User> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$UsersTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _displayNameMeta = const VerificationMeta(
|
|
'displayName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> displayName = GeneratedColumn<String>(
|
|
'display_name',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _localeMeta = const VerificationMeta('locale');
|
|
@override
|
|
late final GeneratedColumn<String> locale = GeneratedColumn<String>(
|
|
'locale',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('ko-KR'),
|
|
);
|
|
static const VerificationMeta _timezoneMeta = const VerificationMeta(
|
|
'timezone',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> timezone = GeneratedColumn<String>(
|
|
'timezone',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('Asia/Seoul'),
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> createdAt = GeneratedColumn<String>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _preferencesJsonMeta = const VerificationMeta(
|
|
'preferencesJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> preferencesJson = GeneratedColumn<String>(
|
|
'preferences_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
displayName,
|
|
locale,
|
|
timezone,
|
|
createdAt,
|
|
preferencesJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'users';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<User> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('display_name')) {
|
|
context.handle(
|
|
_displayNameMeta,
|
|
displayName.isAcceptableOrUnknown(
|
|
data['display_name']!,
|
|
_displayNameMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('locale')) {
|
|
context.handle(
|
|
_localeMeta,
|
|
locale.isAcceptableOrUnknown(data['locale']!, _localeMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('timezone')) {
|
|
context.handle(
|
|
_timezoneMeta,
|
|
timezone.isAcceptableOrUnknown(data['timezone']!, _timezoneMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('preferences_json')) {
|
|
context.handle(
|
|
_preferencesJsonMeta,
|
|
preferencesJson.isAcceptableOrUnknown(
|
|
data['preferences_json']!,
|
|
_preferencesJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
User map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return User(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
displayName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}display_name'],
|
|
),
|
|
locale: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}locale'],
|
|
)!,
|
|
timezone: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}timezone'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
preferencesJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}preferences_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$UsersTable createAlias(String alias) {
|
|
return $UsersTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class User extends DataClass implements Insertable<User> {
|
|
final String id;
|
|
final String? displayName;
|
|
final String locale;
|
|
final String timezone;
|
|
final String createdAt;
|
|
final String? preferencesJson;
|
|
const User({
|
|
required this.id,
|
|
this.displayName,
|
|
required this.locale,
|
|
required this.timezone,
|
|
required this.createdAt,
|
|
this.preferencesJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
if (!nullToAbsent || displayName != null) {
|
|
map['display_name'] = Variable<String>(displayName);
|
|
}
|
|
map['locale'] = Variable<String>(locale);
|
|
map['timezone'] = Variable<String>(timezone);
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
if (!nullToAbsent || preferencesJson != null) {
|
|
map['preferences_json'] = Variable<String>(preferencesJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
UsersCompanion toCompanion(bool nullToAbsent) {
|
|
return UsersCompanion(
|
|
id: Value(id),
|
|
displayName: displayName == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(displayName),
|
|
locale: Value(locale),
|
|
timezone: Value(timezone),
|
|
createdAt: Value(createdAt),
|
|
preferencesJson: preferencesJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(preferencesJson),
|
|
);
|
|
}
|
|
|
|
factory User.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return User(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
displayName: serializer.fromJson<String?>(json['displayName']),
|
|
locale: serializer.fromJson<String>(json['locale']),
|
|
timezone: serializer.fromJson<String>(json['timezone']),
|
|
createdAt: serializer.fromJson<String>(json['createdAt']),
|
|
preferencesJson: serializer.fromJson<String?>(json['preferencesJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'displayName': serializer.toJson<String?>(displayName),
|
|
'locale': serializer.toJson<String>(locale),
|
|
'timezone': serializer.toJson<String>(timezone),
|
|
'createdAt': serializer.toJson<String>(createdAt),
|
|
'preferencesJson': serializer.toJson<String?>(preferencesJson),
|
|
};
|
|
}
|
|
|
|
User copyWith({
|
|
String? id,
|
|
Value<String?> displayName = const Value.absent(),
|
|
String? locale,
|
|
String? timezone,
|
|
String? createdAt,
|
|
Value<String?> preferencesJson = const Value.absent(),
|
|
}) => User(
|
|
id: id ?? this.id,
|
|
displayName: displayName.present ? displayName.value : this.displayName,
|
|
locale: locale ?? this.locale,
|
|
timezone: timezone ?? this.timezone,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
preferencesJson: preferencesJson.present
|
|
? preferencesJson.value
|
|
: this.preferencesJson,
|
|
);
|
|
User copyWithCompanion(UsersCompanion data) {
|
|
return User(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
displayName: data.displayName.present
|
|
? data.displayName.value
|
|
: this.displayName,
|
|
locale: data.locale.present ? data.locale.value : this.locale,
|
|
timezone: data.timezone.present ? data.timezone.value : this.timezone,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
preferencesJson: data.preferencesJson.present
|
|
? data.preferencesJson.value
|
|
: this.preferencesJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('User(')
|
|
..write('id: $id, ')
|
|
..write('displayName: $displayName, ')
|
|
..write('locale: $locale, ')
|
|
..write('timezone: $timezone, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('preferencesJson: $preferencesJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
displayName,
|
|
locale,
|
|
timezone,
|
|
createdAt,
|
|
preferencesJson,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is User &&
|
|
other.id == this.id &&
|
|
other.displayName == this.displayName &&
|
|
other.locale == this.locale &&
|
|
other.timezone == this.timezone &&
|
|
other.createdAt == this.createdAt &&
|
|
other.preferencesJson == this.preferencesJson);
|
|
}
|
|
|
|
class UsersCompanion extends UpdateCompanion<User> {
|
|
final Value<String> id;
|
|
final Value<String?> displayName;
|
|
final Value<String> locale;
|
|
final Value<String> timezone;
|
|
final Value<String> createdAt;
|
|
final Value<String?> preferencesJson;
|
|
final Value<int> rowid;
|
|
const UsersCompanion({
|
|
this.id = const Value.absent(),
|
|
this.displayName = const Value.absent(),
|
|
this.locale = const Value.absent(),
|
|
this.timezone = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.preferencesJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
UsersCompanion.insert({
|
|
required String id,
|
|
this.displayName = const Value.absent(),
|
|
this.locale = const Value.absent(),
|
|
this.timezone = const Value.absent(),
|
|
required String createdAt,
|
|
this.preferencesJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<User> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? displayName,
|
|
Expression<String>? locale,
|
|
Expression<String>? timezone,
|
|
Expression<String>? createdAt,
|
|
Expression<String>? preferencesJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (displayName != null) 'display_name': displayName,
|
|
if (locale != null) 'locale': locale,
|
|
if (timezone != null) 'timezone': timezone,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (preferencesJson != null) 'preferences_json': preferencesJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
UsersCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String?>? displayName,
|
|
Value<String>? locale,
|
|
Value<String>? timezone,
|
|
Value<String>? createdAt,
|
|
Value<String?>? preferencesJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return UsersCompanion(
|
|
id: id ?? this.id,
|
|
displayName: displayName ?? this.displayName,
|
|
locale: locale ?? this.locale,
|
|
timezone: timezone ?? this.timezone,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
preferencesJson: preferencesJson ?? this.preferencesJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (displayName.present) {
|
|
map['display_name'] = Variable<String>(displayName.value);
|
|
}
|
|
if (locale.present) {
|
|
map['locale'] = Variable<String>(locale.value);
|
|
}
|
|
if (timezone.present) {
|
|
map['timezone'] = Variable<String>(timezone.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<String>(createdAt.value);
|
|
}
|
|
if (preferencesJson.present) {
|
|
map['preferences_json'] = Variable<String>(preferencesJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('UsersCompanion(')
|
|
..write('id: $id, ')
|
|
..write('displayName: $displayName, ')
|
|
..write('locale: $locale, ')
|
|
..write('timezone: $timezone, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('preferencesJson: $preferencesJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PhasesTable extends Phases with TableInfo<$PhasesTable, Phase> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PhasesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _userIdMeta = const VerificationMeta('userId');
|
|
@override
|
|
late final GeneratedColumn<String> userId = GeneratedColumn<String>(
|
|
'user_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES users(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> startedAt = GeneratedColumn<String>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _endedAtMeta = const VerificationMeta(
|
|
'endedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> endedAt = GeneratedColumn<String>(
|
|
'ended_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _durationWeeksMeta = const VerificationMeta(
|
|
'durationWeeks',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> durationWeeks = GeneratedColumn<int>(
|
|
'duration_weeks',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>("duration_weeks >= 1"),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(6),
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"status IN ('active','completed','abandoned')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _intentionTextMeta = const VerificationMeta(
|
|
'intentionText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> intentionText = GeneratedColumn<String>(
|
|
'intention_text',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _rewardDeclarationsLockedMeta =
|
|
const VerificationMeta('rewardDeclarationsLocked');
|
|
@override
|
|
late final GeneratedColumn<bool> rewardDeclarationsLocked =
|
|
GeneratedColumn<bool>(
|
|
'reward_declarations_locked',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("reward_declarations_locked" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
userId,
|
|
title,
|
|
startedAt,
|
|
endedAt,
|
|
durationWeeks,
|
|
status,
|
|
intentionText,
|
|
rewardDeclarationsLocked,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'phases';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Phase> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('user_id')) {
|
|
context.handle(
|
|
_userIdMeta,
|
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_userIdMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('ended_at')) {
|
|
context.handle(
|
|
_endedAtMeta,
|
|
endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('duration_weeks')) {
|
|
context.handle(
|
|
_durationWeeksMeta,
|
|
durationWeeks.isAcceptableOrUnknown(
|
|
data['duration_weeks']!,
|
|
_durationWeeksMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_statusMeta);
|
|
}
|
|
if (data.containsKey('intention_text')) {
|
|
context.handle(
|
|
_intentionTextMeta,
|
|
intentionText.isAcceptableOrUnknown(
|
|
data['intention_text']!,
|
|
_intentionTextMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reward_declarations_locked')) {
|
|
context.handle(
|
|
_rewardDeclarationsLockedMeta,
|
|
rewardDeclarationsLocked.isAcceptableOrUnknown(
|
|
data['reward_declarations_locked']!,
|
|
_rewardDeclarationsLockedMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Phase map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Phase(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
userId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}user_id'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
),
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
endedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}ended_at'],
|
|
),
|
|
durationWeeks: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}duration_weeks'],
|
|
)!,
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
intentionText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}intention_text'],
|
|
),
|
|
rewardDeclarationsLocked: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}reward_declarations_locked'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PhasesTable createAlias(String alias) {
|
|
return $PhasesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Phase extends DataClass implements Insertable<Phase> {
|
|
final String id;
|
|
final String userId;
|
|
final String? title;
|
|
final String startedAt;
|
|
final String? endedAt;
|
|
final int durationWeeks;
|
|
final String status;
|
|
final String? intentionText;
|
|
final bool rewardDeclarationsLocked;
|
|
const Phase({
|
|
required this.id,
|
|
required this.userId,
|
|
this.title,
|
|
required this.startedAt,
|
|
this.endedAt,
|
|
required this.durationWeeks,
|
|
required this.status,
|
|
this.intentionText,
|
|
required this.rewardDeclarationsLocked,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['user_id'] = Variable<String>(userId);
|
|
if (!nullToAbsent || title != null) {
|
|
map['title'] = Variable<String>(title);
|
|
}
|
|
map['started_at'] = Variable<String>(startedAt);
|
|
if (!nullToAbsent || endedAt != null) {
|
|
map['ended_at'] = Variable<String>(endedAt);
|
|
}
|
|
map['duration_weeks'] = Variable<int>(durationWeeks);
|
|
map['status'] = Variable<String>(status);
|
|
if (!nullToAbsent || intentionText != null) {
|
|
map['intention_text'] = Variable<String>(intentionText);
|
|
}
|
|
map['reward_declarations_locked'] = Variable<bool>(
|
|
rewardDeclarationsLocked,
|
|
);
|
|
return map;
|
|
}
|
|
|
|
PhasesCompanion toCompanion(bool nullToAbsent) {
|
|
return PhasesCompanion(
|
|
id: Value(id),
|
|
userId: Value(userId),
|
|
title: title == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(title),
|
|
startedAt: Value(startedAt),
|
|
endedAt: endedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(endedAt),
|
|
durationWeeks: Value(durationWeeks),
|
|
status: Value(status),
|
|
intentionText: intentionText == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(intentionText),
|
|
rewardDeclarationsLocked: Value(rewardDeclarationsLocked),
|
|
);
|
|
}
|
|
|
|
factory Phase.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Phase(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
userId: serializer.fromJson<String>(json['userId']),
|
|
title: serializer.fromJson<String?>(json['title']),
|
|
startedAt: serializer.fromJson<String>(json['startedAt']),
|
|
endedAt: serializer.fromJson<String?>(json['endedAt']),
|
|
durationWeeks: serializer.fromJson<int>(json['durationWeeks']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
intentionText: serializer.fromJson<String?>(json['intentionText']),
|
|
rewardDeclarationsLocked: serializer.fromJson<bool>(
|
|
json['rewardDeclarationsLocked'],
|
|
),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'userId': serializer.toJson<String>(userId),
|
|
'title': serializer.toJson<String?>(title),
|
|
'startedAt': serializer.toJson<String>(startedAt),
|
|
'endedAt': serializer.toJson<String?>(endedAt),
|
|
'durationWeeks': serializer.toJson<int>(durationWeeks),
|
|
'status': serializer.toJson<String>(status),
|
|
'intentionText': serializer.toJson<String?>(intentionText),
|
|
'rewardDeclarationsLocked': serializer.toJson<bool>(
|
|
rewardDeclarationsLocked,
|
|
),
|
|
};
|
|
}
|
|
|
|
Phase copyWith({
|
|
String? id,
|
|
String? userId,
|
|
Value<String?> title = const Value.absent(),
|
|
String? startedAt,
|
|
Value<String?> endedAt = const Value.absent(),
|
|
int? durationWeeks,
|
|
String? status,
|
|
Value<String?> intentionText = const Value.absent(),
|
|
bool? rewardDeclarationsLocked,
|
|
}) => Phase(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
title: title.present ? title.value : this.title,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt.present ? endedAt.value : this.endedAt,
|
|
durationWeeks: durationWeeks ?? this.durationWeeks,
|
|
status: status ?? this.status,
|
|
intentionText: intentionText.present
|
|
? intentionText.value
|
|
: this.intentionText,
|
|
rewardDeclarationsLocked:
|
|
rewardDeclarationsLocked ?? this.rewardDeclarationsLocked,
|
|
);
|
|
Phase copyWithCompanion(PhasesCompanion data) {
|
|
return Phase(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
userId: data.userId.present ? data.userId.value : this.userId,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt,
|
|
durationWeeks: data.durationWeeks.present
|
|
? data.durationWeeks.value
|
|
: this.durationWeeks,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
intentionText: data.intentionText.present
|
|
? data.intentionText.value
|
|
: this.intentionText,
|
|
rewardDeclarationsLocked: data.rewardDeclarationsLocked.present
|
|
? data.rewardDeclarationsLocked.value
|
|
: this.rewardDeclarationsLocked,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Phase(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('title: $title, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('durationWeeks: $durationWeeks, ')
|
|
..write('status: $status, ')
|
|
..write('intentionText: $intentionText, ')
|
|
..write('rewardDeclarationsLocked: $rewardDeclarationsLocked')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
userId,
|
|
title,
|
|
startedAt,
|
|
endedAt,
|
|
durationWeeks,
|
|
status,
|
|
intentionText,
|
|
rewardDeclarationsLocked,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Phase &&
|
|
other.id == this.id &&
|
|
other.userId == this.userId &&
|
|
other.title == this.title &&
|
|
other.startedAt == this.startedAt &&
|
|
other.endedAt == this.endedAt &&
|
|
other.durationWeeks == this.durationWeeks &&
|
|
other.status == this.status &&
|
|
other.intentionText == this.intentionText &&
|
|
other.rewardDeclarationsLocked == this.rewardDeclarationsLocked);
|
|
}
|
|
|
|
class PhasesCompanion extends UpdateCompanion<Phase> {
|
|
final Value<String> id;
|
|
final Value<String> userId;
|
|
final Value<String?> title;
|
|
final Value<String> startedAt;
|
|
final Value<String?> endedAt;
|
|
final Value<int> durationWeeks;
|
|
final Value<String> status;
|
|
final Value<String?> intentionText;
|
|
final Value<bool> rewardDeclarationsLocked;
|
|
final Value<int> rowid;
|
|
const PhasesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.userId = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
this.durationWeeks = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.intentionText = const Value.absent(),
|
|
this.rewardDeclarationsLocked = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PhasesCompanion.insert({
|
|
required String id,
|
|
required String userId,
|
|
this.title = const Value.absent(),
|
|
required String startedAt,
|
|
this.endedAt = const Value.absent(),
|
|
this.durationWeeks = const Value.absent(),
|
|
required String status,
|
|
this.intentionText = const Value.absent(),
|
|
this.rewardDeclarationsLocked = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
userId = Value(userId),
|
|
startedAt = Value(startedAt),
|
|
status = Value(status);
|
|
static Insertable<Phase> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? userId,
|
|
Expression<String>? title,
|
|
Expression<String>? startedAt,
|
|
Expression<String>? endedAt,
|
|
Expression<int>? durationWeeks,
|
|
Expression<String>? status,
|
|
Expression<String>? intentionText,
|
|
Expression<bool>? rewardDeclarationsLocked,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (userId != null) 'user_id': userId,
|
|
if (title != null) 'title': title,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (endedAt != null) 'ended_at': endedAt,
|
|
if (durationWeeks != null) 'duration_weeks': durationWeeks,
|
|
if (status != null) 'status': status,
|
|
if (intentionText != null) 'intention_text': intentionText,
|
|
if (rewardDeclarationsLocked != null)
|
|
'reward_declarations_locked': rewardDeclarationsLocked,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PhasesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? userId,
|
|
Value<String?>? title,
|
|
Value<String>? startedAt,
|
|
Value<String?>? endedAt,
|
|
Value<int>? durationWeeks,
|
|
Value<String>? status,
|
|
Value<String?>? intentionText,
|
|
Value<bool>? rewardDeclarationsLocked,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PhasesCompanion(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
title: title ?? this.title,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
durationWeeks: durationWeeks ?? this.durationWeeks,
|
|
status: status ?? this.status,
|
|
intentionText: intentionText ?? this.intentionText,
|
|
rewardDeclarationsLocked:
|
|
rewardDeclarationsLocked ?? this.rewardDeclarationsLocked,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (userId.present) {
|
|
map['user_id'] = Variable<String>(userId.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<String>(startedAt.value);
|
|
}
|
|
if (endedAt.present) {
|
|
map['ended_at'] = Variable<String>(endedAt.value);
|
|
}
|
|
if (durationWeeks.present) {
|
|
map['duration_weeks'] = Variable<int>(durationWeeks.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (intentionText.present) {
|
|
map['intention_text'] = Variable<String>(intentionText.value);
|
|
}
|
|
if (rewardDeclarationsLocked.present) {
|
|
map['reward_declarations_locked'] = Variable<bool>(
|
|
rewardDeclarationsLocked.value,
|
|
);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PhasesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('title: $title, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('durationWeeks: $durationWeeks, ')
|
|
..write('status: $status, ')
|
|
..write('intentionText: $intentionText, ')
|
|
..write('rewardDeclarationsLocked: $rewardDeclarationsLocked, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $HabitsTable extends Habits with TableInfo<$HabitsTable, Habit> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$HabitsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _userIdMeta = const VerificationMeta('userId');
|
|
@override
|
|
late final GeneratedColumn<String> userId = GeneratedColumn<String>(
|
|
'user_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES users(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _phaseIdMeta = const VerificationMeta(
|
|
'phaseId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> phaseId = GeneratedColumn<String>(
|
|
'phase_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints: 'NULL REFERENCES phases(id) ON DELETE SET NULL',
|
|
);
|
|
static const VerificationMeta _typeMeta = const VerificationMeta('type');
|
|
@override
|
|
late final GeneratedColumn<String> type = GeneratedColumn<String>(
|
|
'type',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>("type IN ('build','break')"),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"status IN ('active','paused','completed','abandoned')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _protocolIdMeta = const VerificationMeta(
|
|
'protocolId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> protocolId = GeneratedColumn<String>(
|
|
'protocol_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints: 'NULL REFERENCES protocols(id)',
|
|
);
|
|
static const VerificationMeta _breakProtocolIdMeta = const VerificationMeta(
|
|
'breakProtocolId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> breakProtocolId = GeneratedColumn<String>(
|
|
'break_protocol_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints: 'NULL REFERENCES break_protocols(id)',
|
|
);
|
|
static const VerificationMeta _commonFrameIdsJsonMeta =
|
|
const VerificationMeta('commonFrameIdsJson');
|
|
@override
|
|
late final GeneratedColumn<String> commonFrameIdsJson =
|
|
GeneratedColumn<String>(
|
|
'common_frame_ids_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _frameLevelMeta = const VerificationMeta(
|
|
'frameLevel',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> frameLevel = GeneratedColumn<String>(
|
|
'frame_level',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>("frame_level IN ('L2','L3')"),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _frameOriginalTextMeta = const VerificationMeta(
|
|
'frameOriginalText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> frameOriginalText =
|
|
GeneratedColumn<String>(
|
|
'frame_original_text',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _frameFramedTextMeta = const VerificationMeta(
|
|
'frameFramedText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> frameFramedText = GeneratedColumn<String>(
|
|
'frame_framed_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _anchorWhenMeta = const VerificationMeta(
|
|
'anchorWhen',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> anchorWhen = GeneratedColumn<String>(
|
|
'anchor_when',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _anchorAfterWhatMeta = const VerificationMeta(
|
|
'anchorAfterWhat',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> anchorAfterWhat = GeneratedColumn<String>(
|
|
'anchor_after_what',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _anchorWhereMeta = const VerificationMeta(
|
|
'anchorWhere',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> anchorWhere = GeneratedColumn<String>(
|
|
'anchor_where',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _stackPositionMeta = const VerificationMeta(
|
|
'stackPosition',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> stackPosition = GeneratedColumn<int>(
|
|
'stack_position',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"stack_position IS NULL OR stack_position >= 1",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _minDoseMeta = const VerificationMeta(
|
|
'minDose',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> minDose = GeneratedColumn<String>(
|
|
'min_dose',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _targetDoseMeta = const VerificationMeta(
|
|
'targetDose',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> targetDose = GeneratedColumn<String>(
|
|
'target_dose',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _startedAtMeta = const VerificationMeta(
|
|
'startedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> startedAt = GeneratedColumn<String>(
|
|
'started_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _endedAtMeta = const VerificationMeta(
|
|
'endedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> endedAt = GeneratedColumn<String>(
|
|
'ended_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _tagsJsonMeta = const VerificationMeta(
|
|
'tagsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> tagsJson = GeneratedColumn<String>(
|
|
'tags_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
userId,
|
|
phaseId,
|
|
type,
|
|
status,
|
|
title,
|
|
protocolId,
|
|
breakProtocolId,
|
|
commonFrameIdsJson,
|
|
frameLevel,
|
|
frameOriginalText,
|
|
frameFramedText,
|
|
anchorWhen,
|
|
anchorAfterWhat,
|
|
anchorWhere,
|
|
stackPosition,
|
|
minDose,
|
|
targetDose,
|
|
startedAt,
|
|
endedAt,
|
|
tagsJson,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'habits';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Habit> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('user_id')) {
|
|
context.handle(
|
|
_userIdMeta,
|
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_userIdMeta);
|
|
}
|
|
if (data.containsKey('phase_id')) {
|
|
context.handle(
|
|
_phaseIdMeta,
|
|
phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('type')) {
|
|
context.handle(
|
|
_typeMeta,
|
|
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_typeMeta);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_statusMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('protocol_id')) {
|
|
context.handle(
|
|
_protocolIdMeta,
|
|
protocolId.isAcceptableOrUnknown(data['protocol_id']!, _protocolIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('break_protocol_id')) {
|
|
context.handle(
|
|
_breakProtocolIdMeta,
|
|
breakProtocolId.isAcceptableOrUnknown(
|
|
data['break_protocol_id']!,
|
|
_breakProtocolIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('common_frame_ids_json')) {
|
|
context.handle(
|
|
_commonFrameIdsJsonMeta,
|
|
commonFrameIdsJson.isAcceptableOrUnknown(
|
|
data['common_frame_ids_json']!,
|
|
_commonFrameIdsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('frame_level')) {
|
|
context.handle(
|
|
_frameLevelMeta,
|
|
frameLevel.isAcceptableOrUnknown(data['frame_level']!, _frameLevelMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_frameLevelMeta);
|
|
}
|
|
if (data.containsKey('frame_original_text')) {
|
|
context.handle(
|
|
_frameOriginalTextMeta,
|
|
frameOriginalText.isAcceptableOrUnknown(
|
|
data['frame_original_text']!,
|
|
_frameOriginalTextMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('frame_framed_text')) {
|
|
context.handle(
|
|
_frameFramedTextMeta,
|
|
frameFramedText.isAcceptableOrUnknown(
|
|
data['frame_framed_text']!,
|
|
_frameFramedTextMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_frameFramedTextMeta);
|
|
}
|
|
if (data.containsKey('anchor_when')) {
|
|
context.handle(
|
|
_anchorWhenMeta,
|
|
anchorWhen.isAcceptableOrUnknown(data['anchor_when']!, _anchorWhenMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('anchor_after_what')) {
|
|
context.handle(
|
|
_anchorAfterWhatMeta,
|
|
anchorAfterWhat.isAcceptableOrUnknown(
|
|
data['anchor_after_what']!,
|
|
_anchorAfterWhatMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('anchor_where')) {
|
|
context.handle(
|
|
_anchorWhereMeta,
|
|
anchorWhere.isAcceptableOrUnknown(
|
|
data['anchor_where']!,
|
|
_anchorWhereMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('stack_position')) {
|
|
context.handle(
|
|
_stackPositionMeta,
|
|
stackPosition.isAcceptableOrUnknown(
|
|
data['stack_position']!,
|
|
_stackPositionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('min_dose')) {
|
|
context.handle(
|
|
_minDoseMeta,
|
|
minDose.isAcceptableOrUnknown(data['min_dose']!, _minDoseMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('target_dose')) {
|
|
context.handle(
|
|
_targetDoseMeta,
|
|
targetDose.isAcceptableOrUnknown(data['target_dose']!, _targetDoseMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('started_at')) {
|
|
context.handle(
|
|
_startedAtMeta,
|
|
startedAt.isAcceptableOrUnknown(data['started_at']!, _startedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startedAtMeta);
|
|
}
|
|
if (data.containsKey('ended_at')) {
|
|
context.handle(
|
|
_endedAtMeta,
|
|
endedAt.isAcceptableOrUnknown(data['ended_at']!, _endedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('tags_json')) {
|
|
context.handle(
|
|
_tagsJsonMeta,
|
|
tagsJson.isAcceptableOrUnknown(data['tags_json']!, _tagsJsonMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Habit map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Habit(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
userId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}user_id'],
|
|
)!,
|
|
phaseId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}phase_id'],
|
|
),
|
|
type: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}type'],
|
|
)!,
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
protocolId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}protocol_id'],
|
|
),
|
|
breakProtocolId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}break_protocol_id'],
|
|
),
|
|
commonFrameIdsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}common_frame_ids_json'],
|
|
),
|
|
frameLevel: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}frame_level'],
|
|
)!,
|
|
frameOriginalText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}frame_original_text'],
|
|
),
|
|
frameFramedText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}frame_framed_text'],
|
|
)!,
|
|
anchorWhen: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}anchor_when'],
|
|
),
|
|
anchorAfterWhat: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}anchor_after_what'],
|
|
),
|
|
anchorWhere: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}anchor_where'],
|
|
),
|
|
stackPosition: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}stack_position'],
|
|
),
|
|
minDose: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}min_dose'],
|
|
),
|
|
targetDose: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}target_dose'],
|
|
),
|
|
startedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}started_at'],
|
|
)!,
|
|
endedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}ended_at'],
|
|
),
|
|
tagsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tags_json'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$HabitsTable createAlias(String alias) {
|
|
return $HabitsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Habit extends DataClass implements Insertable<Habit> {
|
|
final String id;
|
|
final String userId;
|
|
final String? phaseId;
|
|
final String type;
|
|
final String status;
|
|
final String title;
|
|
final String? protocolId;
|
|
final String? breakProtocolId;
|
|
final String? commonFrameIdsJson;
|
|
final String frameLevel;
|
|
final String? frameOriginalText;
|
|
final String frameFramedText;
|
|
final String? anchorWhen;
|
|
final String? anchorAfterWhat;
|
|
final String? anchorWhere;
|
|
final int? stackPosition;
|
|
final String? minDose;
|
|
final String? targetDose;
|
|
final String startedAt;
|
|
final String? endedAt;
|
|
final String? tagsJson;
|
|
const Habit({
|
|
required this.id,
|
|
required this.userId,
|
|
this.phaseId,
|
|
required this.type,
|
|
required this.status,
|
|
required this.title,
|
|
this.protocolId,
|
|
this.breakProtocolId,
|
|
this.commonFrameIdsJson,
|
|
required this.frameLevel,
|
|
this.frameOriginalText,
|
|
required this.frameFramedText,
|
|
this.anchorWhen,
|
|
this.anchorAfterWhat,
|
|
this.anchorWhere,
|
|
this.stackPosition,
|
|
this.minDose,
|
|
this.targetDose,
|
|
required this.startedAt,
|
|
this.endedAt,
|
|
this.tagsJson,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['user_id'] = Variable<String>(userId);
|
|
if (!nullToAbsent || phaseId != null) {
|
|
map['phase_id'] = Variable<String>(phaseId);
|
|
}
|
|
map['type'] = Variable<String>(type);
|
|
map['status'] = Variable<String>(status);
|
|
map['title'] = Variable<String>(title);
|
|
if (!nullToAbsent || protocolId != null) {
|
|
map['protocol_id'] = Variable<String>(protocolId);
|
|
}
|
|
if (!nullToAbsent || breakProtocolId != null) {
|
|
map['break_protocol_id'] = Variable<String>(breakProtocolId);
|
|
}
|
|
if (!nullToAbsent || commonFrameIdsJson != null) {
|
|
map['common_frame_ids_json'] = Variable<String>(commonFrameIdsJson);
|
|
}
|
|
map['frame_level'] = Variable<String>(frameLevel);
|
|
if (!nullToAbsent || frameOriginalText != null) {
|
|
map['frame_original_text'] = Variable<String>(frameOriginalText);
|
|
}
|
|
map['frame_framed_text'] = Variable<String>(frameFramedText);
|
|
if (!nullToAbsent || anchorWhen != null) {
|
|
map['anchor_when'] = Variable<String>(anchorWhen);
|
|
}
|
|
if (!nullToAbsent || anchorAfterWhat != null) {
|
|
map['anchor_after_what'] = Variable<String>(anchorAfterWhat);
|
|
}
|
|
if (!nullToAbsent || anchorWhere != null) {
|
|
map['anchor_where'] = Variable<String>(anchorWhere);
|
|
}
|
|
if (!nullToAbsent || stackPosition != null) {
|
|
map['stack_position'] = Variable<int>(stackPosition);
|
|
}
|
|
if (!nullToAbsent || minDose != null) {
|
|
map['min_dose'] = Variable<String>(minDose);
|
|
}
|
|
if (!nullToAbsent || targetDose != null) {
|
|
map['target_dose'] = Variable<String>(targetDose);
|
|
}
|
|
map['started_at'] = Variable<String>(startedAt);
|
|
if (!nullToAbsent || endedAt != null) {
|
|
map['ended_at'] = Variable<String>(endedAt);
|
|
}
|
|
if (!nullToAbsent || tagsJson != null) {
|
|
map['tags_json'] = Variable<String>(tagsJson);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
HabitsCompanion toCompanion(bool nullToAbsent) {
|
|
return HabitsCompanion(
|
|
id: Value(id),
|
|
userId: Value(userId),
|
|
phaseId: phaseId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(phaseId),
|
|
type: Value(type),
|
|
status: Value(status),
|
|
title: Value(title),
|
|
protocolId: protocolId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(protocolId),
|
|
breakProtocolId: breakProtocolId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(breakProtocolId),
|
|
commonFrameIdsJson: commonFrameIdsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(commonFrameIdsJson),
|
|
frameLevel: Value(frameLevel),
|
|
frameOriginalText: frameOriginalText == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(frameOriginalText),
|
|
frameFramedText: Value(frameFramedText),
|
|
anchorWhen: anchorWhen == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(anchorWhen),
|
|
anchorAfterWhat: anchorAfterWhat == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(anchorAfterWhat),
|
|
anchorWhere: anchorWhere == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(anchorWhere),
|
|
stackPosition: stackPosition == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(stackPosition),
|
|
minDose: minDose == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(minDose),
|
|
targetDose: targetDose == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(targetDose),
|
|
startedAt: Value(startedAt),
|
|
endedAt: endedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(endedAt),
|
|
tagsJson: tagsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(tagsJson),
|
|
);
|
|
}
|
|
|
|
factory Habit.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Habit(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
userId: serializer.fromJson<String>(json['userId']),
|
|
phaseId: serializer.fromJson<String?>(json['phaseId']),
|
|
type: serializer.fromJson<String>(json['type']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
protocolId: serializer.fromJson<String?>(json['protocolId']),
|
|
breakProtocolId: serializer.fromJson<String?>(json['breakProtocolId']),
|
|
commonFrameIdsJson: serializer.fromJson<String?>(
|
|
json['commonFrameIdsJson'],
|
|
),
|
|
frameLevel: serializer.fromJson<String>(json['frameLevel']),
|
|
frameOriginalText: serializer.fromJson<String?>(
|
|
json['frameOriginalText'],
|
|
),
|
|
frameFramedText: serializer.fromJson<String>(json['frameFramedText']),
|
|
anchorWhen: serializer.fromJson<String?>(json['anchorWhen']),
|
|
anchorAfterWhat: serializer.fromJson<String?>(json['anchorAfterWhat']),
|
|
anchorWhere: serializer.fromJson<String?>(json['anchorWhere']),
|
|
stackPosition: serializer.fromJson<int?>(json['stackPosition']),
|
|
minDose: serializer.fromJson<String?>(json['minDose']),
|
|
targetDose: serializer.fromJson<String?>(json['targetDose']),
|
|
startedAt: serializer.fromJson<String>(json['startedAt']),
|
|
endedAt: serializer.fromJson<String?>(json['endedAt']),
|
|
tagsJson: serializer.fromJson<String?>(json['tagsJson']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'userId': serializer.toJson<String>(userId),
|
|
'phaseId': serializer.toJson<String?>(phaseId),
|
|
'type': serializer.toJson<String>(type),
|
|
'status': serializer.toJson<String>(status),
|
|
'title': serializer.toJson<String>(title),
|
|
'protocolId': serializer.toJson<String?>(protocolId),
|
|
'breakProtocolId': serializer.toJson<String?>(breakProtocolId),
|
|
'commonFrameIdsJson': serializer.toJson<String?>(commonFrameIdsJson),
|
|
'frameLevel': serializer.toJson<String>(frameLevel),
|
|
'frameOriginalText': serializer.toJson<String?>(frameOriginalText),
|
|
'frameFramedText': serializer.toJson<String>(frameFramedText),
|
|
'anchorWhen': serializer.toJson<String?>(anchorWhen),
|
|
'anchorAfterWhat': serializer.toJson<String?>(anchorAfterWhat),
|
|
'anchorWhere': serializer.toJson<String?>(anchorWhere),
|
|
'stackPosition': serializer.toJson<int?>(stackPosition),
|
|
'minDose': serializer.toJson<String?>(minDose),
|
|
'targetDose': serializer.toJson<String?>(targetDose),
|
|
'startedAt': serializer.toJson<String>(startedAt),
|
|
'endedAt': serializer.toJson<String?>(endedAt),
|
|
'tagsJson': serializer.toJson<String?>(tagsJson),
|
|
};
|
|
}
|
|
|
|
Habit copyWith({
|
|
String? id,
|
|
String? userId,
|
|
Value<String?> phaseId = const Value.absent(),
|
|
String? type,
|
|
String? status,
|
|
String? title,
|
|
Value<String?> protocolId = const Value.absent(),
|
|
Value<String?> breakProtocolId = const Value.absent(),
|
|
Value<String?> commonFrameIdsJson = const Value.absent(),
|
|
String? frameLevel,
|
|
Value<String?> frameOriginalText = const Value.absent(),
|
|
String? frameFramedText,
|
|
Value<String?> anchorWhen = const Value.absent(),
|
|
Value<String?> anchorAfterWhat = const Value.absent(),
|
|
Value<String?> anchorWhere = const Value.absent(),
|
|
Value<int?> stackPosition = const Value.absent(),
|
|
Value<String?> minDose = const Value.absent(),
|
|
Value<String?> targetDose = const Value.absent(),
|
|
String? startedAt,
|
|
Value<String?> endedAt = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
}) => Habit(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
phaseId: phaseId.present ? phaseId.value : this.phaseId,
|
|
type: type ?? this.type,
|
|
status: status ?? this.status,
|
|
title: title ?? this.title,
|
|
protocolId: protocolId.present ? protocolId.value : this.protocolId,
|
|
breakProtocolId: breakProtocolId.present
|
|
? breakProtocolId.value
|
|
: this.breakProtocolId,
|
|
commonFrameIdsJson: commonFrameIdsJson.present
|
|
? commonFrameIdsJson.value
|
|
: this.commonFrameIdsJson,
|
|
frameLevel: frameLevel ?? this.frameLevel,
|
|
frameOriginalText: frameOriginalText.present
|
|
? frameOriginalText.value
|
|
: this.frameOriginalText,
|
|
frameFramedText: frameFramedText ?? this.frameFramedText,
|
|
anchorWhen: anchorWhen.present ? anchorWhen.value : this.anchorWhen,
|
|
anchorAfterWhat: anchorAfterWhat.present
|
|
? anchorAfterWhat.value
|
|
: this.anchorAfterWhat,
|
|
anchorWhere: anchorWhere.present ? anchorWhere.value : this.anchorWhere,
|
|
stackPosition: stackPosition.present
|
|
? stackPosition.value
|
|
: this.stackPosition,
|
|
minDose: minDose.present ? minDose.value : this.minDose,
|
|
targetDose: targetDose.present ? targetDose.value : this.targetDose,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt.present ? endedAt.value : this.endedAt,
|
|
tagsJson: tagsJson.present ? tagsJson.value : this.tagsJson,
|
|
);
|
|
Habit copyWithCompanion(HabitsCompanion data) {
|
|
return Habit(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
userId: data.userId.present ? data.userId.value : this.userId,
|
|
phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
protocolId: data.protocolId.present
|
|
? data.protocolId.value
|
|
: this.protocolId,
|
|
breakProtocolId: data.breakProtocolId.present
|
|
? data.breakProtocolId.value
|
|
: this.breakProtocolId,
|
|
commonFrameIdsJson: data.commonFrameIdsJson.present
|
|
? data.commonFrameIdsJson.value
|
|
: this.commonFrameIdsJson,
|
|
frameLevel: data.frameLevel.present
|
|
? data.frameLevel.value
|
|
: this.frameLevel,
|
|
frameOriginalText: data.frameOriginalText.present
|
|
? data.frameOriginalText.value
|
|
: this.frameOriginalText,
|
|
frameFramedText: data.frameFramedText.present
|
|
? data.frameFramedText.value
|
|
: this.frameFramedText,
|
|
anchorWhen: data.anchorWhen.present
|
|
? data.anchorWhen.value
|
|
: this.anchorWhen,
|
|
anchorAfterWhat: data.anchorAfterWhat.present
|
|
? data.anchorAfterWhat.value
|
|
: this.anchorAfterWhat,
|
|
anchorWhere: data.anchorWhere.present
|
|
? data.anchorWhere.value
|
|
: this.anchorWhere,
|
|
stackPosition: data.stackPosition.present
|
|
? data.stackPosition.value
|
|
: this.stackPosition,
|
|
minDose: data.minDose.present ? data.minDose.value : this.minDose,
|
|
targetDose: data.targetDose.present
|
|
? data.targetDose.value
|
|
: this.targetDose,
|
|
startedAt: data.startedAt.present ? data.startedAt.value : this.startedAt,
|
|
endedAt: data.endedAt.present ? data.endedAt.value : this.endedAt,
|
|
tagsJson: data.tagsJson.present ? data.tagsJson.value : this.tagsJson,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Habit(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('type: $type, ')
|
|
..write('status: $status, ')
|
|
..write('title: $title, ')
|
|
..write('protocolId: $protocolId, ')
|
|
..write('breakProtocolId: $breakProtocolId, ')
|
|
..write('commonFrameIdsJson: $commonFrameIdsJson, ')
|
|
..write('frameLevel: $frameLevel, ')
|
|
..write('frameOriginalText: $frameOriginalText, ')
|
|
..write('frameFramedText: $frameFramedText, ')
|
|
..write('anchorWhen: $anchorWhen, ')
|
|
..write('anchorAfterWhat: $anchorAfterWhat, ')
|
|
..write('anchorWhere: $anchorWhere, ')
|
|
..write('stackPosition: $stackPosition, ')
|
|
..write('minDose: $minDose, ')
|
|
..write('targetDose: $targetDose, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('tagsJson: $tagsJson')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hashAll([
|
|
id,
|
|
userId,
|
|
phaseId,
|
|
type,
|
|
status,
|
|
title,
|
|
protocolId,
|
|
breakProtocolId,
|
|
commonFrameIdsJson,
|
|
frameLevel,
|
|
frameOriginalText,
|
|
frameFramedText,
|
|
anchorWhen,
|
|
anchorAfterWhat,
|
|
anchorWhere,
|
|
stackPosition,
|
|
minDose,
|
|
targetDose,
|
|
startedAt,
|
|
endedAt,
|
|
tagsJson,
|
|
]);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Habit &&
|
|
other.id == this.id &&
|
|
other.userId == this.userId &&
|
|
other.phaseId == this.phaseId &&
|
|
other.type == this.type &&
|
|
other.status == this.status &&
|
|
other.title == this.title &&
|
|
other.protocolId == this.protocolId &&
|
|
other.breakProtocolId == this.breakProtocolId &&
|
|
other.commonFrameIdsJson == this.commonFrameIdsJson &&
|
|
other.frameLevel == this.frameLevel &&
|
|
other.frameOriginalText == this.frameOriginalText &&
|
|
other.frameFramedText == this.frameFramedText &&
|
|
other.anchorWhen == this.anchorWhen &&
|
|
other.anchorAfterWhat == this.anchorAfterWhat &&
|
|
other.anchorWhere == this.anchorWhere &&
|
|
other.stackPosition == this.stackPosition &&
|
|
other.minDose == this.minDose &&
|
|
other.targetDose == this.targetDose &&
|
|
other.startedAt == this.startedAt &&
|
|
other.endedAt == this.endedAt &&
|
|
other.tagsJson == this.tagsJson);
|
|
}
|
|
|
|
class HabitsCompanion extends UpdateCompanion<Habit> {
|
|
final Value<String> id;
|
|
final Value<String> userId;
|
|
final Value<String?> phaseId;
|
|
final Value<String> type;
|
|
final Value<String> status;
|
|
final Value<String> title;
|
|
final Value<String?> protocolId;
|
|
final Value<String?> breakProtocolId;
|
|
final Value<String?> commonFrameIdsJson;
|
|
final Value<String> frameLevel;
|
|
final Value<String?> frameOriginalText;
|
|
final Value<String> frameFramedText;
|
|
final Value<String?> anchorWhen;
|
|
final Value<String?> anchorAfterWhat;
|
|
final Value<String?> anchorWhere;
|
|
final Value<int?> stackPosition;
|
|
final Value<String?> minDose;
|
|
final Value<String?> targetDose;
|
|
final Value<String> startedAt;
|
|
final Value<String?> endedAt;
|
|
final Value<String?> tagsJson;
|
|
final Value<int> rowid;
|
|
const HabitsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.userId = const Value.absent(),
|
|
this.phaseId = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.protocolId = const Value.absent(),
|
|
this.breakProtocolId = const Value.absent(),
|
|
this.commonFrameIdsJson = const Value.absent(),
|
|
this.frameLevel = const Value.absent(),
|
|
this.frameOriginalText = const Value.absent(),
|
|
this.frameFramedText = const Value.absent(),
|
|
this.anchorWhen = const Value.absent(),
|
|
this.anchorAfterWhat = const Value.absent(),
|
|
this.anchorWhere = const Value.absent(),
|
|
this.stackPosition = const Value.absent(),
|
|
this.minDose = const Value.absent(),
|
|
this.targetDose = const Value.absent(),
|
|
this.startedAt = const Value.absent(),
|
|
this.endedAt = const Value.absent(),
|
|
this.tagsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
HabitsCompanion.insert({
|
|
required String id,
|
|
required String userId,
|
|
this.phaseId = const Value.absent(),
|
|
required String type,
|
|
required String status,
|
|
required String title,
|
|
this.protocolId = const Value.absent(),
|
|
this.breakProtocolId = const Value.absent(),
|
|
this.commonFrameIdsJson = const Value.absent(),
|
|
required String frameLevel,
|
|
this.frameOriginalText = const Value.absent(),
|
|
required String frameFramedText,
|
|
this.anchorWhen = const Value.absent(),
|
|
this.anchorAfterWhat = const Value.absent(),
|
|
this.anchorWhere = const Value.absent(),
|
|
this.stackPosition = const Value.absent(),
|
|
this.minDose = const Value.absent(),
|
|
this.targetDose = const Value.absent(),
|
|
required String startedAt,
|
|
this.endedAt = const Value.absent(),
|
|
this.tagsJson = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
userId = Value(userId),
|
|
type = Value(type),
|
|
status = Value(status),
|
|
title = Value(title),
|
|
frameLevel = Value(frameLevel),
|
|
frameFramedText = Value(frameFramedText),
|
|
startedAt = Value(startedAt);
|
|
static Insertable<Habit> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? userId,
|
|
Expression<String>? phaseId,
|
|
Expression<String>? type,
|
|
Expression<String>? status,
|
|
Expression<String>? title,
|
|
Expression<String>? protocolId,
|
|
Expression<String>? breakProtocolId,
|
|
Expression<String>? commonFrameIdsJson,
|
|
Expression<String>? frameLevel,
|
|
Expression<String>? frameOriginalText,
|
|
Expression<String>? frameFramedText,
|
|
Expression<String>? anchorWhen,
|
|
Expression<String>? anchorAfterWhat,
|
|
Expression<String>? anchorWhere,
|
|
Expression<int>? stackPosition,
|
|
Expression<String>? minDose,
|
|
Expression<String>? targetDose,
|
|
Expression<String>? startedAt,
|
|
Expression<String>? endedAt,
|
|
Expression<String>? tagsJson,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (userId != null) 'user_id': userId,
|
|
if (phaseId != null) 'phase_id': phaseId,
|
|
if (type != null) 'type': type,
|
|
if (status != null) 'status': status,
|
|
if (title != null) 'title': title,
|
|
if (protocolId != null) 'protocol_id': protocolId,
|
|
if (breakProtocolId != null) 'break_protocol_id': breakProtocolId,
|
|
if (commonFrameIdsJson != null)
|
|
'common_frame_ids_json': commonFrameIdsJson,
|
|
if (frameLevel != null) 'frame_level': frameLevel,
|
|
if (frameOriginalText != null) 'frame_original_text': frameOriginalText,
|
|
if (frameFramedText != null) 'frame_framed_text': frameFramedText,
|
|
if (anchorWhen != null) 'anchor_when': anchorWhen,
|
|
if (anchorAfterWhat != null) 'anchor_after_what': anchorAfterWhat,
|
|
if (anchorWhere != null) 'anchor_where': anchorWhere,
|
|
if (stackPosition != null) 'stack_position': stackPosition,
|
|
if (minDose != null) 'min_dose': minDose,
|
|
if (targetDose != null) 'target_dose': targetDose,
|
|
if (startedAt != null) 'started_at': startedAt,
|
|
if (endedAt != null) 'ended_at': endedAt,
|
|
if (tagsJson != null) 'tags_json': tagsJson,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
HabitsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? userId,
|
|
Value<String?>? phaseId,
|
|
Value<String>? type,
|
|
Value<String>? status,
|
|
Value<String>? title,
|
|
Value<String?>? protocolId,
|
|
Value<String?>? breakProtocolId,
|
|
Value<String?>? commonFrameIdsJson,
|
|
Value<String>? frameLevel,
|
|
Value<String?>? frameOriginalText,
|
|
Value<String>? frameFramedText,
|
|
Value<String?>? anchorWhen,
|
|
Value<String?>? anchorAfterWhat,
|
|
Value<String?>? anchorWhere,
|
|
Value<int?>? stackPosition,
|
|
Value<String?>? minDose,
|
|
Value<String?>? targetDose,
|
|
Value<String>? startedAt,
|
|
Value<String?>? endedAt,
|
|
Value<String?>? tagsJson,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return HabitsCompanion(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
phaseId: phaseId ?? this.phaseId,
|
|
type: type ?? this.type,
|
|
status: status ?? this.status,
|
|
title: title ?? this.title,
|
|
protocolId: protocolId ?? this.protocolId,
|
|
breakProtocolId: breakProtocolId ?? this.breakProtocolId,
|
|
commonFrameIdsJson: commonFrameIdsJson ?? this.commonFrameIdsJson,
|
|
frameLevel: frameLevel ?? this.frameLevel,
|
|
frameOriginalText: frameOriginalText ?? this.frameOriginalText,
|
|
frameFramedText: frameFramedText ?? this.frameFramedText,
|
|
anchorWhen: anchorWhen ?? this.anchorWhen,
|
|
anchorAfterWhat: anchorAfterWhat ?? this.anchorAfterWhat,
|
|
anchorWhere: anchorWhere ?? this.anchorWhere,
|
|
stackPosition: stackPosition ?? this.stackPosition,
|
|
minDose: minDose ?? this.minDose,
|
|
targetDose: targetDose ?? this.targetDose,
|
|
startedAt: startedAt ?? this.startedAt,
|
|
endedAt: endedAt ?? this.endedAt,
|
|
tagsJson: tagsJson ?? this.tagsJson,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (userId.present) {
|
|
map['user_id'] = Variable<String>(userId.value);
|
|
}
|
|
if (phaseId.present) {
|
|
map['phase_id'] = Variable<String>(phaseId.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(type.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (protocolId.present) {
|
|
map['protocol_id'] = Variable<String>(protocolId.value);
|
|
}
|
|
if (breakProtocolId.present) {
|
|
map['break_protocol_id'] = Variable<String>(breakProtocolId.value);
|
|
}
|
|
if (commonFrameIdsJson.present) {
|
|
map['common_frame_ids_json'] = Variable<String>(commonFrameIdsJson.value);
|
|
}
|
|
if (frameLevel.present) {
|
|
map['frame_level'] = Variable<String>(frameLevel.value);
|
|
}
|
|
if (frameOriginalText.present) {
|
|
map['frame_original_text'] = Variable<String>(frameOriginalText.value);
|
|
}
|
|
if (frameFramedText.present) {
|
|
map['frame_framed_text'] = Variable<String>(frameFramedText.value);
|
|
}
|
|
if (anchorWhen.present) {
|
|
map['anchor_when'] = Variable<String>(anchorWhen.value);
|
|
}
|
|
if (anchorAfterWhat.present) {
|
|
map['anchor_after_what'] = Variable<String>(anchorAfterWhat.value);
|
|
}
|
|
if (anchorWhere.present) {
|
|
map['anchor_where'] = Variable<String>(anchorWhere.value);
|
|
}
|
|
if (stackPosition.present) {
|
|
map['stack_position'] = Variable<int>(stackPosition.value);
|
|
}
|
|
if (minDose.present) {
|
|
map['min_dose'] = Variable<String>(minDose.value);
|
|
}
|
|
if (targetDose.present) {
|
|
map['target_dose'] = Variable<String>(targetDose.value);
|
|
}
|
|
if (startedAt.present) {
|
|
map['started_at'] = Variable<String>(startedAt.value);
|
|
}
|
|
if (endedAt.present) {
|
|
map['ended_at'] = Variable<String>(endedAt.value);
|
|
}
|
|
if (tagsJson.present) {
|
|
map['tags_json'] = Variable<String>(tagsJson.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('HabitsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('type: $type, ')
|
|
..write('status: $status, ')
|
|
..write('title: $title, ')
|
|
..write('protocolId: $protocolId, ')
|
|
..write('breakProtocolId: $breakProtocolId, ')
|
|
..write('commonFrameIdsJson: $commonFrameIdsJson, ')
|
|
..write('frameLevel: $frameLevel, ')
|
|
..write('frameOriginalText: $frameOriginalText, ')
|
|
..write('frameFramedText: $frameFramedText, ')
|
|
..write('anchorWhen: $anchorWhen, ')
|
|
..write('anchorAfterWhat: $anchorAfterWhat, ')
|
|
..write('anchorWhere: $anchorWhere, ')
|
|
..write('stackPosition: $stackPosition, ')
|
|
..write('minDose: $minDose, ')
|
|
..write('targetDose: $targetDose, ')
|
|
..write('startedAt: $startedAt, ')
|
|
..write('endedAt: $endedAt, ')
|
|
..write('tagsJson: $tagsJson, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $HabitDoseVariantsTable extends HabitDoseVariants
|
|
with TableInfo<$HabitDoseVariantsTable, HabitDoseVariant> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$HabitDoseVariantsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _variantIdMeta = const VerificationMeta(
|
|
'variantId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> variantId = GeneratedColumn<String>(
|
|
'variant_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) ON DELETE CASCADE NOT NULL',
|
|
);
|
|
static const VerificationMeta _labelMeta = const VerificationMeta('label');
|
|
@override
|
|
late final GeneratedColumn<String> label = GeneratedColumn<String>(
|
|
'label',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _doseTextMeta = const VerificationMeta(
|
|
'doseText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> doseText = GeneratedColumn<String>(
|
|
'dose_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _contextTagsJsonMeta = const VerificationMeta(
|
|
'contextTagsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> contextTagsJson = GeneratedColumn<String>(
|
|
'context_tags_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _conditionTagsJsonMeta = const VerificationMeta(
|
|
'conditionTagsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> conditionTagsJson =
|
|
GeneratedColumn<String>(
|
|
'condition_tags_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isMinimumMeta = const VerificationMeta(
|
|
'isMinimum',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isMinimum = GeneratedColumn<bool>(
|
|
'is_minimum',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_minimum" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _sortOrderMeta = const VerificationMeta(
|
|
'sortOrder',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sortOrder = GeneratedColumn<int>(
|
|
'sort_order',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
variantId,
|
|
habitId,
|
|
label,
|
|
doseText,
|
|
contextTagsJson,
|
|
conditionTagsJson,
|
|
isMinimum,
|
|
sortOrder,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'habit_dose_variants';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<HabitDoseVariant> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('variant_id')) {
|
|
context.handle(
|
|
_variantIdMeta,
|
|
variantId.isAcceptableOrUnknown(data['variant_id']!, _variantIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_variantIdMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('label')) {
|
|
context.handle(
|
|
_labelMeta,
|
|
label.isAcceptableOrUnknown(data['label']!, _labelMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_labelMeta);
|
|
}
|
|
if (data.containsKey('dose_text')) {
|
|
context.handle(
|
|
_doseTextMeta,
|
|
doseText.isAcceptableOrUnknown(data['dose_text']!, _doseTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_doseTextMeta);
|
|
}
|
|
if (data.containsKey('context_tags_json')) {
|
|
context.handle(
|
|
_contextTagsJsonMeta,
|
|
contextTagsJson.isAcceptableOrUnknown(
|
|
data['context_tags_json']!,
|
|
_contextTagsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('condition_tags_json')) {
|
|
context.handle(
|
|
_conditionTagsJsonMeta,
|
|
conditionTagsJson.isAcceptableOrUnknown(
|
|
data['condition_tags_json']!,
|
|
_conditionTagsJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_minimum')) {
|
|
context.handle(
|
|
_isMinimumMeta,
|
|
isMinimum.isAcceptableOrUnknown(data['is_minimum']!, _isMinimumMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('sort_order')) {
|
|
context.handle(
|
|
_sortOrderMeta,
|
|
sortOrder.isAcceptableOrUnknown(data['sort_order']!, _sortOrderMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {variantId};
|
|
@override
|
|
HabitDoseVariant map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return HabitDoseVariant(
|
|
variantId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variant_id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
label: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}label'],
|
|
)!,
|
|
doseText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}dose_text'],
|
|
)!,
|
|
contextTagsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}context_tags_json'],
|
|
),
|
|
conditionTagsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}condition_tags_json'],
|
|
),
|
|
isMinimum: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_minimum'],
|
|
)!,
|
|
sortOrder: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sort_order'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$HabitDoseVariantsTable createAlias(String alias) {
|
|
return $HabitDoseVariantsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class HabitDoseVariant extends DataClass
|
|
implements Insertable<HabitDoseVariant> {
|
|
final String variantId;
|
|
final String habitId;
|
|
final String label;
|
|
final String doseText;
|
|
final String? contextTagsJson;
|
|
final String? conditionTagsJson;
|
|
final bool isMinimum;
|
|
final int sortOrder;
|
|
const HabitDoseVariant({
|
|
required this.variantId,
|
|
required this.habitId,
|
|
required this.label,
|
|
required this.doseText,
|
|
this.contextTagsJson,
|
|
this.conditionTagsJson,
|
|
required this.isMinimum,
|
|
required this.sortOrder,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['variant_id'] = Variable<String>(variantId);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['label'] = Variable<String>(label);
|
|
map['dose_text'] = Variable<String>(doseText);
|
|
if (!nullToAbsent || contextTagsJson != null) {
|
|
map['context_tags_json'] = Variable<String>(contextTagsJson);
|
|
}
|
|
if (!nullToAbsent || conditionTagsJson != null) {
|
|
map['condition_tags_json'] = Variable<String>(conditionTagsJson);
|
|
}
|
|
map['is_minimum'] = Variable<bool>(isMinimum);
|
|
map['sort_order'] = Variable<int>(sortOrder);
|
|
return map;
|
|
}
|
|
|
|
HabitDoseVariantsCompanion toCompanion(bool nullToAbsent) {
|
|
return HabitDoseVariantsCompanion(
|
|
variantId: Value(variantId),
|
|
habitId: Value(habitId),
|
|
label: Value(label),
|
|
doseText: Value(doseText),
|
|
contextTagsJson: contextTagsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(contextTagsJson),
|
|
conditionTagsJson: conditionTagsJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(conditionTagsJson),
|
|
isMinimum: Value(isMinimum),
|
|
sortOrder: Value(sortOrder),
|
|
);
|
|
}
|
|
|
|
factory HabitDoseVariant.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return HabitDoseVariant(
|
|
variantId: serializer.fromJson<String>(json['variantId']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
label: serializer.fromJson<String>(json['label']),
|
|
doseText: serializer.fromJson<String>(json['doseText']),
|
|
contextTagsJson: serializer.fromJson<String?>(json['contextTagsJson']),
|
|
conditionTagsJson: serializer.fromJson<String?>(
|
|
json['conditionTagsJson'],
|
|
),
|
|
isMinimum: serializer.fromJson<bool>(json['isMinimum']),
|
|
sortOrder: serializer.fromJson<int>(json['sortOrder']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'variantId': serializer.toJson<String>(variantId),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'label': serializer.toJson<String>(label),
|
|
'doseText': serializer.toJson<String>(doseText),
|
|
'contextTagsJson': serializer.toJson<String?>(contextTagsJson),
|
|
'conditionTagsJson': serializer.toJson<String?>(conditionTagsJson),
|
|
'isMinimum': serializer.toJson<bool>(isMinimum),
|
|
'sortOrder': serializer.toJson<int>(sortOrder),
|
|
};
|
|
}
|
|
|
|
HabitDoseVariant copyWith({
|
|
String? variantId,
|
|
String? habitId,
|
|
String? label,
|
|
String? doseText,
|
|
Value<String?> contextTagsJson = const Value.absent(),
|
|
Value<String?> conditionTagsJson = const Value.absent(),
|
|
bool? isMinimum,
|
|
int? sortOrder,
|
|
}) => HabitDoseVariant(
|
|
variantId: variantId ?? this.variantId,
|
|
habitId: habitId ?? this.habitId,
|
|
label: label ?? this.label,
|
|
doseText: doseText ?? this.doseText,
|
|
contextTagsJson: contextTagsJson.present
|
|
? contextTagsJson.value
|
|
: this.contextTagsJson,
|
|
conditionTagsJson: conditionTagsJson.present
|
|
? conditionTagsJson.value
|
|
: this.conditionTagsJson,
|
|
isMinimum: isMinimum ?? this.isMinimum,
|
|
sortOrder: sortOrder ?? this.sortOrder,
|
|
);
|
|
HabitDoseVariant copyWithCompanion(HabitDoseVariantsCompanion data) {
|
|
return HabitDoseVariant(
|
|
variantId: data.variantId.present ? data.variantId.value : this.variantId,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
label: data.label.present ? data.label.value : this.label,
|
|
doseText: data.doseText.present ? data.doseText.value : this.doseText,
|
|
contextTagsJson: data.contextTagsJson.present
|
|
? data.contextTagsJson.value
|
|
: this.contextTagsJson,
|
|
conditionTagsJson: data.conditionTagsJson.present
|
|
? data.conditionTagsJson.value
|
|
: this.conditionTagsJson,
|
|
isMinimum: data.isMinimum.present ? data.isMinimum.value : this.isMinimum,
|
|
sortOrder: data.sortOrder.present ? data.sortOrder.value : this.sortOrder,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('HabitDoseVariant(')
|
|
..write('variantId: $variantId, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('label: $label, ')
|
|
..write('doseText: $doseText, ')
|
|
..write('contextTagsJson: $contextTagsJson, ')
|
|
..write('conditionTagsJson: $conditionTagsJson, ')
|
|
..write('isMinimum: $isMinimum, ')
|
|
..write('sortOrder: $sortOrder')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
variantId,
|
|
habitId,
|
|
label,
|
|
doseText,
|
|
contextTagsJson,
|
|
conditionTagsJson,
|
|
isMinimum,
|
|
sortOrder,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is HabitDoseVariant &&
|
|
other.variantId == this.variantId &&
|
|
other.habitId == this.habitId &&
|
|
other.label == this.label &&
|
|
other.doseText == this.doseText &&
|
|
other.contextTagsJson == this.contextTagsJson &&
|
|
other.conditionTagsJson == this.conditionTagsJson &&
|
|
other.isMinimum == this.isMinimum &&
|
|
other.sortOrder == this.sortOrder);
|
|
}
|
|
|
|
class HabitDoseVariantsCompanion extends UpdateCompanion<HabitDoseVariant> {
|
|
final Value<String> variantId;
|
|
final Value<String> habitId;
|
|
final Value<String> label;
|
|
final Value<String> doseText;
|
|
final Value<String?> contextTagsJson;
|
|
final Value<String?> conditionTagsJson;
|
|
final Value<bool> isMinimum;
|
|
final Value<int> sortOrder;
|
|
final Value<int> rowid;
|
|
const HabitDoseVariantsCompanion({
|
|
this.variantId = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.label = const Value.absent(),
|
|
this.doseText = const Value.absent(),
|
|
this.contextTagsJson = const Value.absent(),
|
|
this.conditionTagsJson = const Value.absent(),
|
|
this.isMinimum = const Value.absent(),
|
|
this.sortOrder = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
HabitDoseVariantsCompanion.insert({
|
|
required String variantId,
|
|
required String habitId,
|
|
required String label,
|
|
required String doseText,
|
|
this.contextTagsJson = const Value.absent(),
|
|
this.conditionTagsJson = const Value.absent(),
|
|
this.isMinimum = const Value.absent(),
|
|
this.sortOrder = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : variantId = Value(variantId),
|
|
habitId = Value(habitId),
|
|
label = Value(label),
|
|
doseText = Value(doseText);
|
|
static Insertable<HabitDoseVariant> custom({
|
|
Expression<String>? variantId,
|
|
Expression<String>? habitId,
|
|
Expression<String>? label,
|
|
Expression<String>? doseText,
|
|
Expression<String>? contextTagsJson,
|
|
Expression<String>? conditionTagsJson,
|
|
Expression<bool>? isMinimum,
|
|
Expression<int>? sortOrder,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (variantId != null) 'variant_id': variantId,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (label != null) 'label': label,
|
|
if (doseText != null) 'dose_text': doseText,
|
|
if (contextTagsJson != null) 'context_tags_json': contextTagsJson,
|
|
if (conditionTagsJson != null) 'condition_tags_json': conditionTagsJson,
|
|
if (isMinimum != null) 'is_minimum': isMinimum,
|
|
if (sortOrder != null) 'sort_order': sortOrder,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
HabitDoseVariantsCompanion copyWith({
|
|
Value<String>? variantId,
|
|
Value<String>? habitId,
|
|
Value<String>? label,
|
|
Value<String>? doseText,
|
|
Value<String?>? contextTagsJson,
|
|
Value<String?>? conditionTagsJson,
|
|
Value<bool>? isMinimum,
|
|
Value<int>? sortOrder,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return HabitDoseVariantsCompanion(
|
|
variantId: variantId ?? this.variantId,
|
|
habitId: habitId ?? this.habitId,
|
|
label: label ?? this.label,
|
|
doseText: doseText ?? this.doseText,
|
|
contextTagsJson: contextTagsJson ?? this.contextTagsJson,
|
|
conditionTagsJson: conditionTagsJson ?? this.conditionTagsJson,
|
|
isMinimum: isMinimum ?? this.isMinimum,
|
|
sortOrder: sortOrder ?? this.sortOrder,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (variantId.present) {
|
|
map['variant_id'] = Variable<String>(variantId.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (label.present) {
|
|
map['label'] = Variable<String>(label.value);
|
|
}
|
|
if (doseText.present) {
|
|
map['dose_text'] = Variable<String>(doseText.value);
|
|
}
|
|
if (contextTagsJson.present) {
|
|
map['context_tags_json'] = Variable<String>(contextTagsJson.value);
|
|
}
|
|
if (conditionTagsJson.present) {
|
|
map['condition_tags_json'] = Variable<String>(conditionTagsJson.value);
|
|
}
|
|
if (isMinimum.present) {
|
|
map['is_minimum'] = Variable<bool>(isMinimum.value);
|
|
}
|
|
if (sortOrder.present) {
|
|
map['sort_order'] = Variable<int>(sortOrder.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('HabitDoseVariantsCompanion(')
|
|
..write('variantId: $variantId, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('label: $label, ')
|
|
..write('doseText: $doseText, ')
|
|
..write('contextTagsJson: $contextTagsJson, ')
|
|
..write('conditionTagsJson: $conditionTagsJson, ')
|
|
..write('isMinimum: $isMinimum, ')
|
|
..write('sortOrder: $sortOrder, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $IfThenRulesTable extends IfThenRules
|
|
with TableInfo<$IfThenRulesTable, IfThenRule> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$IfThenRulesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) ON DELETE CASCADE NOT NULL',
|
|
);
|
|
static const VerificationMeta _ifConditionMeta = const VerificationMeta(
|
|
'ifCondition',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> ifCondition = GeneratedColumn<String>(
|
|
'if_condition',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _thenActionMeta = const VerificationMeta(
|
|
'thenAction',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> thenAction = GeneratedColumn<String>(
|
|
'then_action',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _triggerTypeMeta = const VerificationMeta(
|
|
'triggerType',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> triggerType = GeneratedColumn<String>(
|
|
'trigger_type',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"trigger_type IS NULL OR trigger_type IN ('time','location','emotion','preceding_action','urge')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _priorityMeta = const VerificationMeta(
|
|
'priority',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> priority = GeneratedColumn<int>(
|
|
'priority',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>("priority BETWEEN 1 AND 3"),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(1),
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> createdAt = GeneratedColumn<String>(
|
|
'created_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
habitId,
|
|
ifCondition,
|
|
thenAction,
|
|
triggerType,
|
|
priority,
|
|
createdAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'if_then_rules';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<IfThenRule> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('if_condition')) {
|
|
context.handle(
|
|
_ifConditionMeta,
|
|
ifCondition.isAcceptableOrUnknown(
|
|
data['if_condition']!,
|
|
_ifConditionMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_ifConditionMeta);
|
|
}
|
|
if (data.containsKey('then_action')) {
|
|
context.handle(
|
|
_thenActionMeta,
|
|
thenAction.isAcceptableOrUnknown(data['then_action']!, _thenActionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_thenActionMeta);
|
|
}
|
|
if (data.containsKey('trigger_type')) {
|
|
context.handle(
|
|
_triggerTypeMeta,
|
|
triggerType.isAcceptableOrUnknown(
|
|
data['trigger_type']!,
|
|
_triggerTypeMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('priority')) {
|
|
context.handle(
|
|
_priorityMeta,
|
|
priority.isAcceptableOrUnknown(data['priority']!, _priorityMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
IfThenRule map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return IfThenRule(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
ifCondition: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}if_condition'],
|
|
)!,
|
|
thenAction: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}then_action'],
|
|
)!,
|
|
triggerType: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}trigger_type'],
|
|
),
|
|
priority: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}priority'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$IfThenRulesTable createAlias(String alias) {
|
|
return $IfThenRulesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class IfThenRule extends DataClass implements Insertable<IfThenRule> {
|
|
final String id;
|
|
final String habitId;
|
|
final String ifCondition;
|
|
final String thenAction;
|
|
final String? triggerType;
|
|
final int priority;
|
|
final String? createdAt;
|
|
const IfThenRule({
|
|
required this.id,
|
|
required this.habitId,
|
|
required this.ifCondition,
|
|
required this.thenAction,
|
|
this.triggerType,
|
|
required this.priority,
|
|
this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['if_condition'] = Variable<String>(ifCondition);
|
|
map['then_action'] = Variable<String>(thenAction);
|
|
if (!nullToAbsent || triggerType != null) {
|
|
map['trigger_type'] = Variable<String>(triggerType);
|
|
}
|
|
map['priority'] = Variable<int>(priority);
|
|
if (!nullToAbsent || createdAt != null) {
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
IfThenRulesCompanion toCompanion(bool nullToAbsent) {
|
|
return IfThenRulesCompanion(
|
|
id: Value(id),
|
|
habitId: Value(habitId),
|
|
ifCondition: Value(ifCondition),
|
|
thenAction: Value(thenAction),
|
|
triggerType: triggerType == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(triggerType),
|
|
priority: Value(priority),
|
|
createdAt: createdAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory IfThenRule.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return IfThenRule(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
ifCondition: serializer.fromJson<String>(json['ifCondition']),
|
|
thenAction: serializer.fromJson<String>(json['thenAction']),
|
|
triggerType: serializer.fromJson<String?>(json['triggerType']),
|
|
priority: serializer.fromJson<int>(json['priority']),
|
|
createdAt: serializer.fromJson<String?>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'ifCondition': serializer.toJson<String>(ifCondition),
|
|
'thenAction': serializer.toJson<String>(thenAction),
|
|
'triggerType': serializer.toJson<String?>(triggerType),
|
|
'priority': serializer.toJson<int>(priority),
|
|
'createdAt': serializer.toJson<String?>(createdAt),
|
|
};
|
|
}
|
|
|
|
IfThenRule copyWith({
|
|
String? id,
|
|
String? habitId,
|
|
String? ifCondition,
|
|
String? thenAction,
|
|
Value<String?> triggerType = const Value.absent(),
|
|
int? priority,
|
|
Value<String?> createdAt = const Value.absent(),
|
|
}) => IfThenRule(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
ifCondition: ifCondition ?? this.ifCondition,
|
|
thenAction: thenAction ?? this.thenAction,
|
|
triggerType: triggerType.present ? triggerType.value : this.triggerType,
|
|
priority: priority ?? this.priority,
|
|
createdAt: createdAt.present ? createdAt.value : this.createdAt,
|
|
);
|
|
IfThenRule copyWithCompanion(IfThenRulesCompanion data) {
|
|
return IfThenRule(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
ifCondition: data.ifCondition.present
|
|
? data.ifCondition.value
|
|
: this.ifCondition,
|
|
thenAction: data.thenAction.present
|
|
? data.thenAction.value
|
|
: this.thenAction,
|
|
triggerType: data.triggerType.present
|
|
? data.triggerType.value
|
|
: this.triggerType,
|
|
priority: data.priority.present ? data.priority.value : this.priority,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('IfThenRule(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('ifCondition: $ifCondition, ')
|
|
..write('thenAction: $thenAction, ')
|
|
..write('triggerType: $triggerType, ')
|
|
..write('priority: $priority, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
habitId,
|
|
ifCondition,
|
|
thenAction,
|
|
triggerType,
|
|
priority,
|
|
createdAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is IfThenRule &&
|
|
other.id == this.id &&
|
|
other.habitId == this.habitId &&
|
|
other.ifCondition == this.ifCondition &&
|
|
other.thenAction == this.thenAction &&
|
|
other.triggerType == this.triggerType &&
|
|
other.priority == this.priority &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class IfThenRulesCompanion extends UpdateCompanion<IfThenRule> {
|
|
final Value<String> id;
|
|
final Value<String> habitId;
|
|
final Value<String> ifCondition;
|
|
final Value<String> thenAction;
|
|
final Value<String?> triggerType;
|
|
final Value<int> priority;
|
|
final Value<String?> createdAt;
|
|
final Value<int> rowid;
|
|
const IfThenRulesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.ifCondition = const Value.absent(),
|
|
this.thenAction = const Value.absent(),
|
|
this.triggerType = const Value.absent(),
|
|
this.priority = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
IfThenRulesCompanion.insert({
|
|
required String id,
|
|
required String habitId,
|
|
required String ifCondition,
|
|
required String thenAction,
|
|
this.triggerType = const Value.absent(),
|
|
this.priority = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
habitId = Value(habitId),
|
|
ifCondition = Value(ifCondition),
|
|
thenAction = Value(thenAction);
|
|
static Insertable<IfThenRule> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? habitId,
|
|
Expression<String>? ifCondition,
|
|
Expression<String>? thenAction,
|
|
Expression<String>? triggerType,
|
|
Expression<int>? priority,
|
|
Expression<String>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (ifCondition != null) 'if_condition': ifCondition,
|
|
if (thenAction != null) 'then_action': thenAction,
|
|
if (triggerType != null) 'trigger_type': triggerType,
|
|
if (priority != null) 'priority': priority,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
IfThenRulesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? habitId,
|
|
Value<String>? ifCondition,
|
|
Value<String>? thenAction,
|
|
Value<String?>? triggerType,
|
|
Value<int>? priority,
|
|
Value<String?>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return IfThenRulesCompanion(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
ifCondition: ifCondition ?? this.ifCondition,
|
|
thenAction: thenAction ?? this.thenAction,
|
|
triggerType: triggerType ?? this.triggerType,
|
|
priority: priority ?? this.priority,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (ifCondition.present) {
|
|
map['if_condition'] = Variable<String>(ifCondition.value);
|
|
}
|
|
if (thenAction.present) {
|
|
map['then_action'] = Variable<String>(thenAction.value);
|
|
}
|
|
if (triggerType.present) {
|
|
map['trigger_type'] = Variable<String>(triggerType.value);
|
|
}
|
|
if (priority.present) {
|
|
map['priority'] = Variable<int>(priority.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<String>(createdAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('IfThenRulesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('ifCondition: $ifCondition, ')
|
|
..write('thenAction: $thenAction, ')
|
|
..write('triggerType: $triggerType, ')
|
|
..write('priority: $priority, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $TrackerEntriesTable extends TrackerEntries
|
|
with TableInfo<$TrackerEntriesTable, TrackerEntry> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$TrackerEntriesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) ON DELETE RESTRICT NOT NULL',
|
|
);
|
|
static const VerificationMeta _dateMeta = const VerificationMeta('date');
|
|
@override
|
|
late final GeneratedColumn<String> date = GeneratedColumn<String>(
|
|
'date',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _valueMeta = const VerificationMeta('value');
|
|
@override
|
|
late final GeneratedColumn<String> value = GeneratedColumn<String>(
|
|
'value',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>("value IN ('done','blank')"),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _loggedAtMeta = const VerificationMeta(
|
|
'loggedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> loggedAt = GeneratedColumn<String>(
|
|
'logged_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _noteMeta = const VerificationMeta('note');
|
|
@override
|
|
late final GeneratedColumn<String> note = GeneratedColumn<String>(
|
|
'note',
|
|
aliasedName,
|
|
true,
|
|
check: () =>
|
|
const CustomExpression<bool>("note IS NULL OR length(note) <= 200"),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _variantIdMeta = const VerificationMeta(
|
|
'variantId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> variantId = GeneratedColumn<String>(
|
|
'variant_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints:
|
|
'NULL REFERENCES habit_dose_variants(variant_id) ON DELETE SET NULL',
|
|
);
|
|
static const VerificationMeta _ctxLocationMeta = const VerificationMeta(
|
|
'ctxLocation',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> ctxLocation = GeneratedColumn<String>(
|
|
'ctx_location',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _ctxConditionMeta = const VerificationMeta(
|
|
'ctxCondition',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> ctxCondition = GeneratedColumn<String>(
|
|
'ctx_condition',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
habitId,
|
|
date,
|
|
value,
|
|
loggedAt,
|
|
note,
|
|
variantId,
|
|
ctxLocation,
|
|
ctxCondition,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'tracker_entries';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<TrackerEntry> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('date')) {
|
|
context.handle(
|
|
_dateMeta,
|
|
date.isAcceptableOrUnknown(data['date']!, _dateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dateMeta);
|
|
}
|
|
if (data.containsKey('value')) {
|
|
context.handle(
|
|
_valueMeta,
|
|
value.isAcceptableOrUnknown(data['value']!, _valueMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_valueMeta);
|
|
}
|
|
if (data.containsKey('logged_at')) {
|
|
context.handle(
|
|
_loggedAtMeta,
|
|
loggedAt.isAcceptableOrUnknown(data['logged_at']!, _loggedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('note')) {
|
|
context.handle(
|
|
_noteMeta,
|
|
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('variant_id')) {
|
|
context.handle(
|
|
_variantIdMeta,
|
|
variantId.isAcceptableOrUnknown(data['variant_id']!, _variantIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('ctx_location')) {
|
|
context.handle(
|
|
_ctxLocationMeta,
|
|
ctxLocation.isAcceptableOrUnknown(
|
|
data['ctx_location']!,
|
|
_ctxLocationMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('ctx_condition')) {
|
|
context.handle(
|
|
_ctxConditionMeta,
|
|
ctxCondition.isAcceptableOrUnknown(
|
|
data['ctx_condition']!,
|
|
_ctxConditionMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
TrackerEntry map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return TrackerEntry(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
date: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}date'],
|
|
)!,
|
|
value: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}value'],
|
|
)!,
|
|
loggedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}logged_at'],
|
|
),
|
|
note: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}note'],
|
|
),
|
|
variantId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}variant_id'],
|
|
),
|
|
ctxLocation: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}ctx_location'],
|
|
),
|
|
ctxCondition: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}ctx_condition'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$TrackerEntriesTable createAlias(String alias) {
|
|
return $TrackerEntriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class TrackerEntry extends DataClass implements Insertable<TrackerEntry> {
|
|
final String id;
|
|
final String habitId;
|
|
final String date;
|
|
final String value;
|
|
final String? loggedAt;
|
|
final String? note;
|
|
final String? variantId;
|
|
final String? ctxLocation;
|
|
final String? ctxCondition;
|
|
const TrackerEntry({
|
|
required this.id,
|
|
required this.habitId,
|
|
required this.date,
|
|
required this.value,
|
|
this.loggedAt,
|
|
this.note,
|
|
this.variantId,
|
|
this.ctxLocation,
|
|
this.ctxCondition,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['date'] = Variable<String>(date);
|
|
map['value'] = Variable<String>(value);
|
|
if (!nullToAbsent || loggedAt != null) {
|
|
map['logged_at'] = Variable<String>(loggedAt);
|
|
}
|
|
if (!nullToAbsent || note != null) {
|
|
map['note'] = Variable<String>(note);
|
|
}
|
|
if (!nullToAbsent || variantId != null) {
|
|
map['variant_id'] = Variable<String>(variantId);
|
|
}
|
|
if (!nullToAbsent || ctxLocation != null) {
|
|
map['ctx_location'] = Variable<String>(ctxLocation);
|
|
}
|
|
if (!nullToAbsent || ctxCondition != null) {
|
|
map['ctx_condition'] = Variable<String>(ctxCondition);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
TrackerEntriesCompanion toCompanion(bool nullToAbsent) {
|
|
return TrackerEntriesCompanion(
|
|
id: Value(id),
|
|
habitId: Value(habitId),
|
|
date: Value(date),
|
|
value: Value(value),
|
|
loggedAt: loggedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(loggedAt),
|
|
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
|
|
variantId: variantId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(variantId),
|
|
ctxLocation: ctxLocation == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(ctxLocation),
|
|
ctxCondition: ctxCondition == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(ctxCondition),
|
|
);
|
|
}
|
|
|
|
factory TrackerEntry.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return TrackerEntry(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
date: serializer.fromJson<String>(json['date']),
|
|
value: serializer.fromJson<String>(json['value']),
|
|
loggedAt: serializer.fromJson<String?>(json['loggedAt']),
|
|
note: serializer.fromJson<String?>(json['note']),
|
|
variantId: serializer.fromJson<String?>(json['variantId']),
|
|
ctxLocation: serializer.fromJson<String?>(json['ctxLocation']),
|
|
ctxCondition: serializer.fromJson<String?>(json['ctxCondition']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'date': serializer.toJson<String>(date),
|
|
'value': serializer.toJson<String>(value),
|
|
'loggedAt': serializer.toJson<String?>(loggedAt),
|
|
'note': serializer.toJson<String?>(note),
|
|
'variantId': serializer.toJson<String?>(variantId),
|
|
'ctxLocation': serializer.toJson<String?>(ctxLocation),
|
|
'ctxCondition': serializer.toJson<String?>(ctxCondition),
|
|
};
|
|
}
|
|
|
|
TrackerEntry copyWith({
|
|
String? id,
|
|
String? habitId,
|
|
String? date,
|
|
String? value,
|
|
Value<String?> loggedAt = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> variantId = const Value.absent(),
|
|
Value<String?> ctxLocation = const Value.absent(),
|
|
Value<String?> ctxCondition = const Value.absent(),
|
|
}) => TrackerEntry(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
date: date ?? this.date,
|
|
value: value ?? this.value,
|
|
loggedAt: loggedAt.present ? loggedAt.value : this.loggedAt,
|
|
note: note.present ? note.value : this.note,
|
|
variantId: variantId.present ? variantId.value : this.variantId,
|
|
ctxLocation: ctxLocation.present ? ctxLocation.value : this.ctxLocation,
|
|
ctxCondition: ctxCondition.present ? ctxCondition.value : this.ctxCondition,
|
|
);
|
|
TrackerEntry copyWithCompanion(TrackerEntriesCompanion data) {
|
|
return TrackerEntry(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
date: data.date.present ? data.date.value : this.date,
|
|
value: data.value.present ? data.value.value : this.value,
|
|
loggedAt: data.loggedAt.present ? data.loggedAt.value : this.loggedAt,
|
|
note: data.note.present ? data.note.value : this.note,
|
|
variantId: data.variantId.present ? data.variantId.value : this.variantId,
|
|
ctxLocation: data.ctxLocation.present
|
|
? data.ctxLocation.value
|
|
: this.ctxLocation,
|
|
ctxCondition: data.ctxCondition.present
|
|
? data.ctxCondition.value
|
|
: this.ctxCondition,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TrackerEntry(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('date: $date, ')
|
|
..write('value: $value, ')
|
|
..write('loggedAt: $loggedAt, ')
|
|
..write('note: $note, ')
|
|
..write('variantId: $variantId, ')
|
|
..write('ctxLocation: $ctxLocation, ')
|
|
..write('ctxCondition: $ctxCondition')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
habitId,
|
|
date,
|
|
value,
|
|
loggedAt,
|
|
note,
|
|
variantId,
|
|
ctxLocation,
|
|
ctxCondition,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is TrackerEntry &&
|
|
other.id == this.id &&
|
|
other.habitId == this.habitId &&
|
|
other.date == this.date &&
|
|
other.value == this.value &&
|
|
other.loggedAt == this.loggedAt &&
|
|
other.note == this.note &&
|
|
other.variantId == this.variantId &&
|
|
other.ctxLocation == this.ctxLocation &&
|
|
other.ctxCondition == this.ctxCondition);
|
|
}
|
|
|
|
class TrackerEntriesCompanion extends UpdateCompanion<TrackerEntry> {
|
|
final Value<String> id;
|
|
final Value<String> habitId;
|
|
final Value<String> date;
|
|
final Value<String> value;
|
|
final Value<String?> loggedAt;
|
|
final Value<String?> note;
|
|
final Value<String?> variantId;
|
|
final Value<String?> ctxLocation;
|
|
final Value<String?> ctxCondition;
|
|
final Value<int> rowid;
|
|
const TrackerEntriesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.value = const Value.absent(),
|
|
this.loggedAt = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.variantId = const Value.absent(),
|
|
this.ctxLocation = const Value.absent(),
|
|
this.ctxCondition = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
TrackerEntriesCompanion.insert({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String value,
|
|
this.loggedAt = const Value.absent(),
|
|
this.note = const Value.absent(),
|
|
this.variantId = const Value.absent(),
|
|
this.ctxLocation = const Value.absent(),
|
|
this.ctxCondition = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
habitId = Value(habitId),
|
|
date = Value(date),
|
|
value = Value(value);
|
|
static Insertable<TrackerEntry> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? habitId,
|
|
Expression<String>? date,
|
|
Expression<String>? value,
|
|
Expression<String>? loggedAt,
|
|
Expression<String>? note,
|
|
Expression<String>? variantId,
|
|
Expression<String>? ctxLocation,
|
|
Expression<String>? ctxCondition,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (date != null) 'date': date,
|
|
if (value != null) 'value': value,
|
|
if (loggedAt != null) 'logged_at': loggedAt,
|
|
if (note != null) 'note': note,
|
|
if (variantId != null) 'variant_id': variantId,
|
|
if (ctxLocation != null) 'ctx_location': ctxLocation,
|
|
if (ctxCondition != null) 'ctx_condition': ctxCondition,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
TrackerEntriesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? habitId,
|
|
Value<String>? date,
|
|
Value<String>? value,
|
|
Value<String?>? loggedAt,
|
|
Value<String?>? note,
|
|
Value<String?>? variantId,
|
|
Value<String?>? ctxLocation,
|
|
Value<String?>? ctxCondition,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return TrackerEntriesCompanion(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
date: date ?? this.date,
|
|
value: value ?? this.value,
|
|
loggedAt: loggedAt ?? this.loggedAt,
|
|
note: note ?? this.note,
|
|
variantId: variantId ?? this.variantId,
|
|
ctxLocation: ctxLocation ?? this.ctxLocation,
|
|
ctxCondition: ctxCondition ?? this.ctxCondition,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (date.present) {
|
|
map['date'] = Variable<String>(date.value);
|
|
}
|
|
if (value.present) {
|
|
map['value'] = Variable<String>(value.value);
|
|
}
|
|
if (loggedAt.present) {
|
|
map['logged_at'] = Variable<String>(loggedAt.value);
|
|
}
|
|
if (note.present) {
|
|
map['note'] = Variable<String>(note.value);
|
|
}
|
|
if (variantId.present) {
|
|
map['variant_id'] = Variable<String>(variantId.value);
|
|
}
|
|
if (ctxLocation.present) {
|
|
map['ctx_location'] = Variable<String>(ctxLocation.value);
|
|
}
|
|
if (ctxCondition.present) {
|
|
map['ctx_condition'] = Variable<String>(ctxCondition.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TrackerEntriesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('date: $date, ')
|
|
..write('value: $value, ')
|
|
..write('loggedAt: $loggedAt, ')
|
|
..write('note: $note, ')
|
|
..write('variantId: $variantId, ')
|
|
..write('ctxLocation: $ctxLocation, ')
|
|
..write('ctxCondition: $ctxCondition, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $LapseLogsTable extends LapseLogs
|
|
with TableInfo<$LapseLogsTable, LapseLog> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$LapseLogsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _dateMeta = const VerificationMeta('date');
|
|
@override
|
|
late final GeneratedColumn<String> date = GeneratedColumn<String>(
|
|
'date',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _labelTextMeta = const VerificationMeta(
|
|
'labelText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> labelText = GeneratedColumn<String>(
|
|
'label_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _examineHaltJsonMeta = const VerificationMeta(
|
|
'examineHaltJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> examineHaltJson = GeneratedColumn<String>(
|
|
'examine_halt_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _antecedentJsonMeta = const VerificationMeta(
|
|
'antecedentJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> antecedentJson = GeneratedColumn<String>(
|
|
'antecedent_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _replanMeta = const VerificationMeta('replan');
|
|
@override
|
|
late final GeneratedColumn<String> replan = GeneratedColumn<String>(
|
|
'replan',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nextActionMeta = const VerificationMeta(
|
|
'nextAction',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> nextAction = GeneratedColumn<String>(
|
|
'next_action',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> createdAt = GeneratedColumn<String>(
|
|
'created_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
habitId,
|
|
date,
|
|
labelText,
|
|
examineHaltJson,
|
|
antecedentJson,
|
|
replan,
|
|
nextAction,
|
|
createdAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'lapse_logs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<LapseLog> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('date')) {
|
|
context.handle(
|
|
_dateMeta,
|
|
date.isAcceptableOrUnknown(data['date']!, _dateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dateMeta);
|
|
}
|
|
if (data.containsKey('label_text')) {
|
|
context.handle(
|
|
_labelTextMeta,
|
|
labelText.isAcceptableOrUnknown(data['label_text']!, _labelTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_labelTextMeta);
|
|
}
|
|
if (data.containsKey('examine_halt_json')) {
|
|
context.handle(
|
|
_examineHaltJsonMeta,
|
|
examineHaltJson.isAcceptableOrUnknown(
|
|
data['examine_halt_json']!,
|
|
_examineHaltJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_examineHaltJsonMeta);
|
|
}
|
|
if (data.containsKey('antecedent_json')) {
|
|
context.handle(
|
|
_antecedentJsonMeta,
|
|
antecedentJson.isAcceptableOrUnknown(
|
|
data['antecedent_json']!,
|
|
_antecedentJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_antecedentJsonMeta);
|
|
}
|
|
if (data.containsKey('replan')) {
|
|
context.handle(
|
|
_replanMeta,
|
|
replan.isAcceptableOrUnknown(data['replan']!, _replanMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_replanMeta);
|
|
}
|
|
if (data.containsKey('next_action')) {
|
|
context.handle(
|
|
_nextActionMeta,
|
|
nextAction.isAcceptableOrUnknown(data['next_action']!, _nextActionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nextActionMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
LapseLog map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return LapseLog(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
date: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}date'],
|
|
)!,
|
|
labelText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}label_text'],
|
|
)!,
|
|
examineHaltJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}examine_halt_json'],
|
|
)!,
|
|
antecedentJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}antecedent_json'],
|
|
)!,
|
|
replan: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}replan'],
|
|
)!,
|
|
nextAction: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}next_action'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$LapseLogsTable createAlias(String alias) {
|
|
return $LapseLogsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class LapseLog extends DataClass implements Insertable<LapseLog> {
|
|
final String id;
|
|
final String habitId;
|
|
final String date;
|
|
final String labelText;
|
|
final String examineHaltJson;
|
|
final String antecedentJson;
|
|
final String replan;
|
|
final String nextAction;
|
|
final String? createdAt;
|
|
const LapseLog({
|
|
required this.id,
|
|
required this.habitId,
|
|
required this.date,
|
|
required this.labelText,
|
|
required this.examineHaltJson,
|
|
required this.antecedentJson,
|
|
required this.replan,
|
|
required this.nextAction,
|
|
this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['date'] = Variable<String>(date);
|
|
map['label_text'] = Variable<String>(labelText);
|
|
map['examine_halt_json'] = Variable<String>(examineHaltJson);
|
|
map['antecedent_json'] = Variable<String>(antecedentJson);
|
|
map['replan'] = Variable<String>(replan);
|
|
map['next_action'] = Variable<String>(nextAction);
|
|
if (!nullToAbsent || createdAt != null) {
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
LapseLogsCompanion toCompanion(bool nullToAbsent) {
|
|
return LapseLogsCompanion(
|
|
id: Value(id),
|
|
habitId: Value(habitId),
|
|
date: Value(date),
|
|
labelText: Value(labelText),
|
|
examineHaltJson: Value(examineHaltJson),
|
|
antecedentJson: Value(antecedentJson),
|
|
replan: Value(replan),
|
|
nextAction: Value(nextAction),
|
|
createdAt: createdAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory LapseLog.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return LapseLog(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
date: serializer.fromJson<String>(json['date']),
|
|
labelText: serializer.fromJson<String>(json['labelText']),
|
|
examineHaltJson: serializer.fromJson<String>(json['examineHaltJson']),
|
|
antecedentJson: serializer.fromJson<String>(json['antecedentJson']),
|
|
replan: serializer.fromJson<String>(json['replan']),
|
|
nextAction: serializer.fromJson<String>(json['nextAction']),
|
|
createdAt: serializer.fromJson<String?>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'date': serializer.toJson<String>(date),
|
|
'labelText': serializer.toJson<String>(labelText),
|
|
'examineHaltJson': serializer.toJson<String>(examineHaltJson),
|
|
'antecedentJson': serializer.toJson<String>(antecedentJson),
|
|
'replan': serializer.toJson<String>(replan),
|
|
'nextAction': serializer.toJson<String>(nextAction),
|
|
'createdAt': serializer.toJson<String?>(createdAt),
|
|
};
|
|
}
|
|
|
|
LapseLog copyWith({
|
|
String? id,
|
|
String? habitId,
|
|
String? date,
|
|
String? labelText,
|
|
String? examineHaltJson,
|
|
String? antecedentJson,
|
|
String? replan,
|
|
String? nextAction,
|
|
Value<String?> createdAt = const Value.absent(),
|
|
}) => LapseLog(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
date: date ?? this.date,
|
|
labelText: labelText ?? this.labelText,
|
|
examineHaltJson: examineHaltJson ?? this.examineHaltJson,
|
|
antecedentJson: antecedentJson ?? this.antecedentJson,
|
|
replan: replan ?? this.replan,
|
|
nextAction: nextAction ?? this.nextAction,
|
|
createdAt: createdAt.present ? createdAt.value : this.createdAt,
|
|
);
|
|
LapseLog copyWithCompanion(LapseLogsCompanion data) {
|
|
return LapseLog(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
date: data.date.present ? data.date.value : this.date,
|
|
labelText: data.labelText.present ? data.labelText.value : this.labelText,
|
|
examineHaltJson: data.examineHaltJson.present
|
|
? data.examineHaltJson.value
|
|
: this.examineHaltJson,
|
|
antecedentJson: data.antecedentJson.present
|
|
? data.antecedentJson.value
|
|
: this.antecedentJson,
|
|
replan: data.replan.present ? data.replan.value : this.replan,
|
|
nextAction: data.nextAction.present
|
|
? data.nextAction.value
|
|
: this.nextAction,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('LapseLog(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('date: $date, ')
|
|
..write('labelText: $labelText, ')
|
|
..write('examineHaltJson: $examineHaltJson, ')
|
|
..write('antecedentJson: $antecedentJson, ')
|
|
..write('replan: $replan, ')
|
|
..write('nextAction: $nextAction, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
habitId,
|
|
date,
|
|
labelText,
|
|
examineHaltJson,
|
|
antecedentJson,
|
|
replan,
|
|
nextAction,
|
|
createdAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is LapseLog &&
|
|
other.id == this.id &&
|
|
other.habitId == this.habitId &&
|
|
other.date == this.date &&
|
|
other.labelText == this.labelText &&
|
|
other.examineHaltJson == this.examineHaltJson &&
|
|
other.antecedentJson == this.antecedentJson &&
|
|
other.replan == this.replan &&
|
|
other.nextAction == this.nextAction &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class LapseLogsCompanion extends UpdateCompanion<LapseLog> {
|
|
final Value<String> id;
|
|
final Value<String> habitId;
|
|
final Value<String> date;
|
|
final Value<String> labelText;
|
|
final Value<String> examineHaltJson;
|
|
final Value<String> antecedentJson;
|
|
final Value<String> replan;
|
|
final Value<String> nextAction;
|
|
final Value<String?> createdAt;
|
|
final Value<int> rowid;
|
|
const LapseLogsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.labelText = const Value.absent(),
|
|
this.examineHaltJson = const Value.absent(),
|
|
this.antecedentJson = const Value.absent(),
|
|
this.replan = const Value.absent(),
|
|
this.nextAction = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
LapseLogsCompanion.insert({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String labelText,
|
|
required String examineHaltJson,
|
|
required String antecedentJson,
|
|
required String replan,
|
|
required String nextAction,
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
habitId = Value(habitId),
|
|
date = Value(date),
|
|
labelText = Value(labelText),
|
|
examineHaltJson = Value(examineHaltJson),
|
|
antecedentJson = Value(antecedentJson),
|
|
replan = Value(replan),
|
|
nextAction = Value(nextAction);
|
|
static Insertable<LapseLog> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? habitId,
|
|
Expression<String>? date,
|
|
Expression<String>? labelText,
|
|
Expression<String>? examineHaltJson,
|
|
Expression<String>? antecedentJson,
|
|
Expression<String>? replan,
|
|
Expression<String>? nextAction,
|
|
Expression<String>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (date != null) 'date': date,
|
|
if (labelText != null) 'label_text': labelText,
|
|
if (examineHaltJson != null) 'examine_halt_json': examineHaltJson,
|
|
if (antecedentJson != null) 'antecedent_json': antecedentJson,
|
|
if (replan != null) 'replan': replan,
|
|
if (nextAction != null) 'next_action': nextAction,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
LapseLogsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? habitId,
|
|
Value<String>? date,
|
|
Value<String>? labelText,
|
|
Value<String>? examineHaltJson,
|
|
Value<String>? antecedentJson,
|
|
Value<String>? replan,
|
|
Value<String>? nextAction,
|
|
Value<String?>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return LapseLogsCompanion(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
date: date ?? this.date,
|
|
labelText: labelText ?? this.labelText,
|
|
examineHaltJson: examineHaltJson ?? this.examineHaltJson,
|
|
antecedentJson: antecedentJson ?? this.antecedentJson,
|
|
replan: replan ?? this.replan,
|
|
nextAction: nextAction ?? this.nextAction,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (date.present) {
|
|
map['date'] = Variable<String>(date.value);
|
|
}
|
|
if (labelText.present) {
|
|
map['label_text'] = Variable<String>(labelText.value);
|
|
}
|
|
if (examineHaltJson.present) {
|
|
map['examine_halt_json'] = Variable<String>(examineHaltJson.value);
|
|
}
|
|
if (antecedentJson.present) {
|
|
map['antecedent_json'] = Variable<String>(antecedentJson.value);
|
|
}
|
|
if (replan.present) {
|
|
map['replan'] = Variable<String>(replan.value);
|
|
}
|
|
if (nextAction.present) {
|
|
map['next_action'] = Variable<String>(nextAction.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<String>(createdAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('LapseLogsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('date: $date, ')
|
|
..write('labelText: $labelText, ')
|
|
..write('examineHaltJson: $examineHaltJson, ')
|
|
..write('antecedentJson: $antecedentJson, ')
|
|
..write('replan: $replan, ')
|
|
..write('nextAction: $nextAction, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $UrgeLogsTable extends UrgeLogs with TableInfo<$UrgeLogsTable, UrgeLog> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$UrgeLogsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _occurredAtMeta = const VerificationMeta(
|
|
'occurredAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> occurredAt = GeneratedColumn<String>(
|
|
'occurred_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _intensityBeforeMeta = const VerificationMeta(
|
|
'intensityBefore',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> intensityBefore = GeneratedColumn<int>(
|
|
'intensity_before',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"intensity_before IS NULL OR intensity_before BETWEEN 0 AND 10",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _intensityAfterMeta = const VerificationMeta(
|
|
'intensityAfter',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> intensityAfter = GeneratedColumn<int>(
|
|
'intensity_after',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"intensity_after IS NULL OR intensity_after BETWEEN 0 AND 10",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _durationSecondsMeta = const VerificationMeta(
|
|
'durationSeconds',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> durationSeconds = GeneratedColumn<int>(
|
|
'duration_seconds',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"duration_seconds IS NULL OR duration_seconds >= 0",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _bodyLocationJsonMeta = const VerificationMeta(
|
|
'bodyLocationJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> bodyLocationJson = GeneratedColumn<String>(
|
|
'body_location_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _passedMeta = const VerificationMeta('passed');
|
|
@override
|
|
late final GeneratedColumn<bool> passed = GeneratedColumn<bool>(
|
|
'passed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("passed" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _methodUsedMeta = const VerificationMeta(
|
|
'methodUsed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> methodUsed = GeneratedColumn<String>(
|
|
'method_used',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"method_used IS NULL OR method_used IN ('cyclic_sighing','walk','water','social_contact','if_then_action','other')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
habitId,
|
|
occurredAt,
|
|
intensityBefore,
|
|
intensityAfter,
|
|
durationSeconds,
|
|
bodyLocationJson,
|
|
passed,
|
|
methodUsed,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'urge_logs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<UrgeLog> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('occurred_at')) {
|
|
context.handle(
|
|
_occurredAtMeta,
|
|
occurredAt.isAcceptableOrUnknown(data['occurred_at']!, _occurredAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_occurredAtMeta);
|
|
}
|
|
if (data.containsKey('intensity_before')) {
|
|
context.handle(
|
|
_intensityBeforeMeta,
|
|
intensityBefore.isAcceptableOrUnknown(
|
|
data['intensity_before']!,
|
|
_intensityBeforeMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('intensity_after')) {
|
|
context.handle(
|
|
_intensityAfterMeta,
|
|
intensityAfter.isAcceptableOrUnknown(
|
|
data['intensity_after']!,
|
|
_intensityAfterMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('duration_seconds')) {
|
|
context.handle(
|
|
_durationSecondsMeta,
|
|
durationSeconds.isAcceptableOrUnknown(
|
|
data['duration_seconds']!,
|
|
_durationSecondsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('body_location_json')) {
|
|
context.handle(
|
|
_bodyLocationJsonMeta,
|
|
bodyLocationJson.isAcceptableOrUnknown(
|
|
data['body_location_json']!,
|
|
_bodyLocationJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('passed')) {
|
|
context.handle(
|
|
_passedMeta,
|
|
passed.isAcceptableOrUnknown(data['passed']!, _passedMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_passedMeta);
|
|
}
|
|
if (data.containsKey('method_used')) {
|
|
context.handle(
|
|
_methodUsedMeta,
|
|
methodUsed.isAcceptableOrUnknown(data['method_used']!, _methodUsedMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
UrgeLog map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return UrgeLog(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
occurredAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}occurred_at'],
|
|
)!,
|
|
intensityBefore: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}intensity_before'],
|
|
),
|
|
intensityAfter: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}intensity_after'],
|
|
),
|
|
durationSeconds: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}duration_seconds'],
|
|
),
|
|
bodyLocationJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}body_location_json'],
|
|
),
|
|
passed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}passed'],
|
|
)!,
|
|
methodUsed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}method_used'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$UrgeLogsTable createAlias(String alias) {
|
|
return $UrgeLogsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class UrgeLog extends DataClass implements Insertable<UrgeLog> {
|
|
final String id;
|
|
final String habitId;
|
|
final String occurredAt;
|
|
final int? intensityBefore;
|
|
final int? intensityAfter;
|
|
final int? durationSeconds;
|
|
final String? bodyLocationJson;
|
|
final bool passed;
|
|
final String? methodUsed;
|
|
const UrgeLog({
|
|
required this.id,
|
|
required this.habitId,
|
|
required this.occurredAt,
|
|
this.intensityBefore,
|
|
this.intensityAfter,
|
|
this.durationSeconds,
|
|
this.bodyLocationJson,
|
|
required this.passed,
|
|
this.methodUsed,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['occurred_at'] = Variable<String>(occurredAt);
|
|
if (!nullToAbsent || intensityBefore != null) {
|
|
map['intensity_before'] = Variable<int>(intensityBefore);
|
|
}
|
|
if (!nullToAbsent || intensityAfter != null) {
|
|
map['intensity_after'] = Variable<int>(intensityAfter);
|
|
}
|
|
if (!nullToAbsent || durationSeconds != null) {
|
|
map['duration_seconds'] = Variable<int>(durationSeconds);
|
|
}
|
|
if (!nullToAbsent || bodyLocationJson != null) {
|
|
map['body_location_json'] = Variable<String>(bodyLocationJson);
|
|
}
|
|
map['passed'] = Variable<bool>(passed);
|
|
if (!nullToAbsent || methodUsed != null) {
|
|
map['method_used'] = Variable<String>(methodUsed);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
UrgeLogsCompanion toCompanion(bool nullToAbsent) {
|
|
return UrgeLogsCompanion(
|
|
id: Value(id),
|
|
habitId: Value(habitId),
|
|
occurredAt: Value(occurredAt),
|
|
intensityBefore: intensityBefore == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(intensityBefore),
|
|
intensityAfter: intensityAfter == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(intensityAfter),
|
|
durationSeconds: durationSeconds == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(durationSeconds),
|
|
bodyLocationJson: bodyLocationJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(bodyLocationJson),
|
|
passed: Value(passed),
|
|
methodUsed: methodUsed == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(methodUsed),
|
|
);
|
|
}
|
|
|
|
factory UrgeLog.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return UrgeLog(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
occurredAt: serializer.fromJson<String>(json['occurredAt']),
|
|
intensityBefore: serializer.fromJson<int?>(json['intensityBefore']),
|
|
intensityAfter: serializer.fromJson<int?>(json['intensityAfter']),
|
|
durationSeconds: serializer.fromJson<int?>(json['durationSeconds']),
|
|
bodyLocationJson: serializer.fromJson<String?>(json['bodyLocationJson']),
|
|
passed: serializer.fromJson<bool>(json['passed']),
|
|
methodUsed: serializer.fromJson<String?>(json['methodUsed']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'occurredAt': serializer.toJson<String>(occurredAt),
|
|
'intensityBefore': serializer.toJson<int?>(intensityBefore),
|
|
'intensityAfter': serializer.toJson<int?>(intensityAfter),
|
|
'durationSeconds': serializer.toJson<int?>(durationSeconds),
|
|
'bodyLocationJson': serializer.toJson<String?>(bodyLocationJson),
|
|
'passed': serializer.toJson<bool>(passed),
|
|
'methodUsed': serializer.toJson<String?>(methodUsed),
|
|
};
|
|
}
|
|
|
|
UrgeLog copyWith({
|
|
String? id,
|
|
String? habitId,
|
|
String? occurredAt,
|
|
Value<int?> intensityBefore = const Value.absent(),
|
|
Value<int?> intensityAfter = const Value.absent(),
|
|
Value<int?> durationSeconds = const Value.absent(),
|
|
Value<String?> bodyLocationJson = const Value.absent(),
|
|
bool? passed,
|
|
Value<String?> methodUsed = const Value.absent(),
|
|
}) => UrgeLog(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
occurredAt: occurredAt ?? this.occurredAt,
|
|
intensityBefore: intensityBefore.present
|
|
? intensityBefore.value
|
|
: this.intensityBefore,
|
|
intensityAfter: intensityAfter.present
|
|
? intensityAfter.value
|
|
: this.intensityAfter,
|
|
durationSeconds: durationSeconds.present
|
|
? durationSeconds.value
|
|
: this.durationSeconds,
|
|
bodyLocationJson: bodyLocationJson.present
|
|
? bodyLocationJson.value
|
|
: this.bodyLocationJson,
|
|
passed: passed ?? this.passed,
|
|
methodUsed: methodUsed.present ? methodUsed.value : this.methodUsed,
|
|
);
|
|
UrgeLog copyWithCompanion(UrgeLogsCompanion data) {
|
|
return UrgeLog(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
occurredAt: data.occurredAt.present
|
|
? data.occurredAt.value
|
|
: this.occurredAt,
|
|
intensityBefore: data.intensityBefore.present
|
|
? data.intensityBefore.value
|
|
: this.intensityBefore,
|
|
intensityAfter: data.intensityAfter.present
|
|
? data.intensityAfter.value
|
|
: this.intensityAfter,
|
|
durationSeconds: data.durationSeconds.present
|
|
? data.durationSeconds.value
|
|
: this.durationSeconds,
|
|
bodyLocationJson: data.bodyLocationJson.present
|
|
? data.bodyLocationJson.value
|
|
: this.bodyLocationJson,
|
|
passed: data.passed.present ? data.passed.value : this.passed,
|
|
methodUsed: data.methodUsed.present
|
|
? data.methodUsed.value
|
|
: this.methodUsed,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('UrgeLog(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('occurredAt: $occurredAt, ')
|
|
..write('intensityBefore: $intensityBefore, ')
|
|
..write('intensityAfter: $intensityAfter, ')
|
|
..write('durationSeconds: $durationSeconds, ')
|
|
..write('bodyLocationJson: $bodyLocationJson, ')
|
|
..write('passed: $passed, ')
|
|
..write('methodUsed: $methodUsed')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
habitId,
|
|
occurredAt,
|
|
intensityBefore,
|
|
intensityAfter,
|
|
durationSeconds,
|
|
bodyLocationJson,
|
|
passed,
|
|
methodUsed,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is UrgeLog &&
|
|
other.id == this.id &&
|
|
other.habitId == this.habitId &&
|
|
other.occurredAt == this.occurredAt &&
|
|
other.intensityBefore == this.intensityBefore &&
|
|
other.intensityAfter == this.intensityAfter &&
|
|
other.durationSeconds == this.durationSeconds &&
|
|
other.bodyLocationJson == this.bodyLocationJson &&
|
|
other.passed == this.passed &&
|
|
other.methodUsed == this.methodUsed);
|
|
}
|
|
|
|
class UrgeLogsCompanion extends UpdateCompanion<UrgeLog> {
|
|
final Value<String> id;
|
|
final Value<String> habitId;
|
|
final Value<String> occurredAt;
|
|
final Value<int?> intensityBefore;
|
|
final Value<int?> intensityAfter;
|
|
final Value<int?> durationSeconds;
|
|
final Value<String?> bodyLocationJson;
|
|
final Value<bool> passed;
|
|
final Value<String?> methodUsed;
|
|
final Value<int> rowid;
|
|
const UrgeLogsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.occurredAt = const Value.absent(),
|
|
this.intensityBefore = const Value.absent(),
|
|
this.intensityAfter = const Value.absent(),
|
|
this.durationSeconds = const Value.absent(),
|
|
this.bodyLocationJson = const Value.absent(),
|
|
this.passed = const Value.absent(),
|
|
this.methodUsed = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
UrgeLogsCompanion.insert({
|
|
required String id,
|
|
required String habitId,
|
|
required String occurredAt,
|
|
this.intensityBefore = const Value.absent(),
|
|
this.intensityAfter = const Value.absent(),
|
|
this.durationSeconds = const Value.absent(),
|
|
this.bodyLocationJson = const Value.absent(),
|
|
required bool passed,
|
|
this.methodUsed = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
habitId = Value(habitId),
|
|
occurredAt = Value(occurredAt),
|
|
passed = Value(passed);
|
|
static Insertable<UrgeLog> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? habitId,
|
|
Expression<String>? occurredAt,
|
|
Expression<int>? intensityBefore,
|
|
Expression<int>? intensityAfter,
|
|
Expression<int>? durationSeconds,
|
|
Expression<String>? bodyLocationJson,
|
|
Expression<bool>? passed,
|
|
Expression<String>? methodUsed,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (occurredAt != null) 'occurred_at': occurredAt,
|
|
if (intensityBefore != null) 'intensity_before': intensityBefore,
|
|
if (intensityAfter != null) 'intensity_after': intensityAfter,
|
|
if (durationSeconds != null) 'duration_seconds': durationSeconds,
|
|
if (bodyLocationJson != null) 'body_location_json': bodyLocationJson,
|
|
if (passed != null) 'passed': passed,
|
|
if (methodUsed != null) 'method_used': methodUsed,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
UrgeLogsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? habitId,
|
|
Value<String>? occurredAt,
|
|
Value<int?>? intensityBefore,
|
|
Value<int?>? intensityAfter,
|
|
Value<int?>? durationSeconds,
|
|
Value<String?>? bodyLocationJson,
|
|
Value<bool>? passed,
|
|
Value<String?>? methodUsed,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return UrgeLogsCompanion(
|
|
id: id ?? this.id,
|
|
habitId: habitId ?? this.habitId,
|
|
occurredAt: occurredAt ?? this.occurredAt,
|
|
intensityBefore: intensityBefore ?? this.intensityBefore,
|
|
intensityAfter: intensityAfter ?? this.intensityAfter,
|
|
durationSeconds: durationSeconds ?? this.durationSeconds,
|
|
bodyLocationJson: bodyLocationJson ?? this.bodyLocationJson,
|
|
passed: passed ?? this.passed,
|
|
methodUsed: methodUsed ?? this.methodUsed,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (occurredAt.present) {
|
|
map['occurred_at'] = Variable<String>(occurredAt.value);
|
|
}
|
|
if (intensityBefore.present) {
|
|
map['intensity_before'] = Variable<int>(intensityBefore.value);
|
|
}
|
|
if (intensityAfter.present) {
|
|
map['intensity_after'] = Variable<int>(intensityAfter.value);
|
|
}
|
|
if (durationSeconds.present) {
|
|
map['duration_seconds'] = Variable<int>(durationSeconds.value);
|
|
}
|
|
if (bodyLocationJson.present) {
|
|
map['body_location_json'] = Variable<String>(bodyLocationJson.value);
|
|
}
|
|
if (passed.present) {
|
|
map['passed'] = Variable<bool>(passed.value);
|
|
}
|
|
if (methodUsed.present) {
|
|
map['method_used'] = Variable<String>(methodUsed.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('UrgeLogsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('occurredAt: $occurredAt, ')
|
|
..write('intensityBefore: $intensityBefore, ')
|
|
..write('intensityAfter: $intensityAfter, ')
|
|
..write('durationSeconds: $durationSeconds, ')
|
|
..write('bodyLocationJson: $bodyLocationJson, ')
|
|
..write('passed: $passed, ')
|
|
..write('methodUsed: $methodUsed, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $RewardDeclarationsTable extends RewardDeclarations
|
|
with TableInfo<$RewardDeclarationsTable, RewardDeclaration> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$RewardDeclarationsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _phaseIdMeta = const VerificationMeta(
|
|
'phaseId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> phaseId = GeneratedColumn<String>(
|
|
'phase_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES phases(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _habitIdMeta = const VerificationMeta(
|
|
'habitId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> habitId = GeneratedColumn<String>(
|
|
'habit_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES habits(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _tierMeta = const VerificationMeta('tier');
|
|
@override
|
|
late final GeneratedColumn<String> tier = GeneratedColumn<String>(
|
|
'tier',
|
|
aliasedName,
|
|
false,
|
|
check: () =>
|
|
const CustomExpression<bool>("tier IN ('T0','T1','T2','T3','T4')"),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _milestoneRuleMeta = const VerificationMeta(
|
|
'milestoneRule',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> milestoneRule = GeneratedColumn<String>(
|
|
'milestone_rule',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _milestoneMachineRuleJsonMeta =
|
|
const VerificationMeta('milestoneMachineRuleJson');
|
|
@override
|
|
late final GeneratedColumn<String> milestoneMachineRuleJson =
|
|
GeneratedColumn<String>(
|
|
'milestone_machine_rule_json',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _rewardTextMeta = const VerificationMeta(
|
|
'rewardText',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> rewardText = GeneratedColumn<String>(
|
|
'reward_text',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _rewardMenuItemIdMeta = const VerificationMeta(
|
|
'rewardMenuItemId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> rewardMenuItemId = GeneratedColumn<String>(
|
|
'reward_menu_item_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints: 'NULL REFERENCES reward_menu_items(id)',
|
|
);
|
|
static const VerificationMeta _estimatedCostKrwMeta = const VerificationMeta(
|
|
'estimatedCostKrw',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> estimatedCostKrw = GeneratedColumn<int>(
|
|
'estimated_cost_krw',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"estimated_cost_krw IS NULL OR estimated_cost_krw >= 0",
|
|
),
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isEffortTiedMeta = const VerificationMeta(
|
|
'isEffortTied',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isEffortTied = GeneratedColumn<bool>(
|
|
'is_effort_tied',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_effort_tied" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _declaredAtMeta = const VerificationMeta(
|
|
'declaredAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> declaredAt = GeneratedColumn<String>(
|
|
'declared_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
phaseId,
|
|
habitId,
|
|
tier,
|
|
milestoneRule,
|
|
milestoneMachineRuleJson,
|
|
rewardText,
|
|
rewardMenuItemId,
|
|
estimatedCostKrw,
|
|
isEffortTied,
|
|
declaredAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'reward_declarations';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<RewardDeclaration> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('phase_id')) {
|
|
context.handle(
|
|
_phaseIdMeta,
|
|
phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_phaseIdMeta);
|
|
}
|
|
if (data.containsKey('habit_id')) {
|
|
context.handle(
|
|
_habitIdMeta,
|
|
habitId.isAcceptableOrUnknown(data['habit_id']!, _habitIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_habitIdMeta);
|
|
}
|
|
if (data.containsKey('tier')) {
|
|
context.handle(
|
|
_tierMeta,
|
|
tier.isAcceptableOrUnknown(data['tier']!, _tierMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_tierMeta);
|
|
}
|
|
if (data.containsKey('milestone_rule')) {
|
|
context.handle(
|
|
_milestoneRuleMeta,
|
|
milestoneRule.isAcceptableOrUnknown(
|
|
data['milestone_rule']!,
|
|
_milestoneRuleMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_milestoneRuleMeta);
|
|
}
|
|
if (data.containsKey('milestone_machine_rule_json')) {
|
|
context.handle(
|
|
_milestoneMachineRuleJsonMeta,
|
|
milestoneMachineRuleJson.isAcceptableOrUnknown(
|
|
data['milestone_machine_rule_json']!,
|
|
_milestoneMachineRuleJsonMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reward_text')) {
|
|
context.handle(
|
|
_rewardTextMeta,
|
|
rewardText.isAcceptableOrUnknown(data['reward_text']!, _rewardTextMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_rewardTextMeta);
|
|
}
|
|
if (data.containsKey('reward_menu_item_id')) {
|
|
context.handle(
|
|
_rewardMenuItemIdMeta,
|
|
rewardMenuItemId.isAcceptableOrUnknown(
|
|
data['reward_menu_item_id']!,
|
|
_rewardMenuItemIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('estimated_cost_krw')) {
|
|
context.handle(
|
|
_estimatedCostKrwMeta,
|
|
estimatedCostKrw.isAcceptableOrUnknown(
|
|
data['estimated_cost_krw']!,
|
|
_estimatedCostKrwMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_effort_tied')) {
|
|
context.handle(
|
|
_isEffortTiedMeta,
|
|
isEffortTied.isAcceptableOrUnknown(
|
|
data['is_effort_tied']!,
|
|
_isEffortTiedMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('declared_at')) {
|
|
context.handle(
|
|
_declaredAtMeta,
|
|
declaredAt.isAcceptableOrUnknown(data['declared_at']!, _declaredAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_declaredAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
RewardDeclaration map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return RewardDeclaration(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
phaseId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}phase_id'],
|
|
)!,
|
|
habitId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}habit_id'],
|
|
)!,
|
|
tier: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tier'],
|
|
)!,
|
|
milestoneRule: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}milestone_rule'],
|
|
)!,
|
|
milestoneMachineRuleJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}milestone_machine_rule_json'],
|
|
),
|
|
rewardText: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reward_text'],
|
|
)!,
|
|
rewardMenuItemId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reward_menu_item_id'],
|
|
),
|
|
estimatedCostKrw: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}estimated_cost_krw'],
|
|
),
|
|
isEffortTied: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_effort_tied'],
|
|
),
|
|
declaredAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}declared_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$RewardDeclarationsTable createAlias(String alias) {
|
|
return $RewardDeclarationsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class RewardDeclaration extends DataClass
|
|
implements Insertable<RewardDeclaration> {
|
|
final String id;
|
|
final String phaseId;
|
|
final String habitId;
|
|
final String tier;
|
|
final String milestoneRule;
|
|
final String? milestoneMachineRuleJson;
|
|
final String rewardText;
|
|
final String? rewardMenuItemId;
|
|
final int? estimatedCostKrw;
|
|
final bool? isEffortTied;
|
|
final String declaredAt;
|
|
const RewardDeclaration({
|
|
required this.id,
|
|
required this.phaseId,
|
|
required this.habitId,
|
|
required this.tier,
|
|
required this.milestoneRule,
|
|
this.milestoneMachineRuleJson,
|
|
required this.rewardText,
|
|
this.rewardMenuItemId,
|
|
this.estimatedCostKrw,
|
|
this.isEffortTied,
|
|
required this.declaredAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['phase_id'] = Variable<String>(phaseId);
|
|
map['habit_id'] = Variable<String>(habitId);
|
|
map['tier'] = Variable<String>(tier);
|
|
map['milestone_rule'] = Variable<String>(milestoneRule);
|
|
if (!nullToAbsent || milestoneMachineRuleJson != null) {
|
|
map['milestone_machine_rule_json'] = Variable<String>(
|
|
milestoneMachineRuleJson,
|
|
);
|
|
}
|
|
map['reward_text'] = Variable<String>(rewardText);
|
|
if (!nullToAbsent || rewardMenuItemId != null) {
|
|
map['reward_menu_item_id'] = Variable<String>(rewardMenuItemId);
|
|
}
|
|
if (!nullToAbsent || estimatedCostKrw != null) {
|
|
map['estimated_cost_krw'] = Variable<int>(estimatedCostKrw);
|
|
}
|
|
if (!nullToAbsent || isEffortTied != null) {
|
|
map['is_effort_tied'] = Variable<bool>(isEffortTied);
|
|
}
|
|
map['declared_at'] = Variable<String>(declaredAt);
|
|
return map;
|
|
}
|
|
|
|
RewardDeclarationsCompanion toCompanion(bool nullToAbsent) {
|
|
return RewardDeclarationsCompanion(
|
|
id: Value(id),
|
|
phaseId: Value(phaseId),
|
|
habitId: Value(habitId),
|
|
tier: Value(tier),
|
|
milestoneRule: Value(milestoneRule),
|
|
milestoneMachineRuleJson: milestoneMachineRuleJson == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(milestoneMachineRuleJson),
|
|
rewardText: Value(rewardText),
|
|
rewardMenuItemId: rewardMenuItemId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(rewardMenuItemId),
|
|
estimatedCostKrw: estimatedCostKrw == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(estimatedCostKrw),
|
|
isEffortTied: isEffortTied == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(isEffortTied),
|
|
declaredAt: Value(declaredAt),
|
|
);
|
|
}
|
|
|
|
factory RewardDeclaration.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return RewardDeclaration(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
phaseId: serializer.fromJson<String>(json['phaseId']),
|
|
habitId: serializer.fromJson<String>(json['habitId']),
|
|
tier: serializer.fromJson<String>(json['tier']),
|
|
milestoneRule: serializer.fromJson<String>(json['milestoneRule']),
|
|
milestoneMachineRuleJson: serializer.fromJson<String?>(
|
|
json['milestoneMachineRuleJson'],
|
|
),
|
|
rewardText: serializer.fromJson<String>(json['rewardText']),
|
|
rewardMenuItemId: serializer.fromJson<String?>(json['rewardMenuItemId']),
|
|
estimatedCostKrw: serializer.fromJson<int?>(json['estimatedCostKrw']),
|
|
isEffortTied: serializer.fromJson<bool?>(json['isEffortTied']),
|
|
declaredAt: serializer.fromJson<String>(json['declaredAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'phaseId': serializer.toJson<String>(phaseId),
|
|
'habitId': serializer.toJson<String>(habitId),
|
|
'tier': serializer.toJson<String>(tier),
|
|
'milestoneRule': serializer.toJson<String>(milestoneRule),
|
|
'milestoneMachineRuleJson': serializer.toJson<String?>(
|
|
milestoneMachineRuleJson,
|
|
),
|
|
'rewardText': serializer.toJson<String>(rewardText),
|
|
'rewardMenuItemId': serializer.toJson<String?>(rewardMenuItemId),
|
|
'estimatedCostKrw': serializer.toJson<int?>(estimatedCostKrw),
|
|
'isEffortTied': serializer.toJson<bool?>(isEffortTied),
|
|
'declaredAt': serializer.toJson<String>(declaredAt),
|
|
};
|
|
}
|
|
|
|
RewardDeclaration copyWith({
|
|
String? id,
|
|
String? phaseId,
|
|
String? habitId,
|
|
String? tier,
|
|
String? milestoneRule,
|
|
Value<String?> milestoneMachineRuleJson = const Value.absent(),
|
|
String? rewardText,
|
|
Value<String?> rewardMenuItemId = const Value.absent(),
|
|
Value<int?> estimatedCostKrw = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
String? declaredAt,
|
|
}) => RewardDeclaration(
|
|
id: id ?? this.id,
|
|
phaseId: phaseId ?? this.phaseId,
|
|
habitId: habitId ?? this.habitId,
|
|
tier: tier ?? this.tier,
|
|
milestoneRule: milestoneRule ?? this.milestoneRule,
|
|
milestoneMachineRuleJson: milestoneMachineRuleJson.present
|
|
? milestoneMachineRuleJson.value
|
|
: this.milestoneMachineRuleJson,
|
|
rewardText: rewardText ?? this.rewardText,
|
|
rewardMenuItemId: rewardMenuItemId.present
|
|
? rewardMenuItemId.value
|
|
: this.rewardMenuItemId,
|
|
estimatedCostKrw: estimatedCostKrw.present
|
|
? estimatedCostKrw.value
|
|
: this.estimatedCostKrw,
|
|
isEffortTied: isEffortTied.present ? isEffortTied.value : this.isEffortTied,
|
|
declaredAt: declaredAt ?? this.declaredAt,
|
|
);
|
|
RewardDeclaration copyWithCompanion(RewardDeclarationsCompanion data) {
|
|
return RewardDeclaration(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId,
|
|
habitId: data.habitId.present ? data.habitId.value : this.habitId,
|
|
tier: data.tier.present ? data.tier.value : this.tier,
|
|
milestoneRule: data.milestoneRule.present
|
|
? data.milestoneRule.value
|
|
: this.milestoneRule,
|
|
milestoneMachineRuleJson: data.milestoneMachineRuleJson.present
|
|
? data.milestoneMachineRuleJson.value
|
|
: this.milestoneMachineRuleJson,
|
|
rewardText: data.rewardText.present
|
|
? data.rewardText.value
|
|
: this.rewardText,
|
|
rewardMenuItemId: data.rewardMenuItemId.present
|
|
? data.rewardMenuItemId.value
|
|
: this.rewardMenuItemId,
|
|
estimatedCostKrw: data.estimatedCostKrw.present
|
|
? data.estimatedCostKrw.value
|
|
: this.estimatedCostKrw,
|
|
isEffortTied: data.isEffortTied.present
|
|
? data.isEffortTied.value
|
|
: this.isEffortTied,
|
|
declaredAt: data.declaredAt.present
|
|
? data.declaredAt.value
|
|
: this.declaredAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardDeclaration(')
|
|
..write('id: $id, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('tier: $tier, ')
|
|
..write('milestoneRule: $milestoneRule, ')
|
|
..write('milestoneMachineRuleJson: $milestoneMachineRuleJson, ')
|
|
..write('rewardText: $rewardText, ')
|
|
..write('rewardMenuItemId: $rewardMenuItemId, ')
|
|
..write('estimatedCostKrw: $estimatedCostKrw, ')
|
|
..write('isEffortTied: $isEffortTied, ')
|
|
..write('declaredAt: $declaredAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
phaseId,
|
|
habitId,
|
|
tier,
|
|
milestoneRule,
|
|
milestoneMachineRuleJson,
|
|
rewardText,
|
|
rewardMenuItemId,
|
|
estimatedCostKrw,
|
|
isEffortTied,
|
|
declaredAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is RewardDeclaration &&
|
|
other.id == this.id &&
|
|
other.phaseId == this.phaseId &&
|
|
other.habitId == this.habitId &&
|
|
other.tier == this.tier &&
|
|
other.milestoneRule == this.milestoneRule &&
|
|
other.milestoneMachineRuleJson == this.milestoneMachineRuleJson &&
|
|
other.rewardText == this.rewardText &&
|
|
other.rewardMenuItemId == this.rewardMenuItemId &&
|
|
other.estimatedCostKrw == this.estimatedCostKrw &&
|
|
other.isEffortTied == this.isEffortTied &&
|
|
other.declaredAt == this.declaredAt);
|
|
}
|
|
|
|
class RewardDeclarationsCompanion extends UpdateCompanion<RewardDeclaration> {
|
|
final Value<String> id;
|
|
final Value<String> phaseId;
|
|
final Value<String> habitId;
|
|
final Value<String> tier;
|
|
final Value<String> milestoneRule;
|
|
final Value<String?> milestoneMachineRuleJson;
|
|
final Value<String> rewardText;
|
|
final Value<String?> rewardMenuItemId;
|
|
final Value<int?> estimatedCostKrw;
|
|
final Value<bool?> isEffortTied;
|
|
final Value<String> declaredAt;
|
|
final Value<int> rowid;
|
|
const RewardDeclarationsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.phaseId = const Value.absent(),
|
|
this.habitId = const Value.absent(),
|
|
this.tier = const Value.absent(),
|
|
this.milestoneRule = const Value.absent(),
|
|
this.milestoneMachineRuleJson = const Value.absent(),
|
|
this.rewardText = const Value.absent(),
|
|
this.rewardMenuItemId = const Value.absent(),
|
|
this.estimatedCostKrw = const Value.absent(),
|
|
this.isEffortTied = const Value.absent(),
|
|
this.declaredAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
RewardDeclarationsCompanion.insert({
|
|
required String id,
|
|
required String phaseId,
|
|
required String habitId,
|
|
required String tier,
|
|
required String milestoneRule,
|
|
this.milestoneMachineRuleJson = const Value.absent(),
|
|
required String rewardText,
|
|
this.rewardMenuItemId = const Value.absent(),
|
|
this.estimatedCostKrw = const Value.absent(),
|
|
this.isEffortTied = const Value.absent(),
|
|
required String declaredAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
phaseId = Value(phaseId),
|
|
habitId = Value(habitId),
|
|
tier = Value(tier),
|
|
milestoneRule = Value(milestoneRule),
|
|
rewardText = Value(rewardText),
|
|
declaredAt = Value(declaredAt);
|
|
static Insertable<RewardDeclaration> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? phaseId,
|
|
Expression<String>? habitId,
|
|
Expression<String>? tier,
|
|
Expression<String>? milestoneRule,
|
|
Expression<String>? milestoneMachineRuleJson,
|
|
Expression<String>? rewardText,
|
|
Expression<String>? rewardMenuItemId,
|
|
Expression<int>? estimatedCostKrw,
|
|
Expression<bool>? isEffortTied,
|
|
Expression<String>? declaredAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (phaseId != null) 'phase_id': phaseId,
|
|
if (habitId != null) 'habit_id': habitId,
|
|
if (tier != null) 'tier': tier,
|
|
if (milestoneRule != null) 'milestone_rule': milestoneRule,
|
|
if (milestoneMachineRuleJson != null)
|
|
'milestone_machine_rule_json': milestoneMachineRuleJson,
|
|
if (rewardText != null) 'reward_text': rewardText,
|
|
if (rewardMenuItemId != null) 'reward_menu_item_id': rewardMenuItemId,
|
|
if (estimatedCostKrw != null) 'estimated_cost_krw': estimatedCostKrw,
|
|
if (isEffortTied != null) 'is_effort_tied': isEffortTied,
|
|
if (declaredAt != null) 'declared_at': declaredAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
RewardDeclarationsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? phaseId,
|
|
Value<String>? habitId,
|
|
Value<String>? tier,
|
|
Value<String>? milestoneRule,
|
|
Value<String?>? milestoneMachineRuleJson,
|
|
Value<String>? rewardText,
|
|
Value<String?>? rewardMenuItemId,
|
|
Value<int?>? estimatedCostKrw,
|
|
Value<bool?>? isEffortTied,
|
|
Value<String>? declaredAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return RewardDeclarationsCompanion(
|
|
id: id ?? this.id,
|
|
phaseId: phaseId ?? this.phaseId,
|
|
habitId: habitId ?? this.habitId,
|
|
tier: tier ?? this.tier,
|
|
milestoneRule: milestoneRule ?? this.milestoneRule,
|
|
milestoneMachineRuleJson:
|
|
milestoneMachineRuleJson ?? this.milestoneMachineRuleJson,
|
|
rewardText: rewardText ?? this.rewardText,
|
|
rewardMenuItemId: rewardMenuItemId ?? this.rewardMenuItemId,
|
|
estimatedCostKrw: estimatedCostKrw ?? this.estimatedCostKrw,
|
|
isEffortTied: isEffortTied ?? this.isEffortTied,
|
|
declaredAt: declaredAt ?? this.declaredAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (phaseId.present) {
|
|
map['phase_id'] = Variable<String>(phaseId.value);
|
|
}
|
|
if (habitId.present) {
|
|
map['habit_id'] = Variable<String>(habitId.value);
|
|
}
|
|
if (tier.present) {
|
|
map['tier'] = Variable<String>(tier.value);
|
|
}
|
|
if (milestoneRule.present) {
|
|
map['milestone_rule'] = Variable<String>(milestoneRule.value);
|
|
}
|
|
if (milestoneMachineRuleJson.present) {
|
|
map['milestone_machine_rule_json'] = Variable<String>(
|
|
milestoneMachineRuleJson.value,
|
|
);
|
|
}
|
|
if (rewardText.present) {
|
|
map['reward_text'] = Variable<String>(rewardText.value);
|
|
}
|
|
if (rewardMenuItemId.present) {
|
|
map['reward_menu_item_id'] = Variable<String>(rewardMenuItemId.value);
|
|
}
|
|
if (estimatedCostKrw.present) {
|
|
map['estimated_cost_krw'] = Variable<int>(estimatedCostKrw.value);
|
|
}
|
|
if (isEffortTied.present) {
|
|
map['is_effort_tied'] = Variable<bool>(isEffortTied.value);
|
|
}
|
|
if (declaredAt.present) {
|
|
map['declared_at'] = Variable<String>(declaredAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardDeclarationsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('habitId: $habitId, ')
|
|
..write('tier: $tier, ')
|
|
..write('milestoneRule: $milestoneRule, ')
|
|
..write('milestoneMachineRuleJson: $milestoneMachineRuleJson, ')
|
|
..write('rewardText: $rewardText, ')
|
|
..write('rewardMenuItemId: $rewardMenuItemId, ')
|
|
..write('estimatedCostKrw: $estimatedCostKrw, ')
|
|
..write('isEffortTied: $isEffortTied, ')
|
|
..write('declaredAt: $declaredAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $RewardClaimsTable extends RewardClaims
|
|
with TableInfo<$RewardClaimsTable, RewardClaim> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$RewardClaimsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _declarationIdMeta = const VerificationMeta(
|
|
'declarationId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> declarationId = GeneratedColumn<String>(
|
|
'declaration_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES reward_declarations(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _milestoneReachedAtMeta =
|
|
const VerificationMeta('milestoneReachedAt');
|
|
@override
|
|
late final GeneratedColumn<String> milestoneReachedAt =
|
|
GeneratedColumn<String>(
|
|
'milestone_reached_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _fulfilledMeta = const VerificationMeta(
|
|
'fulfilled',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> fulfilled = GeneratedColumn<bool>(
|
|
'fulfilled',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("fulfilled" IN (0, 1))',
|
|
),
|
|
);
|
|
static const VerificationMeta _fulfilledAtMeta = const VerificationMeta(
|
|
'fulfilledAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> fulfilledAt = GeneratedColumn<String>(
|
|
'fulfilled_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _reflectionMeta = const VerificationMeta(
|
|
'reflection',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> reflection = GeneratedColumn<String>(
|
|
'reflection',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"reflection IS NULL OR length(reflection) <= 500",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
declarationId,
|
|
milestoneReachedAt,
|
|
fulfilled,
|
|
fulfilledAt,
|
|
reflection,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'reward_claims';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<RewardClaim> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('declaration_id')) {
|
|
context.handle(
|
|
_declarationIdMeta,
|
|
declarationId.isAcceptableOrUnknown(
|
|
data['declaration_id']!,
|
|
_declarationIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_declarationIdMeta);
|
|
}
|
|
if (data.containsKey('milestone_reached_at')) {
|
|
context.handle(
|
|
_milestoneReachedAtMeta,
|
|
milestoneReachedAt.isAcceptableOrUnknown(
|
|
data['milestone_reached_at']!,
|
|
_milestoneReachedAtMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_milestoneReachedAtMeta);
|
|
}
|
|
if (data.containsKey('fulfilled')) {
|
|
context.handle(
|
|
_fulfilledMeta,
|
|
fulfilled.isAcceptableOrUnknown(data['fulfilled']!, _fulfilledMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_fulfilledMeta);
|
|
}
|
|
if (data.containsKey('fulfilled_at')) {
|
|
context.handle(
|
|
_fulfilledAtMeta,
|
|
fulfilledAt.isAcceptableOrUnknown(
|
|
data['fulfilled_at']!,
|
|
_fulfilledAtMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('reflection')) {
|
|
context.handle(
|
|
_reflectionMeta,
|
|
reflection.isAcceptableOrUnknown(data['reflection']!, _reflectionMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
RewardClaim map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return RewardClaim(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
declarationId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}declaration_id'],
|
|
)!,
|
|
milestoneReachedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}milestone_reached_at'],
|
|
)!,
|
|
fulfilled: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}fulfilled'],
|
|
)!,
|
|
fulfilledAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}fulfilled_at'],
|
|
),
|
|
reflection: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}reflection'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$RewardClaimsTable createAlias(String alias) {
|
|
return $RewardClaimsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class RewardClaim extends DataClass implements Insertable<RewardClaim> {
|
|
final String id;
|
|
final String declarationId;
|
|
final String milestoneReachedAt;
|
|
final bool fulfilled;
|
|
final String? fulfilledAt;
|
|
final String? reflection;
|
|
const RewardClaim({
|
|
required this.id,
|
|
required this.declarationId,
|
|
required this.milestoneReachedAt,
|
|
required this.fulfilled,
|
|
this.fulfilledAt,
|
|
this.reflection,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['declaration_id'] = Variable<String>(declarationId);
|
|
map['milestone_reached_at'] = Variable<String>(milestoneReachedAt);
|
|
map['fulfilled'] = Variable<bool>(fulfilled);
|
|
if (!nullToAbsent || fulfilledAt != null) {
|
|
map['fulfilled_at'] = Variable<String>(fulfilledAt);
|
|
}
|
|
if (!nullToAbsent || reflection != null) {
|
|
map['reflection'] = Variable<String>(reflection);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
RewardClaimsCompanion toCompanion(bool nullToAbsent) {
|
|
return RewardClaimsCompanion(
|
|
id: Value(id),
|
|
declarationId: Value(declarationId),
|
|
milestoneReachedAt: Value(milestoneReachedAt),
|
|
fulfilled: Value(fulfilled),
|
|
fulfilledAt: fulfilledAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(fulfilledAt),
|
|
reflection: reflection == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(reflection),
|
|
);
|
|
}
|
|
|
|
factory RewardClaim.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return RewardClaim(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
declarationId: serializer.fromJson<String>(json['declarationId']),
|
|
milestoneReachedAt: serializer.fromJson<String>(
|
|
json['milestoneReachedAt'],
|
|
),
|
|
fulfilled: serializer.fromJson<bool>(json['fulfilled']),
|
|
fulfilledAt: serializer.fromJson<String?>(json['fulfilledAt']),
|
|
reflection: serializer.fromJson<String?>(json['reflection']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'declarationId': serializer.toJson<String>(declarationId),
|
|
'milestoneReachedAt': serializer.toJson<String>(milestoneReachedAt),
|
|
'fulfilled': serializer.toJson<bool>(fulfilled),
|
|
'fulfilledAt': serializer.toJson<String?>(fulfilledAt),
|
|
'reflection': serializer.toJson<String?>(reflection),
|
|
};
|
|
}
|
|
|
|
RewardClaim copyWith({
|
|
String? id,
|
|
String? declarationId,
|
|
String? milestoneReachedAt,
|
|
bool? fulfilled,
|
|
Value<String?> fulfilledAt = const Value.absent(),
|
|
Value<String?> reflection = const Value.absent(),
|
|
}) => RewardClaim(
|
|
id: id ?? this.id,
|
|
declarationId: declarationId ?? this.declarationId,
|
|
milestoneReachedAt: milestoneReachedAt ?? this.milestoneReachedAt,
|
|
fulfilled: fulfilled ?? this.fulfilled,
|
|
fulfilledAt: fulfilledAt.present ? fulfilledAt.value : this.fulfilledAt,
|
|
reflection: reflection.present ? reflection.value : this.reflection,
|
|
);
|
|
RewardClaim copyWithCompanion(RewardClaimsCompanion data) {
|
|
return RewardClaim(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
declarationId: data.declarationId.present
|
|
? data.declarationId.value
|
|
: this.declarationId,
|
|
milestoneReachedAt: data.milestoneReachedAt.present
|
|
? data.milestoneReachedAt.value
|
|
: this.milestoneReachedAt,
|
|
fulfilled: data.fulfilled.present ? data.fulfilled.value : this.fulfilled,
|
|
fulfilledAt: data.fulfilledAt.present
|
|
? data.fulfilledAt.value
|
|
: this.fulfilledAt,
|
|
reflection: data.reflection.present
|
|
? data.reflection.value
|
|
: this.reflection,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardClaim(')
|
|
..write('id: $id, ')
|
|
..write('declarationId: $declarationId, ')
|
|
..write('milestoneReachedAt: $milestoneReachedAt, ')
|
|
..write('fulfilled: $fulfilled, ')
|
|
..write('fulfilledAt: $fulfilledAt, ')
|
|
..write('reflection: $reflection')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
declarationId,
|
|
milestoneReachedAt,
|
|
fulfilled,
|
|
fulfilledAt,
|
|
reflection,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is RewardClaim &&
|
|
other.id == this.id &&
|
|
other.declarationId == this.declarationId &&
|
|
other.milestoneReachedAt == this.milestoneReachedAt &&
|
|
other.fulfilled == this.fulfilled &&
|
|
other.fulfilledAt == this.fulfilledAt &&
|
|
other.reflection == this.reflection);
|
|
}
|
|
|
|
class RewardClaimsCompanion extends UpdateCompanion<RewardClaim> {
|
|
final Value<String> id;
|
|
final Value<String> declarationId;
|
|
final Value<String> milestoneReachedAt;
|
|
final Value<bool> fulfilled;
|
|
final Value<String?> fulfilledAt;
|
|
final Value<String?> reflection;
|
|
final Value<int> rowid;
|
|
const RewardClaimsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.declarationId = const Value.absent(),
|
|
this.milestoneReachedAt = const Value.absent(),
|
|
this.fulfilled = const Value.absent(),
|
|
this.fulfilledAt = const Value.absent(),
|
|
this.reflection = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
RewardClaimsCompanion.insert({
|
|
required String id,
|
|
required String declarationId,
|
|
required String milestoneReachedAt,
|
|
required bool fulfilled,
|
|
this.fulfilledAt = const Value.absent(),
|
|
this.reflection = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
declarationId = Value(declarationId),
|
|
milestoneReachedAt = Value(milestoneReachedAt),
|
|
fulfilled = Value(fulfilled);
|
|
static Insertable<RewardClaim> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? declarationId,
|
|
Expression<String>? milestoneReachedAt,
|
|
Expression<bool>? fulfilled,
|
|
Expression<String>? fulfilledAt,
|
|
Expression<String>? reflection,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (declarationId != null) 'declaration_id': declarationId,
|
|
if (milestoneReachedAt != null)
|
|
'milestone_reached_at': milestoneReachedAt,
|
|
if (fulfilled != null) 'fulfilled': fulfilled,
|
|
if (fulfilledAt != null) 'fulfilled_at': fulfilledAt,
|
|
if (reflection != null) 'reflection': reflection,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
RewardClaimsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? declarationId,
|
|
Value<String>? milestoneReachedAt,
|
|
Value<bool>? fulfilled,
|
|
Value<String?>? fulfilledAt,
|
|
Value<String?>? reflection,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return RewardClaimsCompanion(
|
|
id: id ?? this.id,
|
|
declarationId: declarationId ?? this.declarationId,
|
|
milestoneReachedAt: milestoneReachedAt ?? this.milestoneReachedAt,
|
|
fulfilled: fulfilled ?? this.fulfilled,
|
|
fulfilledAt: fulfilledAt ?? this.fulfilledAt,
|
|
reflection: reflection ?? this.reflection,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (declarationId.present) {
|
|
map['declaration_id'] = Variable<String>(declarationId.value);
|
|
}
|
|
if (milestoneReachedAt.present) {
|
|
map['milestone_reached_at'] = Variable<String>(milestoneReachedAt.value);
|
|
}
|
|
if (fulfilled.present) {
|
|
map['fulfilled'] = Variable<bool>(fulfilled.value);
|
|
}
|
|
if (fulfilledAt.present) {
|
|
map['fulfilled_at'] = Variable<String>(fulfilledAt.value);
|
|
}
|
|
if (reflection.present) {
|
|
map['reflection'] = Variable<String>(reflection.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('RewardClaimsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('declarationId: $declarationId, ')
|
|
..write('milestoneReachedAt: $milestoneReachedAt, ')
|
|
..write('fulfilled: $fulfilled, ')
|
|
..write('fulfilledAt: $fulfilledAt, ')
|
|
..write('reflection: $reflection, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ReflectionsTable extends Reflections
|
|
with TableInfo<$ReflectionsTable, Reflection> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ReflectionsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _userIdMeta = const VerificationMeta('userId');
|
|
@override
|
|
late final GeneratedColumn<String> userId = GeneratedColumn<String>(
|
|
'user_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
$customConstraints: 'REFERENCES users(id) NOT NULL',
|
|
);
|
|
static const VerificationMeta _scopeMeta = const VerificationMeta('scope');
|
|
@override
|
|
late final GeneratedColumn<String> scope = GeneratedColumn<String>(
|
|
'scope',
|
|
aliasedName,
|
|
false,
|
|
check: () => const CustomExpression<bool>(
|
|
"scope IN ('weekly','monthly','phase_end')",
|
|
),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _periodStartMeta = const VerificationMeta(
|
|
'periodStart',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> periodStart = GeneratedColumn<String>(
|
|
'period_start',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _periodEndMeta = const VerificationMeta(
|
|
'periodEnd',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> periodEnd = GeneratedColumn<String>(
|
|
'period_end',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _phaseIdMeta = const VerificationMeta(
|
|
'phaseId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> phaseId = GeneratedColumn<String>(
|
|
'phase_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
$customConstraints: 'NULL REFERENCES phases(id) ON DELETE SET NULL',
|
|
);
|
|
static const VerificationMeta _keptMeta = const VerificationMeta('kept');
|
|
@override
|
|
late final GeneratedColumn<String> kept = GeneratedColumn<String>(
|
|
'kept',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _missedMeta = const VerificationMeta('missed');
|
|
@override
|
|
late final GeneratedColumn<String> missed = GeneratedColumn<String>(
|
|
'missed',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _adjustMeta = const VerificationMeta('adjust');
|
|
@override
|
|
late final GeneratedColumn<String> adjust = GeneratedColumn<String>(
|
|
'adjust',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _identityNoteMeta = const VerificationMeta(
|
|
'identityNote',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> identityNote = GeneratedColumn<String>(
|
|
'identity_note',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _minimumRatioMeta = const VerificationMeta(
|
|
'minimumRatio',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> minimumRatio = GeneratedColumn<double>(
|
|
'minimum_ratio',
|
|
aliasedName,
|
|
true,
|
|
check: () => const CustomExpression<bool>(
|
|
"minimum_ratio IS NULL OR (minimum_ratio BETWEEN 0 AND 1)",
|
|
),
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> createdAt = GeneratedColumn<String>(
|
|
'created_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
userId,
|
|
scope,
|
|
periodStart,
|
|
periodEnd,
|
|
phaseId,
|
|
kept,
|
|
missed,
|
|
adjust,
|
|
identityNote,
|
|
minimumRatio,
|
|
createdAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'reflections';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Reflection> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('user_id')) {
|
|
context.handle(
|
|
_userIdMeta,
|
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_userIdMeta);
|
|
}
|
|
if (data.containsKey('scope')) {
|
|
context.handle(
|
|
_scopeMeta,
|
|
scope.isAcceptableOrUnknown(data['scope']!, _scopeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_scopeMeta);
|
|
}
|
|
if (data.containsKey('period_start')) {
|
|
context.handle(
|
|
_periodStartMeta,
|
|
periodStart.isAcceptableOrUnknown(
|
|
data['period_start']!,
|
|
_periodStartMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_periodStartMeta);
|
|
}
|
|
if (data.containsKey('period_end')) {
|
|
context.handle(
|
|
_periodEndMeta,
|
|
periodEnd.isAcceptableOrUnknown(data['period_end']!, _periodEndMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_periodEndMeta);
|
|
}
|
|
if (data.containsKey('phase_id')) {
|
|
context.handle(
|
|
_phaseIdMeta,
|
|
phaseId.isAcceptableOrUnknown(data['phase_id']!, _phaseIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('kept')) {
|
|
context.handle(
|
|
_keptMeta,
|
|
kept.isAcceptableOrUnknown(data['kept']!, _keptMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('missed')) {
|
|
context.handle(
|
|
_missedMeta,
|
|
missed.isAcceptableOrUnknown(data['missed']!, _missedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('adjust')) {
|
|
context.handle(
|
|
_adjustMeta,
|
|
adjust.isAcceptableOrUnknown(data['adjust']!, _adjustMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('identity_note')) {
|
|
context.handle(
|
|
_identityNoteMeta,
|
|
identityNote.isAcceptableOrUnknown(
|
|
data['identity_note']!,
|
|
_identityNoteMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('minimum_ratio')) {
|
|
context.handle(
|
|
_minimumRatioMeta,
|
|
minimumRatio.isAcceptableOrUnknown(
|
|
data['minimum_ratio']!,
|
|
_minimumRatioMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Reflection map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Reflection(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
userId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}user_id'],
|
|
)!,
|
|
scope: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}scope'],
|
|
)!,
|
|
periodStart: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}period_start'],
|
|
)!,
|
|
periodEnd: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}period_end'],
|
|
)!,
|
|
phaseId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}phase_id'],
|
|
),
|
|
kept: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kept'],
|
|
),
|
|
missed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}missed'],
|
|
),
|
|
adjust: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}adjust'],
|
|
),
|
|
identityNote: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}identity_note'],
|
|
),
|
|
minimumRatio: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}minimum_ratio'],
|
|
),
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ReflectionsTable createAlias(String alias) {
|
|
return $ReflectionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Reflection extends DataClass implements Insertable<Reflection> {
|
|
final String id;
|
|
final String userId;
|
|
final String scope;
|
|
final String periodStart;
|
|
final String periodEnd;
|
|
final String? phaseId;
|
|
final String? kept;
|
|
final String? missed;
|
|
final String? adjust;
|
|
final String? identityNote;
|
|
final double? minimumRatio;
|
|
final String? createdAt;
|
|
const Reflection({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.scope,
|
|
required this.periodStart,
|
|
required this.periodEnd,
|
|
this.phaseId,
|
|
this.kept,
|
|
this.missed,
|
|
this.adjust,
|
|
this.identityNote,
|
|
this.minimumRatio,
|
|
this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['user_id'] = Variable<String>(userId);
|
|
map['scope'] = Variable<String>(scope);
|
|
map['period_start'] = Variable<String>(periodStart);
|
|
map['period_end'] = Variable<String>(periodEnd);
|
|
if (!nullToAbsent || phaseId != null) {
|
|
map['phase_id'] = Variable<String>(phaseId);
|
|
}
|
|
if (!nullToAbsent || kept != null) {
|
|
map['kept'] = Variable<String>(kept);
|
|
}
|
|
if (!nullToAbsent || missed != null) {
|
|
map['missed'] = Variable<String>(missed);
|
|
}
|
|
if (!nullToAbsent || adjust != null) {
|
|
map['adjust'] = Variable<String>(adjust);
|
|
}
|
|
if (!nullToAbsent || identityNote != null) {
|
|
map['identity_note'] = Variable<String>(identityNote);
|
|
}
|
|
if (!nullToAbsent || minimumRatio != null) {
|
|
map['minimum_ratio'] = Variable<double>(minimumRatio);
|
|
}
|
|
if (!nullToAbsent || createdAt != null) {
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ReflectionsCompanion toCompanion(bool nullToAbsent) {
|
|
return ReflectionsCompanion(
|
|
id: Value(id),
|
|
userId: Value(userId),
|
|
scope: Value(scope),
|
|
periodStart: Value(periodStart),
|
|
periodEnd: Value(periodEnd),
|
|
phaseId: phaseId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(phaseId),
|
|
kept: kept == null && nullToAbsent ? const Value.absent() : Value(kept),
|
|
missed: missed == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(missed),
|
|
adjust: adjust == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(adjust),
|
|
identityNote: identityNote == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(identityNote),
|
|
minimumRatio: minimumRatio == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(minimumRatio),
|
|
createdAt: createdAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory Reflection.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Reflection(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
userId: serializer.fromJson<String>(json['userId']),
|
|
scope: serializer.fromJson<String>(json['scope']),
|
|
periodStart: serializer.fromJson<String>(json['periodStart']),
|
|
periodEnd: serializer.fromJson<String>(json['periodEnd']),
|
|
phaseId: serializer.fromJson<String?>(json['phaseId']),
|
|
kept: serializer.fromJson<String?>(json['kept']),
|
|
missed: serializer.fromJson<String?>(json['missed']),
|
|
adjust: serializer.fromJson<String?>(json['adjust']),
|
|
identityNote: serializer.fromJson<String?>(json['identityNote']),
|
|
minimumRatio: serializer.fromJson<double?>(json['minimumRatio']),
|
|
createdAt: serializer.fromJson<String?>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'userId': serializer.toJson<String>(userId),
|
|
'scope': serializer.toJson<String>(scope),
|
|
'periodStart': serializer.toJson<String>(periodStart),
|
|
'periodEnd': serializer.toJson<String>(periodEnd),
|
|
'phaseId': serializer.toJson<String?>(phaseId),
|
|
'kept': serializer.toJson<String?>(kept),
|
|
'missed': serializer.toJson<String?>(missed),
|
|
'adjust': serializer.toJson<String?>(adjust),
|
|
'identityNote': serializer.toJson<String?>(identityNote),
|
|
'minimumRatio': serializer.toJson<double?>(minimumRatio),
|
|
'createdAt': serializer.toJson<String?>(createdAt),
|
|
};
|
|
}
|
|
|
|
Reflection copyWith({
|
|
String? id,
|
|
String? userId,
|
|
String? scope,
|
|
String? periodStart,
|
|
String? periodEnd,
|
|
Value<String?> phaseId = const Value.absent(),
|
|
Value<String?> kept = const Value.absent(),
|
|
Value<String?> missed = const Value.absent(),
|
|
Value<String?> adjust = const Value.absent(),
|
|
Value<String?> identityNote = const Value.absent(),
|
|
Value<double?> minimumRatio = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
}) => Reflection(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
scope: scope ?? this.scope,
|
|
periodStart: periodStart ?? this.periodStart,
|
|
periodEnd: periodEnd ?? this.periodEnd,
|
|
phaseId: phaseId.present ? phaseId.value : this.phaseId,
|
|
kept: kept.present ? kept.value : this.kept,
|
|
missed: missed.present ? missed.value : this.missed,
|
|
adjust: adjust.present ? adjust.value : this.adjust,
|
|
identityNote: identityNote.present ? identityNote.value : this.identityNote,
|
|
minimumRatio: minimumRatio.present ? minimumRatio.value : this.minimumRatio,
|
|
createdAt: createdAt.present ? createdAt.value : this.createdAt,
|
|
);
|
|
Reflection copyWithCompanion(ReflectionsCompanion data) {
|
|
return Reflection(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
userId: data.userId.present ? data.userId.value : this.userId,
|
|
scope: data.scope.present ? data.scope.value : this.scope,
|
|
periodStart: data.periodStart.present
|
|
? data.periodStart.value
|
|
: this.periodStart,
|
|
periodEnd: data.periodEnd.present ? data.periodEnd.value : this.periodEnd,
|
|
phaseId: data.phaseId.present ? data.phaseId.value : this.phaseId,
|
|
kept: data.kept.present ? data.kept.value : this.kept,
|
|
missed: data.missed.present ? data.missed.value : this.missed,
|
|
adjust: data.adjust.present ? data.adjust.value : this.adjust,
|
|
identityNote: data.identityNote.present
|
|
? data.identityNote.value
|
|
: this.identityNote,
|
|
minimumRatio: data.minimumRatio.present
|
|
? data.minimumRatio.value
|
|
: this.minimumRatio,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Reflection(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('scope: $scope, ')
|
|
..write('periodStart: $periodStart, ')
|
|
..write('periodEnd: $periodEnd, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('kept: $kept, ')
|
|
..write('missed: $missed, ')
|
|
..write('adjust: $adjust, ')
|
|
..write('identityNote: $identityNote, ')
|
|
..write('minimumRatio: $minimumRatio, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
userId,
|
|
scope,
|
|
periodStart,
|
|
periodEnd,
|
|
phaseId,
|
|
kept,
|
|
missed,
|
|
adjust,
|
|
identityNote,
|
|
minimumRatio,
|
|
createdAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Reflection &&
|
|
other.id == this.id &&
|
|
other.userId == this.userId &&
|
|
other.scope == this.scope &&
|
|
other.periodStart == this.periodStart &&
|
|
other.periodEnd == this.periodEnd &&
|
|
other.phaseId == this.phaseId &&
|
|
other.kept == this.kept &&
|
|
other.missed == this.missed &&
|
|
other.adjust == this.adjust &&
|
|
other.identityNote == this.identityNote &&
|
|
other.minimumRatio == this.minimumRatio &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ReflectionsCompanion extends UpdateCompanion<Reflection> {
|
|
final Value<String> id;
|
|
final Value<String> userId;
|
|
final Value<String> scope;
|
|
final Value<String> periodStart;
|
|
final Value<String> periodEnd;
|
|
final Value<String?> phaseId;
|
|
final Value<String?> kept;
|
|
final Value<String?> missed;
|
|
final Value<String?> adjust;
|
|
final Value<String?> identityNote;
|
|
final Value<double?> minimumRatio;
|
|
final Value<String?> createdAt;
|
|
final Value<int> rowid;
|
|
const ReflectionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.userId = const Value.absent(),
|
|
this.scope = const Value.absent(),
|
|
this.periodStart = const Value.absent(),
|
|
this.periodEnd = const Value.absent(),
|
|
this.phaseId = const Value.absent(),
|
|
this.kept = const Value.absent(),
|
|
this.missed = const Value.absent(),
|
|
this.adjust = const Value.absent(),
|
|
this.identityNote = const Value.absent(),
|
|
this.minimumRatio = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ReflectionsCompanion.insert({
|
|
required String id,
|
|
required String userId,
|
|
required String scope,
|
|
required String periodStart,
|
|
required String periodEnd,
|
|
this.phaseId = const Value.absent(),
|
|
this.kept = const Value.absent(),
|
|
this.missed = const Value.absent(),
|
|
this.adjust = const Value.absent(),
|
|
this.identityNote = const Value.absent(),
|
|
this.minimumRatio = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
userId = Value(userId),
|
|
scope = Value(scope),
|
|
periodStart = Value(periodStart),
|
|
periodEnd = Value(periodEnd);
|
|
static Insertable<Reflection> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? userId,
|
|
Expression<String>? scope,
|
|
Expression<String>? periodStart,
|
|
Expression<String>? periodEnd,
|
|
Expression<String>? phaseId,
|
|
Expression<String>? kept,
|
|
Expression<String>? missed,
|
|
Expression<String>? adjust,
|
|
Expression<String>? identityNote,
|
|
Expression<double>? minimumRatio,
|
|
Expression<String>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (userId != null) 'user_id': userId,
|
|
if (scope != null) 'scope': scope,
|
|
if (periodStart != null) 'period_start': periodStart,
|
|
if (periodEnd != null) 'period_end': periodEnd,
|
|
if (phaseId != null) 'phase_id': phaseId,
|
|
if (kept != null) 'kept': kept,
|
|
if (missed != null) 'missed': missed,
|
|
if (adjust != null) 'adjust': adjust,
|
|
if (identityNote != null) 'identity_note': identityNote,
|
|
if (minimumRatio != null) 'minimum_ratio': minimumRatio,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ReflectionsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? userId,
|
|
Value<String>? scope,
|
|
Value<String>? periodStart,
|
|
Value<String>? periodEnd,
|
|
Value<String?>? phaseId,
|
|
Value<String?>? kept,
|
|
Value<String?>? missed,
|
|
Value<String?>? adjust,
|
|
Value<String?>? identityNote,
|
|
Value<double?>? minimumRatio,
|
|
Value<String?>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ReflectionsCompanion(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
scope: scope ?? this.scope,
|
|
periodStart: periodStart ?? this.periodStart,
|
|
periodEnd: periodEnd ?? this.periodEnd,
|
|
phaseId: phaseId ?? this.phaseId,
|
|
kept: kept ?? this.kept,
|
|
missed: missed ?? this.missed,
|
|
adjust: adjust ?? this.adjust,
|
|
identityNote: identityNote ?? this.identityNote,
|
|
minimumRatio: minimumRatio ?? this.minimumRatio,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (userId.present) {
|
|
map['user_id'] = Variable<String>(userId.value);
|
|
}
|
|
if (scope.present) {
|
|
map['scope'] = Variable<String>(scope.value);
|
|
}
|
|
if (periodStart.present) {
|
|
map['period_start'] = Variable<String>(periodStart.value);
|
|
}
|
|
if (periodEnd.present) {
|
|
map['period_end'] = Variable<String>(periodEnd.value);
|
|
}
|
|
if (phaseId.present) {
|
|
map['phase_id'] = Variable<String>(phaseId.value);
|
|
}
|
|
if (kept.present) {
|
|
map['kept'] = Variable<String>(kept.value);
|
|
}
|
|
if (missed.present) {
|
|
map['missed'] = Variable<String>(missed.value);
|
|
}
|
|
if (adjust.present) {
|
|
map['adjust'] = Variable<String>(adjust.value);
|
|
}
|
|
if (identityNote.present) {
|
|
map['identity_note'] = Variable<String>(identityNote.value);
|
|
}
|
|
if (minimumRatio.present) {
|
|
map['minimum_ratio'] = Variable<double>(minimumRatio.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<String>(createdAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ReflectionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('userId: $userId, ')
|
|
..write('scope: $scope, ')
|
|
..write('periodStart: $periodStart, ')
|
|
..write('periodEnd: $periodEnd, ')
|
|
..write('phaseId: $phaseId, ')
|
|
..write('kept: $kept, ')
|
|
..write('missed: $missed, ')
|
|
..write('adjust: $adjust, ')
|
|
..write('identityNote: $identityNote, ')
|
|
..write('minimumRatio: $minimumRatio, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $MetaKvTable extends MetaKv with TableInfo<$MetaKvTable, MetaKvData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MetaKvTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _keyMeta = const VerificationMeta('key');
|
|
@override
|
|
late final GeneratedColumn<String> key = GeneratedColumn<String>(
|
|
'key',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _valueMeta = const VerificationMeta('value');
|
|
@override
|
|
late final GeneratedColumn<String> value = GeneratedColumn<String>(
|
|
'value',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [key, value];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'meta_kv';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<MetaKvData> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('key')) {
|
|
context.handle(
|
|
_keyMeta,
|
|
key.isAcceptableOrUnknown(data['key']!, _keyMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_keyMeta);
|
|
}
|
|
if (data.containsKey('value')) {
|
|
context.handle(
|
|
_valueMeta,
|
|
value.isAcceptableOrUnknown(data['value']!, _valueMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_valueMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {key};
|
|
@override
|
|
MetaKvData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return MetaKvData(
|
|
key: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}key'],
|
|
)!,
|
|
value: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}value'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MetaKvTable createAlias(String alias) {
|
|
return $MetaKvTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class MetaKvData extends DataClass implements Insertable<MetaKvData> {
|
|
final String key;
|
|
final String value;
|
|
const MetaKvData({required this.key, required this.value});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['key'] = Variable<String>(key);
|
|
map['value'] = Variable<String>(value);
|
|
return map;
|
|
}
|
|
|
|
MetaKvCompanion toCompanion(bool nullToAbsent) {
|
|
return MetaKvCompanion(key: Value(key), value: Value(value));
|
|
}
|
|
|
|
factory MetaKvData.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return MetaKvData(
|
|
key: serializer.fromJson<String>(json['key']),
|
|
value: serializer.fromJson<String>(json['value']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'key': serializer.toJson<String>(key),
|
|
'value': serializer.toJson<String>(value),
|
|
};
|
|
}
|
|
|
|
MetaKvData copyWith({String? key, String? value}) =>
|
|
MetaKvData(key: key ?? this.key, value: value ?? this.value);
|
|
MetaKvData copyWithCompanion(MetaKvCompanion data) {
|
|
return MetaKvData(
|
|
key: data.key.present ? data.key.value : this.key,
|
|
value: data.value.present ? data.value.value : this.value,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MetaKvData(')
|
|
..write('key: $key, ')
|
|
..write('value: $value')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(key, value);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is MetaKvData &&
|
|
other.key == this.key &&
|
|
other.value == this.value);
|
|
}
|
|
|
|
class MetaKvCompanion extends UpdateCompanion<MetaKvData> {
|
|
final Value<String> key;
|
|
final Value<String> value;
|
|
final Value<int> rowid;
|
|
const MetaKvCompanion({
|
|
this.key = const Value.absent(),
|
|
this.value = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
MetaKvCompanion.insert({
|
|
required String key,
|
|
required String value,
|
|
this.rowid = const Value.absent(),
|
|
}) : key = Value(key),
|
|
value = Value(value);
|
|
static Insertable<MetaKvData> custom({
|
|
Expression<String>? key,
|
|
Expression<String>? value,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (key != null) 'key': key,
|
|
if (value != null) 'value': value,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
MetaKvCompanion copyWith({
|
|
Value<String>? key,
|
|
Value<String>? value,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return MetaKvCompanion(
|
|
key: key ?? this.key,
|
|
value: value ?? this.value,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (key.present) {
|
|
map['key'] = Variable<String>(key.value);
|
|
}
|
|
if (value.present) {
|
|
map['value'] = Variable<String>(value.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MetaKvCompanion(')
|
|
..write('key: $key, ')
|
|
..write('value: $value, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $ProtocolsTable protocols = $ProtocolsTable(this);
|
|
late final $BreakProtocolsTable breakProtocols = $BreakProtocolsTable(this);
|
|
late final $CommonFramesTable commonFrames = $CommonFramesTable(this);
|
|
late final $MethodologiesTable methodologies = $MethodologiesTable(this);
|
|
late final $FramePatternsTable framePatterns = $FramePatternsTable(this);
|
|
late final $RewardMenuItemsTable rewardMenuItems = $RewardMenuItemsTable(
|
|
this,
|
|
);
|
|
late final $ReferencesTable references = $ReferencesTable(this);
|
|
late final $DietPatternsTable dietPatterns = $DietPatternsTable(this);
|
|
late final $UsersTable users = $UsersTable(this);
|
|
late final $PhasesTable phases = $PhasesTable(this);
|
|
late final $HabitsTable habits = $HabitsTable(this);
|
|
late final $HabitDoseVariantsTable habitDoseVariants =
|
|
$HabitDoseVariantsTable(this);
|
|
late final $IfThenRulesTable ifThenRules = $IfThenRulesTable(this);
|
|
late final $TrackerEntriesTable trackerEntries = $TrackerEntriesTable(this);
|
|
late final $LapseLogsTable lapseLogs = $LapseLogsTable(this);
|
|
late final $UrgeLogsTable urgeLogs = $UrgeLogsTable(this);
|
|
late final $RewardDeclarationsTable rewardDeclarations =
|
|
$RewardDeclarationsTable(this);
|
|
late final $RewardClaimsTable rewardClaims = $RewardClaimsTable(this);
|
|
late final $ReflectionsTable reflections = $ReflectionsTable(this);
|
|
late final $MetaKvTable metaKv = $MetaKvTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
protocols,
|
|
breakProtocols,
|
|
commonFrames,
|
|
methodologies,
|
|
framePatterns,
|
|
rewardMenuItems,
|
|
references,
|
|
dietPatterns,
|
|
users,
|
|
phases,
|
|
habits,
|
|
habitDoseVariants,
|
|
ifThenRules,
|
|
trackerEntries,
|
|
lapseLogs,
|
|
urgeLogs,
|
|
rewardDeclarations,
|
|
rewardClaims,
|
|
reflections,
|
|
metaKv,
|
|
];
|
|
@override
|
|
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'phases',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('habits', kind: UpdateKind.update)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'habits',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('habit_dose_variants', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'habits',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('if_then_rules', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'habit_dose_variants',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('tracker_entries', kind: UpdateKind.update)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'phases',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('reflections', kind: UpdateKind.update)],
|
|
),
|
|
]);
|
|
}
|
|
|
|
typedef $$ProtocolsTableCreateCompanionBuilder =
|
|
ProtocolsCompanion Function({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
Value<String?> titleEn,
|
|
required String what,
|
|
required String whenText,
|
|
required String dose,
|
|
required String why,
|
|
required String howJson,
|
|
required String checkText,
|
|
Value<String?> caution,
|
|
Value<String?> defaultAnchorJson,
|
|
Value<String?> minDoseForStart,
|
|
Value<String?> referenceIdsJson,
|
|
Value<String?> evidenceStrength,
|
|
Value<String?> sourceDoc,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProtocolsTableUpdateCompanionBuilder =
|
|
ProtocolsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> category,
|
|
Value<String> title,
|
|
Value<String?> titleEn,
|
|
Value<String> what,
|
|
Value<String> whenText,
|
|
Value<String> dose,
|
|
Value<String> why,
|
|
Value<String> howJson,
|
|
Value<String> checkText,
|
|
Value<String?> caution,
|
|
Value<String?> defaultAnchorJson,
|
|
Value<String?> minDoseForStart,
|
|
Value<String?> referenceIdsJson,
|
|
Value<String?> evidenceStrength,
|
|
Value<String?> sourceDoc,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ProtocolsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProtocolsTable> {
|
|
$$ProtocolsTableFilterComposer({
|
|
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 category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get titleEn => $composableBuilder(
|
|
column: $table.titleEn,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get what => $composableBuilder(
|
|
column: $table.what,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get whenText => $composableBuilder(
|
|
column: $table.whenText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get dose => $composableBuilder(
|
|
column: $table.dose,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get why => $composableBuilder(
|
|
column: $table.why,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get howJson => $composableBuilder(
|
|
column: $table.howJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get checkText => $composableBuilder(
|
|
column: $table.checkText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get caution => $composableBuilder(
|
|
column: $table.caution,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get defaultAnchorJson => $composableBuilder(
|
|
column: $table.defaultAnchorJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get minDoseForStart => $composableBuilder(
|
|
column: $table.minDoseForStart,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get sourceDoc => $composableBuilder(
|
|
column: $table.sourceDoc,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ProtocolsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProtocolsTable> {
|
|
$$ProtocolsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get titleEn => $composableBuilder(
|
|
column: $table.titleEn,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get what => $composableBuilder(
|
|
column: $table.what,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get whenText => $composableBuilder(
|
|
column: $table.whenText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get dose => $composableBuilder(
|
|
column: $table.dose,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get why => $composableBuilder(
|
|
column: $table.why,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get howJson => $composableBuilder(
|
|
column: $table.howJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get checkText => $composableBuilder(
|
|
column: $table.checkText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get caution => $composableBuilder(
|
|
column: $table.caution,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get defaultAnchorJson => $composableBuilder(
|
|
column: $table.defaultAnchorJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get minDoseForStart => $composableBuilder(
|
|
column: $table.minDoseForStart,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get sourceDoc => $composableBuilder(
|
|
column: $table.sourceDoc,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ProtocolsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProtocolsTable> {
|
|
$$ProtocolsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get category =>
|
|
$composableBuilder(column: $table.category, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get titleEn =>
|
|
$composableBuilder(column: $table.titleEn, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get what =>
|
|
$composableBuilder(column: $table.what, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get whenText =>
|
|
$composableBuilder(column: $table.whenText, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get dose =>
|
|
$composableBuilder(column: $table.dose, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get why =>
|
|
$composableBuilder(column: $table.why, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get howJson =>
|
|
$composableBuilder(column: $table.howJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get checkText =>
|
|
$composableBuilder(column: $table.checkText, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get caution =>
|
|
$composableBuilder(column: $table.caution, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get defaultAnchorJson => $composableBuilder(
|
|
column: $table.defaultAnchorJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get minDoseForStart => $composableBuilder(
|
|
column: $table.minDoseForStart,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get sourceDoc =>
|
|
$composableBuilder(column: $table.sourceDoc, builder: (column) => column);
|
|
}
|
|
|
|
class $$ProtocolsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProtocolsTable,
|
|
Protocol,
|
|
$$ProtocolsTableFilterComposer,
|
|
$$ProtocolsTableOrderingComposer,
|
|
$$ProtocolsTableAnnotationComposer,
|
|
$$ProtocolsTableCreateCompanionBuilder,
|
|
$$ProtocolsTableUpdateCompanionBuilder,
|
|
(Protocol, BaseReferences<_$AppDatabase, $ProtocolsTable, Protocol>),
|
|
Protocol,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ProtocolsTableTableManager(_$AppDatabase db, $ProtocolsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProtocolsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProtocolsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProtocolsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> category = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String?> titleEn = const Value.absent(),
|
|
Value<String> what = const Value.absent(),
|
|
Value<String> whenText = const Value.absent(),
|
|
Value<String> dose = const Value.absent(),
|
|
Value<String> why = const Value.absent(),
|
|
Value<String> howJson = const Value.absent(),
|
|
Value<String> checkText = const Value.absent(),
|
|
Value<String?> caution = const Value.absent(),
|
|
Value<String?> defaultAnchorJson = const Value.absent(),
|
|
Value<String?> minDoseForStart = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<String?> sourceDoc = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProtocolsCompanion(
|
|
id: id,
|
|
category: category,
|
|
title: title,
|
|
titleEn: titleEn,
|
|
what: what,
|
|
whenText: whenText,
|
|
dose: dose,
|
|
why: why,
|
|
howJson: howJson,
|
|
checkText: checkText,
|
|
caution: caution,
|
|
defaultAnchorJson: defaultAnchorJson,
|
|
minDoseForStart: minDoseForStart,
|
|
referenceIdsJson: referenceIdsJson,
|
|
evidenceStrength: evidenceStrength,
|
|
sourceDoc: sourceDoc,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
Value<String?> titleEn = const Value.absent(),
|
|
required String what,
|
|
required String whenText,
|
|
required String dose,
|
|
required String why,
|
|
required String howJson,
|
|
required String checkText,
|
|
Value<String?> caution = const Value.absent(),
|
|
Value<String?> defaultAnchorJson = const Value.absent(),
|
|
Value<String?> minDoseForStart = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<String?> sourceDoc = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProtocolsCompanion.insert(
|
|
id: id,
|
|
category: category,
|
|
title: title,
|
|
titleEn: titleEn,
|
|
what: what,
|
|
whenText: whenText,
|
|
dose: dose,
|
|
why: why,
|
|
howJson: howJson,
|
|
checkText: checkText,
|
|
caution: caution,
|
|
defaultAnchorJson: defaultAnchorJson,
|
|
minDoseForStart: minDoseForStart,
|
|
referenceIdsJson: referenceIdsJson,
|
|
evidenceStrength: evidenceStrength,
|
|
sourceDoc: sourceDoc,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProtocolsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProtocolsTable,
|
|
Protocol,
|
|
$$ProtocolsTableFilterComposer,
|
|
$$ProtocolsTableOrderingComposer,
|
|
$$ProtocolsTableAnnotationComposer,
|
|
$$ProtocolsTableCreateCompanionBuilder,
|
|
$$ProtocolsTableUpdateCompanionBuilder,
|
|
(Protocol, BaseReferences<_$AppDatabase, $ProtocolsTable, Protocol>),
|
|
Protocol,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$BreakProtocolsTableCreateCompanionBuilder =
|
|
BreakProtocolsCompanion Function({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
required String hubermanSummary,
|
|
Value<String?> frameExamplesJson,
|
|
required String phasesJson,
|
|
required String defaultCommonFramesJson,
|
|
Value<String?> toolsJson,
|
|
Value<String?> medicalWarning,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$BreakProtocolsTableUpdateCompanionBuilder =
|
|
BreakProtocolsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> category,
|
|
Value<String> title,
|
|
Value<String> hubermanSummary,
|
|
Value<String?> frameExamplesJson,
|
|
Value<String> phasesJson,
|
|
Value<String> defaultCommonFramesJson,
|
|
Value<String?> toolsJson,
|
|
Value<String?> medicalWarning,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$BreakProtocolsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $BreakProtocolsTable> {
|
|
$$BreakProtocolsTableFilterComposer({
|
|
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 category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get hubermanSummary => $composableBuilder(
|
|
column: $table.hubermanSummary,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get frameExamplesJson => $composableBuilder(
|
|
column: $table.frameExamplesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get phasesJson => $composableBuilder(
|
|
column: $table.phasesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get defaultCommonFramesJson => $composableBuilder(
|
|
column: $table.defaultCommonFramesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get toolsJson => $composableBuilder(
|
|
column: $table.toolsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$BreakProtocolsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $BreakProtocolsTable> {
|
|
$$BreakProtocolsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get hubermanSummary => $composableBuilder(
|
|
column: $table.hubermanSummary,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get frameExamplesJson => $composableBuilder(
|
|
column: $table.frameExamplesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get phasesJson => $composableBuilder(
|
|
column: $table.phasesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get defaultCommonFramesJson => $composableBuilder(
|
|
column: $table.defaultCommonFramesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get toolsJson => $composableBuilder(
|
|
column: $table.toolsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$BreakProtocolsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $BreakProtocolsTable> {
|
|
$$BreakProtocolsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get category =>
|
|
$composableBuilder(column: $table.category, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get hubermanSummary => $composableBuilder(
|
|
column: $table.hubermanSummary,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get frameExamplesJson => $composableBuilder(
|
|
column: $table.frameExamplesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get phasesJson => $composableBuilder(
|
|
column: $table.phasesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get defaultCommonFramesJson => $composableBuilder(
|
|
column: $table.defaultCommonFramesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get toolsJson =>
|
|
$composableBuilder(column: $table.toolsJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$BreakProtocolsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$BreakProtocolsTable,
|
|
BreakProtocol,
|
|
$$BreakProtocolsTableFilterComposer,
|
|
$$BreakProtocolsTableOrderingComposer,
|
|
$$BreakProtocolsTableAnnotationComposer,
|
|
$$BreakProtocolsTableCreateCompanionBuilder,
|
|
$$BreakProtocolsTableUpdateCompanionBuilder,
|
|
(
|
|
BreakProtocol,
|
|
BaseReferences<_$AppDatabase, $BreakProtocolsTable, BreakProtocol>,
|
|
),
|
|
BreakProtocol,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$BreakProtocolsTableTableManager(
|
|
_$AppDatabase db,
|
|
$BreakProtocolsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$BreakProtocolsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$BreakProtocolsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$BreakProtocolsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> category = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String> hubermanSummary = const Value.absent(),
|
|
Value<String?> frameExamplesJson = const Value.absent(),
|
|
Value<String> phasesJson = const Value.absent(),
|
|
Value<String> defaultCommonFramesJson = const Value.absent(),
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => BreakProtocolsCompanion(
|
|
id: id,
|
|
category: category,
|
|
title: title,
|
|
hubermanSummary: hubermanSummary,
|
|
frameExamplesJson: frameExamplesJson,
|
|
phasesJson: phasesJson,
|
|
defaultCommonFramesJson: defaultCommonFramesJson,
|
|
toolsJson: toolsJson,
|
|
medicalWarning: medicalWarning,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String category,
|
|
required String title,
|
|
required String hubermanSummary,
|
|
Value<String?> frameExamplesJson = const Value.absent(),
|
|
required String phasesJson,
|
|
required String defaultCommonFramesJson,
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => BreakProtocolsCompanion.insert(
|
|
id: id,
|
|
category: category,
|
|
title: title,
|
|
hubermanSummary: hubermanSummary,
|
|
frameExamplesJson: frameExamplesJson,
|
|
phasesJson: phasesJson,
|
|
defaultCommonFramesJson: defaultCommonFramesJson,
|
|
toolsJson: toolsJson,
|
|
medicalWarning: medicalWarning,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$BreakProtocolsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$BreakProtocolsTable,
|
|
BreakProtocol,
|
|
$$BreakProtocolsTableFilterComposer,
|
|
$$BreakProtocolsTableOrderingComposer,
|
|
$$BreakProtocolsTableAnnotationComposer,
|
|
$$BreakProtocolsTableCreateCompanionBuilder,
|
|
$$BreakProtocolsTableUpdateCompanionBuilder,
|
|
(
|
|
BreakProtocol,
|
|
BaseReferences<_$AppDatabase, $BreakProtocolsTable, BreakProtocol>,
|
|
),
|
|
BreakProtocol,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$CommonFramesTableCreateCompanionBuilder =
|
|
CommonFramesCompanion Function({
|
|
required String id,
|
|
required String title,
|
|
required String what,
|
|
required String why,
|
|
Value<String?> dose,
|
|
Value<String?> howJson,
|
|
required String checkText,
|
|
Value<String?> applicableBreakCategoriesJson,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$CommonFramesTableUpdateCompanionBuilder =
|
|
CommonFramesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> title,
|
|
Value<String> what,
|
|
Value<String> why,
|
|
Value<String?> dose,
|
|
Value<String?> howJson,
|
|
Value<String> checkText,
|
|
Value<String?> applicableBreakCategoriesJson,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$CommonFramesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $CommonFramesTable> {
|
|
$$CommonFramesTableFilterComposer({
|
|
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 what => $composableBuilder(
|
|
column: $table.what,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get why => $composableBuilder(
|
|
column: $table.why,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get dose => $composableBuilder(
|
|
column: $table.dose,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get howJson => $composableBuilder(
|
|
column: $table.howJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get checkText => $composableBuilder(
|
|
column: $table.checkText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get applicableBreakCategoriesJson => $composableBuilder(
|
|
column: $table.applicableBreakCategoriesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$CommonFramesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $CommonFramesTable> {
|
|
$$CommonFramesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<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 what => $composableBuilder(
|
|
column: $table.what,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get why => $composableBuilder(
|
|
column: $table.why,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get dose => $composableBuilder(
|
|
column: $table.dose,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get howJson => $composableBuilder(
|
|
column: $table.howJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get checkText => $composableBuilder(
|
|
column: $table.checkText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get applicableBreakCategoriesJson =>
|
|
$composableBuilder(
|
|
column: $table.applicableBreakCategoriesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$CommonFramesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $CommonFramesTable> {
|
|
$$CommonFramesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get what =>
|
|
$composableBuilder(column: $table.what, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get why =>
|
|
$composableBuilder(column: $table.why, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get dose =>
|
|
$composableBuilder(column: $table.dose, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get howJson =>
|
|
$composableBuilder(column: $table.howJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get checkText =>
|
|
$composableBuilder(column: $table.checkText, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get applicableBreakCategoriesJson =>
|
|
$composableBuilder(
|
|
column: $table.applicableBreakCategoriesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$CommonFramesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$CommonFramesTable,
|
|
CommonFrame,
|
|
$$CommonFramesTableFilterComposer,
|
|
$$CommonFramesTableOrderingComposer,
|
|
$$CommonFramesTableAnnotationComposer,
|
|
$$CommonFramesTableCreateCompanionBuilder,
|
|
$$CommonFramesTableUpdateCompanionBuilder,
|
|
(
|
|
CommonFrame,
|
|
BaseReferences<_$AppDatabase, $CommonFramesTable, CommonFrame>,
|
|
),
|
|
CommonFrame,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$CommonFramesTableTableManager(_$AppDatabase db, $CommonFramesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$CommonFramesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$CommonFramesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$CommonFramesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String> what = const Value.absent(),
|
|
Value<String> why = const Value.absent(),
|
|
Value<String?> dose = const Value.absent(),
|
|
Value<String?> howJson = const Value.absent(),
|
|
Value<String> checkText = const Value.absent(),
|
|
Value<String?> applicableBreakCategoriesJson =
|
|
const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => CommonFramesCompanion(
|
|
id: id,
|
|
title: title,
|
|
what: what,
|
|
why: why,
|
|
dose: dose,
|
|
howJson: howJson,
|
|
checkText: checkText,
|
|
applicableBreakCategoriesJson: applicableBreakCategoriesJson,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String title,
|
|
required String what,
|
|
required String why,
|
|
Value<String?> dose = const Value.absent(),
|
|
Value<String?> howJson = const Value.absent(),
|
|
required String checkText,
|
|
Value<String?> applicableBreakCategoriesJson =
|
|
const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => CommonFramesCompanion.insert(
|
|
id: id,
|
|
title: title,
|
|
what: what,
|
|
why: why,
|
|
dose: dose,
|
|
howJson: howJson,
|
|
checkText: checkText,
|
|
applicableBreakCategoriesJson: applicableBreakCategoriesJson,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$CommonFramesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$CommonFramesTable,
|
|
CommonFrame,
|
|
$$CommonFramesTableFilterComposer,
|
|
$$CommonFramesTableOrderingComposer,
|
|
$$CommonFramesTableAnnotationComposer,
|
|
$$CommonFramesTableCreateCompanionBuilder,
|
|
$$CommonFramesTableUpdateCompanionBuilder,
|
|
(
|
|
CommonFrame,
|
|
BaseReferences<_$AppDatabase, $CommonFramesTable, CommonFrame>,
|
|
),
|
|
CommonFrame,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$MethodologiesTableCreateCompanionBuilder =
|
|
MethodologiesCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required String originator,
|
|
required String oneLineDefinition,
|
|
required String coreUnit,
|
|
Value<String?> procedureJson,
|
|
Value<String?> toolsJson,
|
|
Value<String?> strengthsJson,
|
|
Value<String?> weaknessesJson,
|
|
Value<String?> goodFor,
|
|
required int hubermanFitScore,
|
|
Value<bool> isCoreEngine,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$MethodologiesTableUpdateCompanionBuilder =
|
|
MethodologiesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String> originator,
|
|
Value<String> oneLineDefinition,
|
|
Value<String> coreUnit,
|
|
Value<String?> procedureJson,
|
|
Value<String?> toolsJson,
|
|
Value<String?> strengthsJson,
|
|
Value<String?> weaknessesJson,
|
|
Value<String?> goodFor,
|
|
Value<int> hubermanFitScore,
|
|
Value<bool> isCoreEngine,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$MethodologiesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MethodologiesTable> {
|
|
$$MethodologiesTableFilterComposer({
|
|
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<String> get originator => $composableBuilder(
|
|
column: $table.originator,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get oneLineDefinition => $composableBuilder(
|
|
column: $table.oneLineDefinition,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get coreUnit => $composableBuilder(
|
|
column: $table.coreUnit,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get procedureJson => $composableBuilder(
|
|
column: $table.procedureJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get toolsJson => $composableBuilder(
|
|
column: $table.toolsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get goodFor => $composableBuilder(
|
|
column: $table.goodFor,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get hubermanFitScore => $composableBuilder(
|
|
column: $table.hubermanFitScore,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isCoreEngine => $composableBuilder(
|
|
column: $table.isCoreEngine,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$MethodologiesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MethodologiesTable> {
|
|
$$MethodologiesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originator => $composableBuilder(
|
|
column: $table.originator,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get oneLineDefinition => $composableBuilder(
|
|
column: $table.oneLineDefinition,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get coreUnit => $composableBuilder(
|
|
column: $table.coreUnit,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get procedureJson => $composableBuilder(
|
|
column: $table.procedureJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get toolsJson => $composableBuilder(
|
|
column: $table.toolsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get goodFor => $composableBuilder(
|
|
column: $table.goodFor,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get hubermanFitScore => $composableBuilder(
|
|
column: $table.hubermanFitScore,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isCoreEngine => $composableBuilder(
|
|
column: $table.isCoreEngine,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$MethodologiesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MethodologiesTable> {
|
|
$$MethodologiesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get originator => $composableBuilder(
|
|
column: $table.originator,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get oneLineDefinition => $composableBuilder(
|
|
column: $table.oneLineDefinition,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get coreUnit =>
|
|
$composableBuilder(column: $table.coreUnit, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get procedureJson => $composableBuilder(
|
|
column: $table.procedureJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get toolsJson =>
|
|
$composableBuilder(column: $table.toolsJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get goodFor =>
|
|
$composableBuilder(column: $table.goodFor, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get hubermanFitScore => $composableBuilder(
|
|
column: $table.hubermanFitScore,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isCoreEngine => $composableBuilder(
|
|
column: $table.isCoreEngine,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$MethodologiesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$MethodologiesTable,
|
|
Methodology,
|
|
$$MethodologiesTableFilterComposer,
|
|
$$MethodologiesTableOrderingComposer,
|
|
$$MethodologiesTableAnnotationComposer,
|
|
$$MethodologiesTableCreateCompanionBuilder,
|
|
$$MethodologiesTableUpdateCompanionBuilder,
|
|
(
|
|
Methodology,
|
|
BaseReferences<_$AppDatabase, $MethodologiesTable, Methodology>,
|
|
),
|
|
Methodology,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$MethodologiesTableTableManager(_$AppDatabase db, $MethodologiesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MethodologiesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MethodologiesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MethodologiesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> originator = const Value.absent(),
|
|
Value<String> oneLineDefinition = const Value.absent(),
|
|
Value<String> coreUnit = const Value.absent(),
|
|
Value<String?> procedureJson = const Value.absent(),
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
Value<String?> goodFor = const Value.absent(),
|
|
Value<int> hubermanFitScore = const Value.absent(),
|
|
Value<bool> isCoreEngine = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MethodologiesCompanion(
|
|
id: id,
|
|
name: name,
|
|
originator: originator,
|
|
oneLineDefinition: oneLineDefinition,
|
|
coreUnit: coreUnit,
|
|
procedureJson: procedureJson,
|
|
toolsJson: toolsJson,
|
|
strengthsJson: strengthsJson,
|
|
weaknessesJson: weaknessesJson,
|
|
goodFor: goodFor,
|
|
hubermanFitScore: hubermanFitScore,
|
|
isCoreEngine: isCoreEngine,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
required String originator,
|
|
required String oneLineDefinition,
|
|
required String coreUnit,
|
|
Value<String?> procedureJson = const Value.absent(),
|
|
Value<String?> toolsJson = const Value.absent(),
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
Value<String?> goodFor = const Value.absent(),
|
|
required int hubermanFitScore,
|
|
Value<bool> isCoreEngine = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MethodologiesCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
originator: originator,
|
|
oneLineDefinition: oneLineDefinition,
|
|
coreUnit: coreUnit,
|
|
procedureJson: procedureJson,
|
|
toolsJson: toolsJson,
|
|
strengthsJson: strengthsJson,
|
|
weaknessesJson: weaknessesJson,
|
|
goodFor: goodFor,
|
|
hubermanFitScore: hubermanFitScore,
|
|
isCoreEngine: isCoreEngine,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$MethodologiesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MethodologiesTable,
|
|
Methodology,
|
|
$$MethodologiesTableFilterComposer,
|
|
$$MethodologiesTableOrderingComposer,
|
|
$$MethodologiesTableAnnotationComposer,
|
|
$$MethodologiesTableCreateCompanionBuilder,
|
|
$$MethodologiesTableUpdateCompanionBuilder,
|
|
(
|
|
Methodology,
|
|
BaseReferences<_$AppDatabase, $MethodologiesTable, Methodology>,
|
|
),
|
|
Methodology,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$FramePatternsTableCreateCompanionBuilder =
|
|
FramePatternsCompanion Function({
|
|
required String id,
|
|
Value<String?> domain,
|
|
required String avoidanceKeyword,
|
|
required String l0Example,
|
|
Value<String?> l1SimpleReplace,
|
|
required String l2Suggestion,
|
|
Value<String?> l3Identity,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$FramePatternsTableUpdateCompanionBuilder =
|
|
FramePatternsCompanion Function({
|
|
Value<String> id,
|
|
Value<String?> domain,
|
|
Value<String> avoidanceKeyword,
|
|
Value<String> l0Example,
|
|
Value<String?> l1SimpleReplace,
|
|
Value<String> l2Suggestion,
|
|
Value<String?> l3Identity,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$FramePatternsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $FramePatternsTable> {
|
|
$$FramePatternsTableFilterComposer({
|
|
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 domain => $composableBuilder(
|
|
column: $table.domain,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get avoidanceKeyword => $composableBuilder(
|
|
column: $table.avoidanceKeyword,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get l0Example => $composableBuilder(
|
|
column: $table.l0Example,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get l1SimpleReplace => $composableBuilder(
|
|
column: $table.l1SimpleReplace,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get l2Suggestion => $composableBuilder(
|
|
column: $table.l2Suggestion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get l3Identity => $composableBuilder(
|
|
column: $table.l3Identity,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$FramePatternsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $FramePatternsTable> {
|
|
$$FramePatternsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get domain => $composableBuilder(
|
|
column: $table.domain,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get avoidanceKeyword => $composableBuilder(
|
|
column: $table.avoidanceKeyword,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get l0Example => $composableBuilder(
|
|
column: $table.l0Example,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get l1SimpleReplace => $composableBuilder(
|
|
column: $table.l1SimpleReplace,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get l2Suggestion => $composableBuilder(
|
|
column: $table.l2Suggestion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get l3Identity => $composableBuilder(
|
|
column: $table.l3Identity,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$FramePatternsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $FramePatternsTable> {
|
|
$$FramePatternsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get domain =>
|
|
$composableBuilder(column: $table.domain, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get avoidanceKeyword => $composableBuilder(
|
|
column: $table.avoidanceKeyword,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get l0Example =>
|
|
$composableBuilder(column: $table.l0Example, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get l1SimpleReplace => $composableBuilder(
|
|
column: $table.l1SimpleReplace,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get l2Suggestion => $composableBuilder(
|
|
column: $table.l2Suggestion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get l3Identity => $composableBuilder(
|
|
column: $table.l3Identity,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$FramePatternsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$FramePatternsTable,
|
|
FramePattern,
|
|
$$FramePatternsTableFilterComposer,
|
|
$$FramePatternsTableOrderingComposer,
|
|
$$FramePatternsTableAnnotationComposer,
|
|
$$FramePatternsTableCreateCompanionBuilder,
|
|
$$FramePatternsTableUpdateCompanionBuilder,
|
|
(
|
|
FramePattern,
|
|
BaseReferences<_$AppDatabase, $FramePatternsTable, FramePattern>,
|
|
),
|
|
FramePattern,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$FramePatternsTableTableManager(_$AppDatabase db, $FramePatternsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$FramePatternsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$FramePatternsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$FramePatternsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String?> domain = const Value.absent(),
|
|
Value<String> avoidanceKeyword = const Value.absent(),
|
|
Value<String> l0Example = const Value.absent(),
|
|
Value<String?> l1SimpleReplace = const Value.absent(),
|
|
Value<String> l2Suggestion = const Value.absent(),
|
|
Value<String?> l3Identity = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FramePatternsCompanion(
|
|
id: id,
|
|
domain: domain,
|
|
avoidanceKeyword: avoidanceKeyword,
|
|
l0Example: l0Example,
|
|
l1SimpleReplace: l1SimpleReplace,
|
|
l2Suggestion: l2Suggestion,
|
|
l3Identity: l3Identity,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
Value<String?> domain = const Value.absent(),
|
|
required String avoidanceKeyword,
|
|
required String l0Example,
|
|
Value<String?> l1SimpleReplace = const Value.absent(),
|
|
required String l2Suggestion,
|
|
Value<String?> l3Identity = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FramePatternsCompanion.insert(
|
|
id: id,
|
|
domain: domain,
|
|
avoidanceKeyword: avoidanceKeyword,
|
|
l0Example: l0Example,
|
|
l1SimpleReplace: l1SimpleReplace,
|
|
l2Suggestion: l2Suggestion,
|
|
l3Identity: l3Identity,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$FramePatternsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$FramePatternsTable,
|
|
FramePattern,
|
|
$$FramePatternsTableFilterComposer,
|
|
$$FramePatternsTableOrderingComposer,
|
|
$$FramePatternsTableAnnotationComposer,
|
|
$$FramePatternsTableCreateCompanionBuilder,
|
|
$$FramePatternsTableUpdateCompanionBuilder,
|
|
(
|
|
FramePattern,
|
|
BaseReferences<_$AppDatabase, $FramePatternsTable, FramePattern>,
|
|
),
|
|
FramePattern,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$RewardMenuItemsTableCreateCompanionBuilder =
|
|
RewardMenuItemsCompanion Function({
|
|
required String id,
|
|
required String tierRecommended,
|
|
required String title,
|
|
Value<String?> description,
|
|
Value<int?> estimatedCostKrwMin,
|
|
Value<int?> estimatedCostKrwMax,
|
|
Value<bool?> isEffortTied,
|
|
Value<String?> tagsJson,
|
|
Value<String?> avoidForBreakHabitsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$RewardMenuItemsTableUpdateCompanionBuilder =
|
|
RewardMenuItemsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> tierRecommended,
|
|
Value<String> title,
|
|
Value<String?> description,
|
|
Value<int?> estimatedCostKrwMin,
|
|
Value<int?> estimatedCostKrwMax,
|
|
Value<bool?> isEffortTied,
|
|
Value<String?> tagsJson,
|
|
Value<String?> avoidForBreakHabitsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$RewardMenuItemsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $RewardMenuItemsTable> {
|
|
$$RewardMenuItemsTableFilterComposer({
|
|
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 tierRecommended => $composableBuilder(
|
|
column: $table.tierRecommended,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get estimatedCostKrwMin => $composableBuilder(
|
|
column: $table.estimatedCostKrwMin,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get estimatedCostKrwMax => $composableBuilder(
|
|
column: $table.estimatedCostKrwMax,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get tagsJson => $composableBuilder(
|
|
column: $table.tagsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get avoidForBreakHabitsJson => $composableBuilder(
|
|
column: $table.avoidForBreakHabitsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$RewardMenuItemsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $RewardMenuItemsTable> {
|
|
$$RewardMenuItemsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get tierRecommended => $composableBuilder(
|
|
column: $table.tierRecommended,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get estimatedCostKrwMin => $composableBuilder(
|
|
column: $table.estimatedCostKrwMin,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get estimatedCostKrwMax => $composableBuilder(
|
|
column: $table.estimatedCostKrwMax,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get tagsJson => $composableBuilder(
|
|
column: $table.tagsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get avoidForBreakHabitsJson => $composableBuilder(
|
|
column: $table.avoidForBreakHabitsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$RewardMenuItemsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $RewardMenuItemsTable> {
|
|
$$RewardMenuItemsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get tierRecommended => $composableBuilder(
|
|
column: $table.tierRecommended,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get estimatedCostKrwMin => $composableBuilder(
|
|
column: $table.estimatedCostKrwMin,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get estimatedCostKrwMax => $composableBuilder(
|
|
column: $table.estimatedCostKrwMax,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get tagsJson =>
|
|
$composableBuilder(column: $table.tagsJson, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get avoidForBreakHabitsJson => $composableBuilder(
|
|
column: $table.avoidForBreakHabitsJson,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$RewardMenuItemsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$RewardMenuItemsTable,
|
|
RewardMenuItem,
|
|
$$RewardMenuItemsTableFilterComposer,
|
|
$$RewardMenuItemsTableOrderingComposer,
|
|
$$RewardMenuItemsTableAnnotationComposer,
|
|
$$RewardMenuItemsTableCreateCompanionBuilder,
|
|
$$RewardMenuItemsTableUpdateCompanionBuilder,
|
|
(
|
|
RewardMenuItem,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$RewardMenuItemsTable,
|
|
RewardMenuItem
|
|
>,
|
|
),
|
|
RewardMenuItem,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$RewardMenuItemsTableTableManager(
|
|
_$AppDatabase db,
|
|
$RewardMenuItemsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$RewardMenuItemsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$RewardMenuItemsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$RewardMenuItemsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> tierRecommended = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMin = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMax = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
Value<String?> avoidForBreakHabitsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardMenuItemsCompanion(
|
|
id: id,
|
|
tierRecommended: tierRecommended,
|
|
title: title,
|
|
description: description,
|
|
estimatedCostKrwMin: estimatedCostKrwMin,
|
|
estimatedCostKrwMax: estimatedCostKrwMax,
|
|
isEffortTied: isEffortTied,
|
|
tagsJson: tagsJson,
|
|
avoidForBreakHabitsJson: avoidForBreakHabitsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String tierRecommended,
|
|
required String title,
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMin = const Value.absent(),
|
|
Value<int?> estimatedCostKrwMax = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
Value<String?> avoidForBreakHabitsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardMenuItemsCompanion.insert(
|
|
id: id,
|
|
tierRecommended: tierRecommended,
|
|
title: title,
|
|
description: description,
|
|
estimatedCostKrwMin: estimatedCostKrwMin,
|
|
estimatedCostKrwMax: estimatedCostKrwMax,
|
|
isEffortTied: isEffortTied,
|
|
tagsJson: tagsJson,
|
|
avoidForBreakHabitsJson: avoidForBreakHabitsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$RewardMenuItemsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$RewardMenuItemsTable,
|
|
RewardMenuItem,
|
|
$$RewardMenuItemsTableFilterComposer,
|
|
$$RewardMenuItemsTableOrderingComposer,
|
|
$$RewardMenuItemsTableAnnotationComposer,
|
|
$$RewardMenuItemsTableCreateCompanionBuilder,
|
|
$$RewardMenuItemsTableUpdateCompanionBuilder,
|
|
(
|
|
RewardMenuItem,
|
|
BaseReferences<_$AppDatabase, $RewardMenuItemsTable, RewardMenuItem>,
|
|
),
|
|
RewardMenuItem,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$ReferencesTableCreateCompanionBuilder =
|
|
ReferencesCompanion Function({
|
|
required String id,
|
|
required String kind,
|
|
required String title,
|
|
Value<String?> authorsJson,
|
|
Value<int?> year,
|
|
Value<String?> journal,
|
|
Value<String?> doi,
|
|
Value<String?> url,
|
|
Value<int?> episodeNumber,
|
|
Value<String?> publisher,
|
|
Value<String?> evidenceStrength,
|
|
Value<bool?> verified,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ReferencesTableUpdateCompanionBuilder =
|
|
ReferencesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> kind,
|
|
Value<String> title,
|
|
Value<String?> authorsJson,
|
|
Value<int?> year,
|
|
Value<String?> journal,
|
|
Value<String?> doi,
|
|
Value<String?> url,
|
|
Value<int?> episodeNumber,
|
|
Value<String?> publisher,
|
|
Value<String?> evidenceStrength,
|
|
Value<bool?> verified,
|
|
Value<String?> note,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ReferencesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ReferencesTable> {
|
|
$$ReferencesTableFilterComposer({
|
|
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 kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get authorsJson => $composableBuilder(
|
|
column: $table.authorsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get year => $composableBuilder(
|
|
column: $table.year,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get journal => $composableBuilder(
|
|
column: $table.journal,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get doi => $composableBuilder(
|
|
column: $table.doi,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get url => $composableBuilder(
|
|
column: $table.url,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get episodeNumber => $composableBuilder(
|
|
column: $table.episodeNumber,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get publisher => $composableBuilder(
|
|
column: $table.publisher,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get verified => $composableBuilder(
|
|
column: $table.verified,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ReferencesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ReferencesTable> {
|
|
$$ReferencesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kind => $composableBuilder(
|
|
column: $table.kind,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get authorsJson => $composableBuilder(
|
|
column: $table.authorsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get year => $composableBuilder(
|
|
column: $table.year,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get journal => $composableBuilder(
|
|
column: $table.journal,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get doi => $composableBuilder(
|
|
column: $table.doi,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get url => $composableBuilder(
|
|
column: $table.url,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get episodeNumber => $composableBuilder(
|
|
column: $table.episodeNumber,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get publisher => $composableBuilder(
|
|
column: $table.publisher,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get verified => $composableBuilder(
|
|
column: $table.verified,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ReferencesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ReferencesTable> {
|
|
$$ReferencesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get kind =>
|
|
$composableBuilder(column: $table.kind, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get authorsJson => $composableBuilder(
|
|
column: $table.authorsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get year =>
|
|
$composableBuilder(column: $table.year, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get journal =>
|
|
$composableBuilder(column: $table.journal, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get doi =>
|
|
$composableBuilder(column: $table.doi, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get url =>
|
|
$composableBuilder(column: $table.url, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get episodeNumber => $composableBuilder(
|
|
column: $table.episodeNumber,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get publisher =>
|
|
$composableBuilder(column: $table.publisher, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get verified =>
|
|
$composableBuilder(column: $table.verified, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
}
|
|
|
|
class $$ReferencesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ReferencesTable,
|
|
ReferenceRow,
|
|
$$ReferencesTableFilterComposer,
|
|
$$ReferencesTableOrderingComposer,
|
|
$$ReferencesTableAnnotationComposer,
|
|
$$ReferencesTableCreateCompanionBuilder,
|
|
$$ReferencesTableUpdateCompanionBuilder,
|
|
(
|
|
ReferenceRow,
|
|
BaseReferences<_$AppDatabase, $ReferencesTable, ReferenceRow>,
|
|
),
|
|
ReferenceRow,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ReferencesTableTableManager(_$AppDatabase db, $ReferencesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ReferencesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ReferencesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ReferencesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> kind = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String?> authorsJson = const Value.absent(),
|
|
Value<int?> year = const Value.absent(),
|
|
Value<String?> journal = const Value.absent(),
|
|
Value<String?> doi = const Value.absent(),
|
|
Value<String?> url = const Value.absent(),
|
|
Value<int?> episodeNumber = const Value.absent(),
|
|
Value<String?> publisher = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<bool?> verified = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ReferencesCompanion(
|
|
id: id,
|
|
kind: kind,
|
|
title: title,
|
|
authorsJson: authorsJson,
|
|
year: year,
|
|
journal: journal,
|
|
doi: doi,
|
|
url: url,
|
|
episodeNumber: episodeNumber,
|
|
publisher: publisher,
|
|
evidenceStrength: evidenceStrength,
|
|
verified: verified,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String kind,
|
|
required String title,
|
|
Value<String?> authorsJson = const Value.absent(),
|
|
Value<int?> year = const Value.absent(),
|
|
Value<String?> journal = const Value.absent(),
|
|
Value<String?> doi = const Value.absent(),
|
|
Value<String?> url = const Value.absent(),
|
|
Value<int?> episodeNumber = const Value.absent(),
|
|
Value<String?> publisher = const Value.absent(),
|
|
Value<String?> evidenceStrength = const Value.absent(),
|
|
Value<bool?> verified = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ReferencesCompanion.insert(
|
|
id: id,
|
|
kind: kind,
|
|
title: title,
|
|
authorsJson: authorsJson,
|
|
year: year,
|
|
journal: journal,
|
|
doi: doi,
|
|
url: url,
|
|
episodeNumber: episodeNumber,
|
|
publisher: publisher,
|
|
evidenceStrength: evidenceStrength,
|
|
verified: verified,
|
|
note: note,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ReferencesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ReferencesTable,
|
|
ReferenceRow,
|
|
$$ReferencesTableFilterComposer,
|
|
$$ReferencesTableOrderingComposer,
|
|
$$ReferencesTableAnnotationComposer,
|
|
$$ReferencesTableCreateCompanionBuilder,
|
|
$$ReferencesTableUpdateCompanionBuilder,
|
|
(
|
|
ReferenceRow,
|
|
BaseReferences<_$AppDatabase, $ReferencesTable, ReferenceRow>,
|
|
),
|
|
ReferenceRow,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$DietPatternsTableCreateCompanionBuilder =
|
|
DietPatternsCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required String core,
|
|
Value<String?> strengthsJson,
|
|
Value<String?> weaknessesJson,
|
|
required String evidenceStrength,
|
|
Value<String?> koreanContextFit,
|
|
Value<String?> starterLeversJson,
|
|
Value<String?> medicalWarning,
|
|
Value<String?> linkedProtocolIdsJson,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$DietPatternsTableUpdateCompanionBuilder =
|
|
DietPatternsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String> core,
|
|
Value<String?> strengthsJson,
|
|
Value<String?> weaknessesJson,
|
|
Value<String> evidenceStrength,
|
|
Value<String?> koreanContextFit,
|
|
Value<String?> starterLeversJson,
|
|
Value<String?> medicalWarning,
|
|
Value<String?> linkedProtocolIdsJson,
|
|
Value<String?> referenceIdsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$DietPatternsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $DietPatternsTable> {
|
|
$$DietPatternsTableFilterComposer({
|
|
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<String> get core => $composableBuilder(
|
|
column: $table.core,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get koreanContextFit => $composableBuilder(
|
|
column: $table.koreanContextFit,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get starterLeversJson => $composableBuilder(
|
|
column: $table.starterLeversJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get linkedProtocolIdsJson => $composableBuilder(
|
|
column: $table.linkedProtocolIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$DietPatternsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $DietPatternsTable> {
|
|
$$DietPatternsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get core => $composableBuilder(
|
|
column: $table.core,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get koreanContextFit => $composableBuilder(
|
|
column: $table.koreanContextFit,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get starterLeversJson => $composableBuilder(
|
|
column: $table.starterLeversJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get linkedProtocolIdsJson => $composableBuilder(
|
|
column: $table.linkedProtocolIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$DietPatternsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $DietPatternsTable> {
|
|
$$DietPatternsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get core =>
|
|
$composableBuilder(column: $table.core, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get strengthsJson => $composableBuilder(
|
|
column: $table.strengthsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get weaknessesJson => $composableBuilder(
|
|
column: $table.weaknessesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get evidenceStrength => $composableBuilder(
|
|
column: $table.evidenceStrength,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get koreanContextFit => $composableBuilder(
|
|
column: $table.koreanContextFit,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get starterLeversJson => $composableBuilder(
|
|
column: $table.starterLeversJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get medicalWarning => $composableBuilder(
|
|
column: $table.medicalWarning,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get linkedProtocolIdsJson => $composableBuilder(
|
|
column: $table.linkedProtocolIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get referenceIdsJson => $composableBuilder(
|
|
column: $table.referenceIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$DietPatternsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$DietPatternsTable,
|
|
DietPattern,
|
|
$$DietPatternsTableFilterComposer,
|
|
$$DietPatternsTableOrderingComposer,
|
|
$$DietPatternsTableAnnotationComposer,
|
|
$$DietPatternsTableCreateCompanionBuilder,
|
|
$$DietPatternsTableUpdateCompanionBuilder,
|
|
(
|
|
DietPattern,
|
|
BaseReferences<_$AppDatabase, $DietPatternsTable, DietPattern>,
|
|
),
|
|
DietPattern,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$DietPatternsTableTableManager(_$AppDatabase db, $DietPatternsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$DietPatternsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$DietPatternsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$DietPatternsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> core = const Value.absent(),
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
Value<String> evidenceStrength = const Value.absent(),
|
|
Value<String?> koreanContextFit = const Value.absent(),
|
|
Value<String?> starterLeversJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> linkedProtocolIdsJson = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => DietPatternsCompanion(
|
|
id: id,
|
|
name: name,
|
|
core: core,
|
|
strengthsJson: strengthsJson,
|
|
weaknessesJson: weaknessesJson,
|
|
evidenceStrength: evidenceStrength,
|
|
koreanContextFit: koreanContextFit,
|
|
starterLeversJson: starterLeversJson,
|
|
medicalWarning: medicalWarning,
|
|
linkedProtocolIdsJson: linkedProtocolIdsJson,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
required String core,
|
|
Value<String?> strengthsJson = const Value.absent(),
|
|
Value<String?> weaknessesJson = const Value.absent(),
|
|
required String evidenceStrength,
|
|
Value<String?> koreanContextFit = const Value.absent(),
|
|
Value<String?> starterLeversJson = const Value.absent(),
|
|
Value<String?> medicalWarning = const Value.absent(),
|
|
Value<String?> linkedProtocolIdsJson = const Value.absent(),
|
|
Value<String?> referenceIdsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => DietPatternsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
core: core,
|
|
strengthsJson: strengthsJson,
|
|
weaknessesJson: weaknessesJson,
|
|
evidenceStrength: evidenceStrength,
|
|
koreanContextFit: koreanContextFit,
|
|
starterLeversJson: starterLeversJson,
|
|
medicalWarning: medicalWarning,
|
|
linkedProtocolIdsJson: linkedProtocolIdsJson,
|
|
referenceIdsJson: referenceIdsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$DietPatternsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$DietPatternsTable,
|
|
DietPattern,
|
|
$$DietPatternsTableFilterComposer,
|
|
$$DietPatternsTableOrderingComposer,
|
|
$$DietPatternsTableAnnotationComposer,
|
|
$$DietPatternsTableCreateCompanionBuilder,
|
|
$$DietPatternsTableUpdateCompanionBuilder,
|
|
(
|
|
DietPattern,
|
|
BaseReferences<_$AppDatabase, $DietPatternsTable, DietPattern>,
|
|
),
|
|
DietPattern,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$UsersTableCreateCompanionBuilder =
|
|
UsersCompanion Function({
|
|
required String id,
|
|
Value<String?> displayName,
|
|
Value<String> locale,
|
|
Value<String> timezone,
|
|
required String createdAt,
|
|
Value<String?> preferencesJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$UsersTableUpdateCompanionBuilder =
|
|
UsersCompanion Function({
|
|
Value<String> id,
|
|
Value<String?> displayName,
|
|
Value<String> locale,
|
|
Value<String> timezone,
|
|
Value<String> createdAt,
|
|
Value<String?> preferencesJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$UsersTableReferences
|
|
extends BaseReferences<_$AppDatabase, $UsersTable, User> {
|
|
$$UsersTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$PhasesTable, List<Phase>> _phasesRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.phases,
|
|
aliasName: $_aliasNameGenerator(db.users.id, db.phases.userId),
|
|
);
|
|
|
|
$$PhasesTableProcessedTableManager get phasesRefs {
|
|
final manager = $$PhasesTableTableManager(
|
|
$_db,
|
|
$_db.phases,
|
|
).filter((f) => f.userId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_phasesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$HabitsTable, List<Habit>> _habitsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.habits,
|
|
aliasName: $_aliasNameGenerator(db.users.id, db.habits.userId),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitsRefs {
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.userId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_habitsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ReflectionsTable, List<Reflection>>
|
|
_reflectionsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.reflections,
|
|
aliasName: $_aliasNameGenerator(db.users.id, db.reflections.userId),
|
|
);
|
|
|
|
$$ReflectionsTableProcessedTableManager get reflectionsRefs {
|
|
final manager = $$ReflectionsTableTableManager(
|
|
$_db,
|
|
$_db.reflections,
|
|
).filter((f) => f.userId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_reflectionsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$UsersTableFilterComposer extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get locale => $composableBuilder(
|
|
column: $table.locale,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get timezone => $composableBuilder(
|
|
column: $table.timezone,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get preferencesJson => $composableBuilder(
|
|
column: $table.preferencesJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> phasesRefs(
|
|
Expression<bool> Function($$PhasesTableFilterComposer f) f,
|
|
) {
|
|
final $$PhasesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> habitsRefs(
|
|
Expression<bool> Function($$HabitsTableFilterComposer f) f,
|
|
) {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> reflectionsRefs(
|
|
Expression<bool> Function($$ReflectionsTableFilterComposer f) f,
|
|
) {
|
|
final $$ReflectionsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.reflections,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ReflectionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.reflections,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$UsersTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get locale => $composableBuilder(
|
|
column: $table.locale,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get timezone => $composableBuilder(
|
|
column: $table.timezone,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get preferencesJson => $composableBuilder(
|
|
column: $table.preferencesJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$UsersTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get displayName => $composableBuilder(
|
|
column: $table.displayName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get locale =>
|
|
$composableBuilder(column: $table.locale, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get timezone =>
|
|
$composableBuilder(column: $table.timezone, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get preferencesJson => $composableBuilder(
|
|
column: $table.preferencesJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
Expression<T> phasesRefs<T extends Object>(
|
|
Expression<T> Function($$PhasesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$PhasesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> habitsRefs<T extends Object>(
|
|
Expression<T> Function($$HabitsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> reflectionsRefs<T extends Object>(
|
|
Expression<T> Function($$ReflectionsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ReflectionsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.reflections,
|
|
getReferencedColumn: (t) => t.userId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ReflectionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.reflections,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$UsersTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$UsersTable,
|
|
User,
|
|
$$UsersTableFilterComposer,
|
|
$$UsersTableOrderingComposer,
|
|
$$UsersTableAnnotationComposer,
|
|
$$UsersTableCreateCompanionBuilder,
|
|
$$UsersTableUpdateCompanionBuilder,
|
|
(User, $$UsersTableReferences),
|
|
User,
|
|
PrefetchHooks Function({
|
|
bool phasesRefs,
|
|
bool habitsRefs,
|
|
bool reflectionsRefs,
|
|
})
|
|
> {
|
|
$$UsersTableTableManager(_$AppDatabase db, $UsersTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$UsersTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$UsersTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$UsersTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String?> displayName = const Value.absent(),
|
|
Value<String> locale = const Value.absent(),
|
|
Value<String> timezone = const Value.absent(),
|
|
Value<String> createdAt = const Value.absent(),
|
|
Value<String?> preferencesJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => UsersCompanion(
|
|
id: id,
|
|
displayName: displayName,
|
|
locale: locale,
|
|
timezone: timezone,
|
|
createdAt: createdAt,
|
|
preferencesJson: preferencesJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
Value<String?> displayName = const Value.absent(),
|
|
Value<String> locale = const Value.absent(),
|
|
Value<String> timezone = const Value.absent(),
|
|
required String createdAt,
|
|
Value<String?> preferencesJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => UsersCompanion.insert(
|
|
id: id,
|
|
displayName: displayName,
|
|
locale: locale,
|
|
timezone: timezone,
|
|
createdAt: createdAt,
|
|
preferencesJson: preferencesJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) =>
|
|
(e.readTable(table), $$UsersTableReferences(db, table, e)),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
phasesRefs = false,
|
|
habitsRefs = false,
|
|
reflectionsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (phasesRefs) db.phases,
|
|
if (habitsRefs) db.habits,
|
|
if (reflectionsRefs) db.reflections,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (phasesRefs)
|
|
await $_getPrefetchedData<User, $UsersTable, Phase>(
|
|
currentTable: table,
|
|
referencedTable: $$UsersTableReferences
|
|
._phasesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$UsersTableReferences(db, table, p0).phasesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.userId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (habitsRefs)
|
|
await $_getPrefetchedData<User, $UsersTable, Habit>(
|
|
currentTable: table,
|
|
referencedTable: $$UsersTableReferences
|
|
._habitsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$UsersTableReferences(db, table, p0).habitsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.userId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (reflectionsRefs)
|
|
await $_getPrefetchedData<
|
|
User,
|
|
$UsersTable,
|
|
Reflection
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$UsersTableReferences
|
|
._reflectionsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$UsersTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).reflectionsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.userId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$UsersTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$UsersTable,
|
|
User,
|
|
$$UsersTableFilterComposer,
|
|
$$UsersTableOrderingComposer,
|
|
$$UsersTableAnnotationComposer,
|
|
$$UsersTableCreateCompanionBuilder,
|
|
$$UsersTableUpdateCompanionBuilder,
|
|
(User, $$UsersTableReferences),
|
|
User,
|
|
PrefetchHooks Function({
|
|
bool phasesRefs,
|
|
bool habitsRefs,
|
|
bool reflectionsRefs,
|
|
})
|
|
>;
|
|
typedef $$PhasesTableCreateCompanionBuilder =
|
|
PhasesCompanion Function({
|
|
required String id,
|
|
required String userId,
|
|
Value<String?> title,
|
|
required String startedAt,
|
|
Value<String?> endedAt,
|
|
Value<int> durationWeeks,
|
|
required String status,
|
|
Value<String?> intentionText,
|
|
Value<bool> rewardDeclarationsLocked,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PhasesTableUpdateCompanionBuilder =
|
|
PhasesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> userId,
|
|
Value<String?> title,
|
|
Value<String> startedAt,
|
|
Value<String?> endedAt,
|
|
Value<int> durationWeeks,
|
|
Value<String> status,
|
|
Value<String?> intentionText,
|
|
Value<bool> rewardDeclarationsLocked,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$PhasesTableReferences
|
|
extends BaseReferences<_$AppDatabase, $PhasesTable, Phase> {
|
|
$$PhasesTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $UsersTable _userIdTable(_$AppDatabase db) =>
|
|
db.users.createAlias($_aliasNameGenerator(db.phases.userId, db.users.id));
|
|
|
|
$$UsersTableProcessedTableManager get userId {
|
|
final $_column = $_itemColumn<String>('user_id')!;
|
|
|
|
final manager = $$UsersTableTableManager(
|
|
$_db,
|
|
$_db.users,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$HabitsTable, List<Habit>> _habitsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.habits,
|
|
aliasName: $_aliasNameGenerator(db.phases.id, db.habits.phaseId),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitsRefs {
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.phaseId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_habitsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$RewardDeclarationsTable, List<RewardDeclaration>>
|
|
_rewardDeclarationsRefsTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.rewardDeclarations,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.phases.id,
|
|
db.rewardDeclarations.phaseId,
|
|
),
|
|
);
|
|
|
|
$$RewardDeclarationsTableProcessedTableManager get rewardDeclarationsRefs {
|
|
final manager = $$RewardDeclarationsTableTableManager(
|
|
$_db,
|
|
$_db.rewardDeclarations,
|
|
).filter((f) => f.phaseId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_rewardDeclarationsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ReflectionsTable, List<Reflection>>
|
|
_reflectionsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.reflections,
|
|
aliasName: $_aliasNameGenerator(db.phases.id, db.reflections.phaseId),
|
|
);
|
|
|
|
$$ReflectionsTableProcessedTableManager get reflectionsRefs {
|
|
final manager = $$ReflectionsTableTableManager(
|
|
$_db,
|
|
$_db.reflections,
|
|
).filter((f) => f.phaseId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_reflectionsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$PhasesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $PhasesTable> {
|
|
$$PhasesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<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 startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get durationWeeks => $composableBuilder(
|
|
column: $table.durationWeeks,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get intentionText => $composableBuilder(
|
|
column: $table.intentionText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get rewardDeclarationsLocked => $composableBuilder(
|
|
column: $table.rewardDeclarationsLocked,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$UsersTableFilterComposer get userId {
|
|
final $$UsersTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> habitsRefs(
|
|
Expression<bool> Function($$HabitsTableFilterComposer f) f,
|
|
) {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> rewardDeclarationsRefs(
|
|
Expression<bool> Function($$RewardDeclarationsTableFilterComposer f) f,
|
|
) {
|
|
final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> reflectionsRefs(
|
|
Expression<bool> Function($$ReflectionsTableFilterComposer f) f,
|
|
) {
|
|
final $$ReflectionsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.reflections,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ReflectionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.reflections,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$PhasesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $PhasesTable> {
|
|
$$PhasesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<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 startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get durationWeeks => $composableBuilder(
|
|
column: $table.durationWeeks,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get intentionText => $composableBuilder(
|
|
column: $table.intentionText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get rewardDeclarationsLocked => $composableBuilder(
|
|
column: $table.rewardDeclarationsLocked,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$UsersTableOrderingComposer get userId {
|
|
final $$UsersTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PhasesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $PhasesTable> {
|
|
$$PhasesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get endedAt =>
|
|
$composableBuilder(column: $table.endedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get durationWeeks => $composableBuilder(
|
|
column: $table.durationWeeks,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get intentionText => $composableBuilder(
|
|
column: $table.intentionText,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get rewardDeclarationsLocked => $composableBuilder(
|
|
column: $table.rewardDeclarationsLocked,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$UsersTableAnnotationComposer get userId {
|
|
final $$UsersTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> habitsRefs<T extends Object>(
|
|
Expression<T> Function($$HabitsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> rewardDeclarationsRefs<T extends Object>(
|
|
Expression<T> Function($$RewardDeclarationsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$RewardDeclarationsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> reflectionsRefs<T extends Object>(
|
|
Expression<T> Function($$ReflectionsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ReflectionsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.reflections,
|
|
getReferencedColumn: (t) => t.phaseId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ReflectionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.reflections,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$PhasesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$PhasesTable,
|
|
Phase,
|
|
$$PhasesTableFilterComposer,
|
|
$$PhasesTableOrderingComposer,
|
|
$$PhasesTableAnnotationComposer,
|
|
$$PhasesTableCreateCompanionBuilder,
|
|
$$PhasesTableUpdateCompanionBuilder,
|
|
(Phase, $$PhasesTableReferences),
|
|
Phase,
|
|
PrefetchHooks Function({
|
|
bool userId,
|
|
bool habitsRefs,
|
|
bool rewardDeclarationsRefs,
|
|
bool reflectionsRefs,
|
|
})
|
|
> {
|
|
$$PhasesTableTableManager(_$AppDatabase db, $PhasesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PhasesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PhasesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PhasesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> userId = const Value.absent(),
|
|
Value<String?> title = const Value.absent(),
|
|
Value<String> startedAt = const Value.absent(),
|
|
Value<String?> endedAt = const Value.absent(),
|
|
Value<int> durationWeeks = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<String?> intentionText = const Value.absent(),
|
|
Value<bool> rewardDeclarationsLocked = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PhasesCompanion(
|
|
id: id,
|
|
userId: userId,
|
|
title: title,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
durationWeeks: durationWeeks,
|
|
status: status,
|
|
intentionText: intentionText,
|
|
rewardDeclarationsLocked: rewardDeclarationsLocked,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String userId,
|
|
Value<String?> title = const Value.absent(),
|
|
required String startedAt,
|
|
Value<String?> endedAt = const Value.absent(),
|
|
Value<int> durationWeeks = const Value.absent(),
|
|
required String status,
|
|
Value<String?> intentionText = const Value.absent(),
|
|
Value<bool> rewardDeclarationsLocked = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PhasesCompanion.insert(
|
|
id: id,
|
|
userId: userId,
|
|
title: title,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
durationWeeks: durationWeeks,
|
|
status: status,
|
|
intentionText: intentionText,
|
|
rewardDeclarationsLocked: rewardDeclarationsLocked,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) =>
|
|
(e.readTable(table), $$PhasesTableReferences(db, table, e)),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
userId = false,
|
|
habitsRefs = false,
|
|
rewardDeclarationsRefs = false,
|
|
reflectionsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (habitsRefs) db.habits,
|
|
if (rewardDeclarationsRefs) db.rewardDeclarations,
|
|
if (reflectionsRefs) db.reflections,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (userId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.userId,
|
|
referencedTable: $$PhasesTableReferences
|
|
._userIdTable(db),
|
|
referencedColumn: $$PhasesTableReferences
|
|
._userIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (habitsRefs)
|
|
await $_getPrefetchedData<Phase, $PhasesTable, Habit>(
|
|
currentTable: table,
|
|
referencedTable: $$PhasesTableReferences
|
|
._habitsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$PhasesTableReferences(db, table, p0).habitsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.phaseId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (rewardDeclarationsRefs)
|
|
await $_getPrefetchedData<
|
|
Phase,
|
|
$PhasesTable,
|
|
RewardDeclaration
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$PhasesTableReferences
|
|
._rewardDeclarationsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$PhasesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).rewardDeclarationsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.phaseId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (reflectionsRefs)
|
|
await $_getPrefetchedData<
|
|
Phase,
|
|
$PhasesTable,
|
|
Reflection
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$PhasesTableReferences
|
|
._reflectionsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$PhasesTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).reflectionsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.phaseId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PhasesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$PhasesTable,
|
|
Phase,
|
|
$$PhasesTableFilterComposer,
|
|
$$PhasesTableOrderingComposer,
|
|
$$PhasesTableAnnotationComposer,
|
|
$$PhasesTableCreateCompanionBuilder,
|
|
$$PhasesTableUpdateCompanionBuilder,
|
|
(Phase, $$PhasesTableReferences),
|
|
Phase,
|
|
PrefetchHooks Function({
|
|
bool userId,
|
|
bool habitsRefs,
|
|
bool rewardDeclarationsRefs,
|
|
bool reflectionsRefs,
|
|
})
|
|
>;
|
|
typedef $$HabitsTableCreateCompanionBuilder =
|
|
HabitsCompanion Function({
|
|
required String id,
|
|
required String userId,
|
|
Value<String?> phaseId,
|
|
required String type,
|
|
required String status,
|
|
required String title,
|
|
Value<String?> protocolId,
|
|
Value<String?> breakProtocolId,
|
|
Value<String?> commonFrameIdsJson,
|
|
required String frameLevel,
|
|
Value<String?> frameOriginalText,
|
|
required String frameFramedText,
|
|
Value<String?> anchorWhen,
|
|
Value<String?> anchorAfterWhat,
|
|
Value<String?> anchorWhere,
|
|
Value<int?> stackPosition,
|
|
Value<String?> minDose,
|
|
Value<String?> targetDose,
|
|
required String startedAt,
|
|
Value<String?> endedAt,
|
|
Value<String?> tagsJson,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$HabitsTableUpdateCompanionBuilder =
|
|
HabitsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> userId,
|
|
Value<String?> phaseId,
|
|
Value<String> type,
|
|
Value<String> status,
|
|
Value<String> title,
|
|
Value<String?> protocolId,
|
|
Value<String?> breakProtocolId,
|
|
Value<String?> commonFrameIdsJson,
|
|
Value<String> frameLevel,
|
|
Value<String?> frameOriginalText,
|
|
Value<String> frameFramedText,
|
|
Value<String?> anchorWhen,
|
|
Value<String?> anchorAfterWhat,
|
|
Value<String?> anchorWhere,
|
|
Value<int?> stackPosition,
|
|
Value<String?> minDose,
|
|
Value<String?> targetDose,
|
|
Value<String> startedAt,
|
|
Value<String?> endedAt,
|
|
Value<String?> tagsJson,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$HabitsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $HabitsTable, Habit> {
|
|
$$HabitsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $UsersTable _userIdTable(_$AppDatabase db) =>
|
|
db.users.createAlias($_aliasNameGenerator(db.habits.userId, db.users.id));
|
|
|
|
$$UsersTableProcessedTableManager get userId {
|
|
final $_column = $_itemColumn<String>('user_id')!;
|
|
|
|
final manager = $$UsersTableTableManager(
|
|
$_db,
|
|
$_db.users,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias(
|
|
$_aliasNameGenerator(db.habits.phaseId, db.phases.id),
|
|
);
|
|
|
|
$$PhasesTableProcessedTableManager? get phaseId {
|
|
final $_column = $_itemColumn<String>('phase_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$PhasesTableTableManager(
|
|
$_db,
|
|
$_db.phases,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_phaseIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$HabitDoseVariantsTable, List<HabitDoseVariant>>
|
|
_habitDoseVariantsRefsTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.habitDoseVariants,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.habits.id,
|
|
db.habitDoseVariants.habitId,
|
|
),
|
|
);
|
|
|
|
$$HabitDoseVariantsTableProcessedTableManager get habitDoseVariantsRefs {
|
|
final manager = $$HabitDoseVariantsTableTableManager(
|
|
$_db,
|
|
$_db.habitDoseVariants,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_habitDoseVariantsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$IfThenRulesTable, List<IfThenRule>>
|
|
_ifThenRulesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.ifThenRules,
|
|
aliasName: $_aliasNameGenerator(db.habits.id, db.ifThenRules.habitId),
|
|
);
|
|
|
|
$$IfThenRulesTableProcessedTableManager get ifThenRulesRefs {
|
|
final manager = $$IfThenRulesTableTableManager(
|
|
$_db,
|
|
$_db.ifThenRules,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_ifThenRulesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$TrackerEntriesTable, List<TrackerEntry>>
|
|
_trackerEntriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.trackerEntries,
|
|
aliasName: $_aliasNameGenerator(db.habits.id, db.trackerEntries.habitId),
|
|
);
|
|
|
|
$$TrackerEntriesTableProcessedTableManager get trackerEntriesRefs {
|
|
final manager = $$TrackerEntriesTableTableManager(
|
|
$_db,
|
|
$_db.trackerEntries,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_trackerEntriesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$LapseLogsTable, List<LapseLog>>
|
|
_lapseLogsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.lapseLogs,
|
|
aliasName: $_aliasNameGenerator(db.habits.id, db.lapseLogs.habitId),
|
|
);
|
|
|
|
$$LapseLogsTableProcessedTableManager get lapseLogsRefs {
|
|
final manager = $$LapseLogsTableTableManager(
|
|
$_db,
|
|
$_db.lapseLogs,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_lapseLogsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$UrgeLogsTable, List<UrgeLog>> _urgeLogsRefsTable(
|
|
_$AppDatabase db,
|
|
) => MultiTypedResultKey.fromTable(
|
|
db.urgeLogs,
|
|
aliasName: $_aliasNameGenerator(db.habits.id, db.urgeLogs.habitId),
|
|
);
|
|
|
|
$$UrgeLogsTableProcessedTableManager get urgeLogsRefs {
|
|
final manager = $$UrgeLogsTableTableManager(
|
|
$_db,
|
|
$_db.urgeLogs,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_urgeLogsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$RewardDeclarationsTable, List<RewardDeclaration>>
|
|
_rewardDeclarationsRefsTable(_$AppDatabase db) =>
|
|
MultiTypedResultKey.fromTable(
|
|
db.rewardDeclarations,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.habits.id,
|
|
db.rewardDeclarations.habitId,
|
|
),
|
|
);
|
|
|
|
$$RewardDeclarationsTableProcessedTableManager get rewardDeclarationsRefs {
|
|
final manager = $$RewardDeclarationsTableTableManager(
|
|
$_db,
|
|
$_db.rewardDeclarations,
|
|
).filter((f) => f.habitId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_rewardDeclarationsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$HabitsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $HabitsTable> {
|
|
$$HabitsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get protocolId => $composableBuilder(
|
|
column: $table.protocolId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get breakProtocolId => $composableBuilder(
|
|
column: $table.breakProtocolId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get commonFrameIdsJson => $composableBuilder(
|
|
column: $table.commonFrameIdsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get frameLevel => $composableBuilder(
|
|
column: $table.frameLevel,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get frameOriginalText => $composableBuilder(
|
|
column: $table.frameOriginalText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get frameFramedText => $composableBuilder(
|
|
column: $table.frameFramedText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get anchorWhen => $composableBuilder(
|
|
column: $table.anchorWhen,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get anchorAfterWhat => $composableBuilder(
|
|
column: $table.anchorAfterWhat,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get anchorWhere => $composableBuilder(
|
|
column: $table.anchorWhere,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get stackPosition => $composableBuilder(
|
|
column: $table.stackPosition,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get minDose => $composableBuilder(
|
|
column: $table.minDose,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get targetDose => $composableBuilder(
|
|
column: $table.targetDose,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get tagsJson => $composableBuilder(
|
|
column: $table.tagsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$UsersTableFilterComposer get userId {
|
|
final $$UsersTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableFilterComposer get phaseId {
|
|
final $$PhasesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> habitDoseVariantsRefs(
|
|
Expression<bool> Function($$HabitDoseVariantsTableFilterComposer f) f,
|
|
) {
|
|
final $$HabitDoseVariantsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habitDoseVariants,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitDoseVariantsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habitDoseVariants,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> ifThenRulesRefs(
|
|
Expression<bool> Function($$IfThenRulesTableFilterComposer f) f,
|
|
) {
|
|
final $$IfThenRulesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.ifThenRules,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$IfThenRulesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.ifThenRules,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> trackerEntriesRefs(
|
|
Expression<bool> Function($$TrackerEntriesTableFilterComposer f) f,
|
|
) {
|
|
final $$TrackerEntriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.trackerEntries,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TrackerEntriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.trackerEntries,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> lapseLogsRefs(
|
|
Expression<bool> Function($$LapseLogsTableFilterComposer f) f,
|
|
) {
|
|
final $$LapseLogsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.lapseLogs,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$LapseLogsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.lapseLogs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> urgeLogsRefs(
|
|
Expression<bool> Function($$UrgeLogsTableFilterComposer f) f,
|
|
) {
|
|
final $$UrgeLogsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.urgeLogs,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UrgeLogsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.urgeLogs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> rewardDeclarationsRefs(
|
|
Expression<bool> Function($$RewardDeclarationsTableFilterComposer f) f,
|
|
) {
|
|
final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$HabitsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $HabitsTable> {
|
|
$$HabitsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get protocolId => $composableBuilder(
|
|
column: $table.protocolId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get breakProtocolId => $composableBuilder(
|
|
column: $table.breakProtocolId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get commonFrameIdsJson => $composableBuilder(
|
|
column: $table.commonFrameIdsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get frameLevel => $composableBuilder(
|
|
column: $table.frameLevel,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get frameOriginalText => $composableBuilder(
|
|
column: $table.frameOriginalText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get frameFramedText => $composableBuilder(
|
|
column: $table.frameFramedText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get anchorWhen => $composableBuilder(
|
|
column: $table.anchorWhen,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get anchorAfterWhat => $composableBuilder(
|
|
column: $table.anchorAfterWhat,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get anchorWhere => $composableBuilder(
|
|
column: $table.anchorWhere,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get stackPosition => $composableBuilder(
|
|
column: $table.stackPosition,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get minDose => $composableBuilder(
|
|
column: $table.minDose,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get targetDose => $composableBuilder(
|
|
column: $table.targetDose,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get startedAt => $composableBuilder(
|
|
column: $table.startedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get endedAt => $composableBuilder(
|
|
column: $table.endedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get tagsJson => $composableBuilder(
|
|
column: $table.tagsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$UsersTableOrderingComposer get userId {
|
|
final $$UsersTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableOrderingComposer get phaseId {
|
|
final $$PhasesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$HabitsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $HabitsTable> {
|
|
$$HabitsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get type =>
|
|
$composableBuilder(column: $table.type, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get protocolId => $composableBuilder(
|
|
column: $table.protocolId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get breakProtocolId => $composableBuilder(
|
|
column: $table.breakProtocolId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get commonFrameIdsJson => $composableBuilder(
|
|
column: $table.commonFrameIdsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get frameLevel => $composableBuilder(
|
|
column: $table.frameLevel,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get frameOriginalText => $composableBuilder(
|
|
column: $table.frameOriginalText,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get frameFramedText => $composableBuilder(
|
|
column: $table.frameFramedText,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get anchorWhen => $composableBuilder(
|
|
column: $table.anchorWhen,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get anchorAfterWhat => $composableBuilder(
|
|
column: $table.anchorAfterWhat,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get anchorWhere => $composableBuilder(
|
|
column: $table.anchorWhere,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get stackPosition => $composableBuilder(
|
|
column: $table.stackPosition,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get minDose =>
|
|
$composableBuilder(column: $table.minDose, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get targetDose => $composableBuilder(
|
|
column: $table.targetDose,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get startedAt =>
|
|
$composableBuilder(column: $table.startedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get endedAt =>
|
|
$composableBuilder(column: $table.endedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get tagsJson =>
|
|
$composableBuilder(column: $table.tagsJson, builder: (column) => column);
|
|
|
|
$$UsersTableAnnotationComposer get userId {
|
|
final $$UsersTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableAnnotationComposer get phaseId {
|
|
final $$PhasesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> habitDoseVariantsRefs<T extends Object>(
|
|
Expression<T> Function($$HabitDoseVariantsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$HabitDoseVariantsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.habitDoseVariants,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitDoseVariantsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habitDoseVariants,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> ifThenRulesRefs<T extends Object>(
|
|
Expression<T> Function($$IfThenRulesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$IfThenRulesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.ifThenRules,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$IfThenRulesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.ifThenRules,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> trackerEntriesRefs<T extends Object>(
|
|
Expression<T> Function($$TrackerEntriesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$TrackerEntriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.trackerEntries,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TrackerEntriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.trackerEntries,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> lapseLogsRefs<T extends Object>(
|
|
Expression<T> Function($$LapseLogsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$LapseLogsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.lapseLogs,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$LapseLogsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.lapseLogs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> urgeLogsRefs<T extends Object>(
|
|
Expression<T> Function($$UrgeLogsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$UrgeLogsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.urgeLogs,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UrgeLogsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.urgeLogs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> rewardDeclarationsRefs<T extends Object>(
|
|
Expression<T> Function($$RewardDeclarationsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$RewardDeclarationsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.habitId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$HabitsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$HabitsTable,
|
|
Habit,
|
|
$$HabitsTableFilterComposer,
|
|
$$HabitsTableOrderingComposer,
|
|
$$HabitsTableAnnotationComposer,
|
|
$$HabitsTableCreateCompanionBuilder,
|
|
$$HabitsTableUpdateCompanionBuilder,
|
|
(Habit, $$HabitsTableReferences),
|
|
Habit,
|
|
PrefetchHooks Function({
|
|
bool userId,
|
|
bool phaseId,
|
|
bool habitDoseVariantsRefs,
|
|
bool ifThenRulesRefs,
|
|
bool trackerEntriesRefs,
|
|
bool lapseLogsRefs,
|
|
bool urgeLogsRefs,
|
|
bool rewardDeclarationsRefs,
|
|
})
|
|
> {
|
|
$$HabitsTableTableManager(_$AppDatabase db, $HabitsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$HabitsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$HabitsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$HabitsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> userId = const Value.absent(),
|
|
Value<String?> phaseId = const Value.absent(),
|
|
Value<String> type = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String?> protocolId = const Value.absent(),
|
|
Value<String?> breakProtocolId = const Value.absent(),
|
|
Value<String?> commonFrameIdsJson = const Value.absent(),
|
|
Value<String> frameLevel = const Value.absent(),
|
|
Value<String?> frameOriginalText = const Value.absent(),
|
|
Value<String> frameFramedText = const Value.absent(),
|
|
Value<String?> anchorWhen = const Value.absent(),
|
|
Value<String?> anchorAfterWhat = const Value.absent(),
|
|
Value<String?> anchorWhere = const Value.absent(),
|
|
Value<int?> stackPosition = const Value.absent(),
|
|
Value<String?> minDose = const Value.absent(),
|
|
Value<String?> targetDose = const Value.absent(),
|
|
Value<String> startedAt = const Value.absent(),
|
|
Value<String?> endedAt = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => HabitsCompanion(
|
|
id: id,
|
|
userId: userId,
|
|
phaseId: phaseId,
|
|
type: type,
|
|
status: status,
|
|
title: title,
|
|
protocolId: protocolId,
|
|
breakProtocolId: breakProtocolId,
|
|
commonFrameIdsJson: commonFrameIdsJson,
|
|
frameLevel: frameLevel,
|
|
frameOriginalText: frameOriginalText,
|
|
frameFramedText: frameFramedText,
|
|
anchorWhen: anchorWhen,
|
|
anchorAfterWhat: anchorAfterWhat,
|
|
anchorWhere: anchorWhere,
|
|
stackPosition: stackPosition,
|
|
minDose: minDose,
|
|
targetDose: targetDose,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
tagsJson: tagsJson,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String userId,
|
|
Value<String?> phaseId = const Value.absent(),
|
|
required String type,
|
|
required String status,
|
|
required String title,
|
|
Value<String?> protocolId = const Value.absent(),
|
|
Value<String?> breakProtocolId = const Value.absent(),
|
|
Value<String?> commonFrameIdsJson = const Value.absent(),
|
|
required String frameLevel,
|
|
Value<String?> frameOriginalText = const Value.absent(),
|
|
required String frameFramedText,
|
|
Value<String?> anchorWhen = const Value.absent(),
|
|
Value<String?> anchorAfterWhat = const Value.absent(),
|
|
Value<String?> anchorWhere = const Value.absent(),
|
|
Value<int?> stackPosition = const Value.absent(),
|
|
Value<String?> minDose = const Value.absent(),
|
|
Value<String?> targetDose = const Value.absent(),
|
|
required String startedAt,
|
|
Value<String?> endedAt = const Value.absent(),
|
|
Value<String?> tagsJson = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => HabitsCompanion.insert(
|
|
id: id,
|
|
userId: userId,
|
|
phaseId: phaseId,
|
|
type: type,
|
|
status: status,
|
|
title: title,
|
|
protocolId: protocolId,
|
|
breakProtocolId: breakProtocolId,
|
|
commonFrameIdsJson: commonFrameIdsJson,
|
|
frameLevel: frameLevel,
|
|
frameOriginalText: frameOriginalText,
|
|
frameFramedText: frameFramedText,
|
|
anchorWhen: anchorWhen,
|
|
anchorAfterWhat: anchorAfterWhat,
|
|
anchorWhere: anchorWhere,
|
|
stackPosition: stackPosition,
|
|
minDose: minDose,
|
|
targetDose: targetDose,
|
|
startedAt: startedAt,
|
|
endedAt: endedAt,
|
|
tagsJson: tagsJson,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) =>
|
|
(e.readTable(table), $$HabitsTableReferences(db, table, e)),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
userId = false,
|
|
phaseId = false,
|
|
habitDoseVariantsRefs = false,
|
|
ifThenRulesRefs = false,
|
|
trackerEntriesRefs = false,
|
|
lapseLogsRefs = false,
|
|
urgeLogsRefs = false,
|
|
rewardDeclarationsRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (habitDoseVariantsRefs) db.habitDoseVariants,
|
|
if (ifThenRulesRefs) db.ifThenRules,
|
|
if (trackerEntriesRefs) db.trackerEntries,
|
|
if (lapseLogsRefs) db.lapseLogs,
|
|
if (urgeLogsRefs) db.urgeLogs,
|
|
if (rewardDeclarationsRefs) db.rewardDeclarations,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (userId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.userId,
|
|
referencedTable: $$HabitsTableReferences
|
|
._userIdTable(db),
|
|
referencedColumn: $$HabitsTableReferences
|
|
._userIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (phaseId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.phaseId,
|
|
referencedTable: $$HabitsTableReferences
|
|
._phaseIdTable(db),
|
|
referencedColumn: $$HabitsTableReferences
|
|
._phaseIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (habitDoseVariantsRefs)
|
|
await $_getPrefetchedData<
|
|
Habit,
|
|
$HabitsTable,
|
|
HabitDoseVariant
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._habitDoseVariantsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).habitDoseVariantsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (ifThenRulesRefs)
|
|
await $_getPrefetchedData<
|
|
Habit,
|
|
$HabitsTable,
|
|
IfThenRule
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._ifThenRulesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).ifThenRulesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (trackerEntriesRefs)
|
|
await $_getPrefetchedData<
|
|
Habit,
|
|
$HabitsTable,
|
|
TrackerEntry
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._trackerEntriesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).trackerEntriesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (lapseLogsRefs)
|
|
await $_getPrefetchedData<
|
|
Habit,
|
|
$HabitsTable,
|
|
LapseLog
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._lapseLogsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).lapseLogsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (urgeLogsRefs)
|
|
await $_getPrefetchedData<Habit, $HabitsTable, UrgeLog>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._urgeLogsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).urgeLogsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (rewardDeclarationsRefs)
|
|
await $_getPrefetchedData<
|
|
Habit,
|
|
$HabitsTable,
|
|
RewardDeclaration
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitsTableReferences
|
|
._rewardDeclarationsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).rewardDeclarationsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.habitId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$HabitsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$HabitsTable,
|
|
Habit,
|
|
$$HabitsTableFilterComposer,
|
|
$$HabitsTableOrderingComposer,
|
|
$$HabitsTableAnnotationComposer,
|
|
$$HabitsTableCreateCompanionBuilder,
|
|
$$HabitsTableUpdateCompanionBuilder,
|
|
(Habit, $$HabitsTableReferences),
|
|
Habit,
|
|
PrefetchHooks Function({
|
|
bool userId,
|
|
bool phaseId,
|
|
bool habitDoseVariantsRefs,
|
|
bool ifThenRulesRefs,
|
|
bool trackerEntriesRefs,
|
|
bool lapseLogsRefs,
|
|
bool urgeLogsRefs,
|
|
bool rewardDeclarationsRefs,
|
|
})
|
|
>;
|
|
typedef $$HabitDoseVariantsTableCreateCompanionBuilder =
|
|
HabitDoseVariantsCompanion Function({
|
|
required String variantId,
|
|
required String habitId,
|
|
required String label,
|
|
required String doseText,
|
|
Value<String?> contextTagsJson,
|
|
Value<String?> conditionTagsJson,
|
|
Value<bool> isMinimum,
|
|
Value<int> sortOrder,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$HabitDoseVariantsTableUpdateCompanionBuilder =
|
|
HabitDoseVariantsCompanion Function({
|
|
Value<String> variantId,
|
|
Value<String> habitId,
|
|
Value<String> label,
|
|
Value<String> doseText,
|
|
Value<String?> contextTagsJson,
|
|
Value<String?> conditionTagsJson,
|
|
Value<bool> isMinimum,
|
|
Value<int> sortOrder,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$HabitDoseVariantsTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$HabitDoseVariantsTable,
|
|
HabitDoseVariant
|
|
> {
|
|
$$HabitDoseVariantsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.habitDoseVariants.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$TrackerEntriesTable, List<TrackerEntry>>
|
|
_trackerEntriesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.trackerEntries,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.habitDoseVariants.variantId,
|
|
db.trackerEntries.variantId,
|
|
),
|
|
);
|
|
|
|
$$TrackerEntriesTableProcessedTableManager get trackerEntriesRefs {
|
|
final manager = $$TrackerEntriesTableTableManager($_db, $_db.trackerEntries)
|
|
.filter(
|
|
(f) => f.variantId.variantId.sqlEquals(
|
|
$_itemColumn<String>('variant_id')!,
|
|
),
|
|
);
|
|
|
|
final cache = $_typedResult.readTableOrNull(_trackerEntriesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$HabitDoseVariantsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $HabitDoseVariantsTable> {
|
|
$$HabitDoseVariantsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get variantId => $composableBuilder(
|
|
column: $table.variantId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get label => $composableBuilder(
|
|
column: $table.label,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get doseText => $composableBuilder(
|
|
column: $table.doseText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get contextTagsJson => $composableBuilder(
|
|
column: $table.contextTagsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get conditionTagsJson => $composableBuilder(
|
|
column: $table.conditionTagsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isMinimum => $composableBuilder(
|
|
column: $table.isMinimum,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sortOrder => $composableBuilder(
|
|
column: $table.sortOrder,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> trackerEntriesRefs(
|
|
Expression<bool> Function($$TrackerEntriesTableFilterComposer f) f,
|
|
) {
|
|
final $$TrackerEntriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.variantId,
|
|
referencedTable: $db.trackerEntries,
|
|
getReferencedColumn: (t) => t.variantId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TrackerEntriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.trackerEntries,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$HabitDoseVariantsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $HabitDoseVariantsTable> {
|
|
$$HabitDoseVariantsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get variantId => $composableBuilder(
|
|
column: $table.variantId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get label => $composableBuilder(
|
|
column: $table.label,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get doseText => $composableBuilder(
|
|
column: $table.doseText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get contextTagsJson => $composableBuilder(
|
|
column: $table.contextTagsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get conditionTagsJson => $composableBuilder(
|
|
column: $table.conditionTagsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isMinimum => $composableBuilder(
|
|
column: $table.isMinimum,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sortOrder => $composableBuilder(
|
|
column: $table.sortOrder,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$HabitDoseVariantsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $HabitDoseVariantsTable> {
|
|
$$HabitDoseVariantsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get variantId =>
|
|
$composableBuilder(column: $table.variantId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get label =>
|
|
$composableBuilder(column: $table.label, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get doseText =>
|
|
$composableBuilder(column: $table.doseText, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get contextTagsJson => $composableBuilder(
|
|
column: $table.contextTagsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get conditionTagsJson => $composableBuilder(
|
|
column: $table.conditionTagsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isMinimum =>
|
|
$composableBuilder(column: $table.isMinimum, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get sortOrder =>
|
|
$composableBuilder(column: $table.sortOrder, builder: (column) => column);
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> trackerEntriesRefs<T extends Object>(
|
|
Expression<T> Function($$TrackerEntriesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$TrackerEntriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.variantId,
|
|
referencedTable: $db.trackerEntries,
|
|
getReferencedColumn: (t) => t.variantId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TrackerEntriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.trackerEntries,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$HabitDoseVariantsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$HabitDoseVariantsTable,
|
|
HabitDoseVariant,
|
|
$$HabitDoseVariantsTableFilterComposer,
|
|
$$HabitDoseVariantsTableOrderingComposer,
|
|
$$HabitDoseVariantsTableAnnotationComposer,
|
|
$$HabitDoseVariantsTableCreateCompanionBuilder,
|
|
$$HabitDoseVariantsTableUpdateCompanionBuilder,
|
|
(HabitDoseVariant, $$HabitDoseVariantsTableReferences),
|
|
HabitDoseVariant,
|
|
PrefetchHooks Function({bool habitId, bool trackerEntriesRefs})
|
|
> {
|
|
$$HabitDoseVariantsTableTableManager(
|
|
_$AppDatabase db,
|
|
$HabitDoseVariantsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$HabitDoseVariantsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$HabitDoseVariantsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$HabitDoseVariantsTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> variantId = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> label = const Value.absent(),
|
|
Value<String> doseText = const Value.absent(),
|
|
Value<String?> contextTagsJson = const Value.absent(),
|
|
Value<String?> conditionTagsJson = const Value.absent(),
|
|
Value<bool> isMinimum = const Value.absent(),
|
|
Value<int> sortOrder = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => HabitDoseVariantsCompanion(
|
|
variantId: variantId,
|
|
habitId: habitId,
|
|
label: label,
|
|
doseText: doseText,
|
|
contextTagsJson: contextTagsJson,
|
|
conditionTagsJson: conditionTagsJson,
|
|
isMinimum: isMinimum,
|
|
sortOrder: sortOrder,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String variantId,
|
|
required String habitId,
|
|
required String label,
|
|
required String doseText,
|
|
Value<String?> contextTagsJson = const Value.absent(),
|
|
Value<String?> conditionTagsJson = const Value.absent(),
|
|
Value<bool> isMinimum = const Value.absent(),
|
|
Value<int> sortOrder = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => HabitDoseVariantsCompanion.insert(
|
|
variantId: variantId,
|
|
habitId: habitId,
|
|
label: label,
|
|
doseText: doseText,
|
|
contextTagsJson: contextTagsJson,
|
|
conditionTagsJson: conditionTagsJson,
|
|
isMinimum: isMinimum,
|
|
sortOrder: sortOrder,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$HabitDoseVariantsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({habitId = false, trackerEntriesRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (trackerEntriesRefs) db.trackerEntries,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable:
|
|
$$HabitDoseVariantsTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn:
|
|
$$HabitDoseVariantsTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (trackerEntriesRefs)
|
|
await $_getPrefetchedData<
|
|
HabitDoseVariant,
|
|
$HabitDoseVariantsTable,
|
|
TrackerEntry
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$HabitDoseVariantsTableReferences
|
|
._trackerEntriesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$HabitDoseVariantsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).trackerEntriesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.variantId == item.variantId,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$HabitDoseVariantsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$HabitDoseVariantsTable,
|
|
HabitDoseVariant,
|
|
$$HabitDoseVariantsTableFilterComposer,
|
|
$$HabitDoseVariantsTableOrderingComposer,
|
|
$$HabitDoseVariantsTableAnnotationComposer,
|
|
$$HabitDoseVariantsTableCreateCompanionBuilder,
|
|
$$HabitDoseVariantsTableUpdateCompanionBuilder,
|
|
(HabitDoseVariant, $$HabitDoseVariantsTableReferences),
|
|
HabitDoseVariant,
|
|
PrefetchHooks Function({bool habitId, bool trackerEntriesRefs})
|
|
>;
|
|
typedef $$IfThenRulesTableCreateCompanionBuilder =
|
|
IfThenRulesCompanion Function({
|
|
required String id,
|
|
required String habitId,
|
|
required String ifCondition,
|
|
required String thenAction,
|
|
Value<String?> triggerType,
|
|
Value<int> priority,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$IfThenRulesTableUpdateCompanionBuilder =
|
|
IfThenRulesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> habitId,
|
|
Value<String> ifCondition,
|
|
Value<String> thenAction,
|
|
Value<String?> triggerType,
|
|
Value<int> priority,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$IfThenRulesTableReferences
|
|
extends BaseReferences<_$AppDatabase, $IfThenRulesTable, IfThenRule> {
|
|
$$IfThenRulesTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.ifThenRules.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$IfThenRulesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $IfThenRulesTable> {
|
|
$$IfThenRulesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get ifCondition => $composableBuilder(
|
|
column: $table.ifCondition,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get thenAction => $composableBuilder(
|
|
column: $table.thenAction,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get triggerType => $composableBuilder(
|
|
column: $table.triggerType,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get priority => $composableBuilder(
|
|
column: $table.priority,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$IfThenRulesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $IfThenRulesTable> {
|
|
$$IfThenRulesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get ifCondition => $composableBuilder(
|
|
column: $table.ifCondition,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get thenAction => $composableBuilder(
|
|
column: $table.thenAction,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get triggerType => $composableBuilder(
|
|
column: $table.triggerType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get priority => $composableBuilder(
|
|
column: $table.priority,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$IfThenRulesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $IfThenRulesTable> {
|
|
$$IfThenRulesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get ifCondition => $composableBuilder(
|
|
column: $table.ifCondition,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get thenAction => $composableBuilder(
|
|
column: $table.thenAction,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get triggerType => $composableBuilder(
|
|
column: $table.triggerType,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get priority =>
|
|
$composableBuilder(column: $table.priority, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$IfThenRulesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$IfThenRulesTable,
|
|
IfThenRule,
|
|
$$IfThenRulesTableFilterComposer,
|
|
$$IfThenRulesTableOrderingComposer,
|
|
$$IfThenRulesTableAnnotationComposer,
|
|
$$IfThenRulesTableCreateCompanionBuilder,
|
|
$$IfThenRulesTableUpdateCompanionBuilder,
|
|
(IfThenRule, $$IfThenRulesTableReferences),
|
|
IfThenRule,
|
|
PrefetchHooks Function({bool habitId})
|
|
> {
|
|
$$IfThenRulesTableTableManager(_$AppDatabase db, $IfThenRulesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$IfThenRulesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$IfThenRulesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$IfThenRulesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> ifCondition = const Value.absent(),
|
|
Value<String> thenAction = const Value.absent(),
|
|
Value<String?> triggerType = const Value.absent(),
|
|
Value<int> priority = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => IfThenRulesCompanion(
|
|
id: id,
|
|
habitId: habitId,
|
|
ifCondition: ifCondition,
|
|
thenAction: thenAction,
|
|
triggerType: triggerType,
|
|
priority: priority,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String habitId,
|
|
required String ifCondition,
|
|
required String thenAction,
|
|
Value<String?> triggerType = const Value.absent(),
|
|
Value<int> priority = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => IfThenRulesCompanion.insert(
|
|
id: id,
|
|
habitId: habitId,
|
|
ifCondition: ifCondition,
|
|
thenAction: thenAction,
|
|
triggerType: triggerType,
|
|
priority: priority,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$IfThenRulesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({habitId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable: $$IfThenRulesTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn: $$IfThenRulesTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$IfThenRulesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$IfThenRulesTable,
|
|
IfThenRule,
|
|
$$IfThenRulesTableFilterComposer,
|
|
$$IfThenRulesTableOrderingComposer,
|
|
$$IfThenRulesTableAnnotationComposer,
|
|
$$IfThenRulesTableCreateCompanionBuilder,
|
|
$$IfThenRulesTableUpdateCompanionBuilder,
|
|
(IfThenRule, $$IfThenRulesTableReferences),
|
|
IfThenRule,
|
|
PrefetchHooks Function({bool habitId})
|
|
>;
|
|
typedef $$TrackerEntriesTableCreateCompanionBuilder =
|
|
TrackerEntriesCompanion Function({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String value,
|
|
Value<String?> loggedAt,
|
|
Value<String?> note,
|
|
Value<String?> variantId,
|
|
Value<String?> ctxLocation,
|
|
Value<String?> ctxCondition,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$TrackerEntriesTableUpdateCompanionBuilder =
|
|
TrackerEntriesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> habitId,
|
|
Value<String> date,
|
|
Value<String> value,
|
|
Value<String?> loggedAt,
|
|
Value<String?> note,
|
|
Value<String?> variantId,
|
|
Value<String?> ctxLocation,
|
|
Value<String?> ctxCondition,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$TrackerEntriesTableReferences
|
|
extends BaseReferences<_$AppDatabase, $TrackerEntriesTable, TrackerEntry> {
|
|
$$TrackerEntriesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.trackerEntries.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $HabitDoseVariantsTable _variantIdTable(_$AppDatabase db) =>
|
|
db.habitDoseVariants.createAlias(
|
|
$_aliasNameGenerator(
|
|
db.trackerEntries.variantId,
|
|
db.habitDoseVariants.variantId,
|
|
),
|
|
);
|
|
|
|
$$HabitDoseVariantsTableProcessedTableManager? get variantId {
|
|
final $_column = $_itemColumn<String>('variant_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$HabitDoseVariantsTableTableManager(
|
|
$_db,
|
|
$_db.habitDoseVariants,
|
|
).filter((f) => f.variantId.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_variantIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$TrackerEntriesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $TrackerEntriesTable> {
|
|
$$TrackerEntriesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get value => $composableBuilder(
|
|
column: $table.value,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get loggedAt => $composableBuilder(
|
|
column: $table.loggedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get ctxLocation => $composableBuilder(
|
|
column: $table.ctxLocation,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get ctxCondition => $composableBuilder(
|
|
column: $table.ctxCondition,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitDoseVariantsTableFilterComposer get variantId {
|
|
final $$HabitDoseVariantsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.variantId,
|
|
referencedTable: $db.habitDoseVariants,
|
|
getReferencedColumn: (t) => t.variantId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitDoseVariantsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habitDoseVariants,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TrackerEntriesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $TrackerEntriesTable> {
|
|
$$TrackerEntriesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get value => $composableBuilder(
|
|
column: $table.value,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get loggedAt => $composableBuilder(
|
|
column: $table.loggedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get note => $composableBuilder(
|
|
column: $table.note,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get ctxLocation => $composableBuilder(
|
|
column: $table.ctxLocation,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get ctxCondition => $composableBuilder(
|
|
column: $table.ctxCondition,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitDoseVariantsTableOrderingComposer get variantId {
|
|
final $$HabitDoseVariantsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.variantId,
|
|
referencedTable: $db.habitDoseVariants,
|
|
getReferencedColumn: (t) => t.variantId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitDoseVariantsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habitDoseVariants,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TrackerEntriesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $TrackerEntriesTable> {
|
|
$$TrackerEntriesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get date =>
|
|
$composableBuilder(column: $table.date, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get value =>
|
|
$composableBuilder(column: $table.value, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get loggedAt =>
|
|
$composableBuilder(column: $table.loggedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get note =>
|
|
$composableBuilder(column: $table.note, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get ctxLocation => $composableBuilder(
|
|
column: $table.ctxLocation,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get ctxCondition => $composableBuilder(
|
|
column: $table.ctxCondition,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitDoseVariantsTableAnnotationComposer get variantId {
|
|
final $$HabitDoseVariantsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.variantId,
|
|
referencedTable: $db.habitDoseVariants,
|
|
getReferencedColumn: (t) => t.variantId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitDoseVariantsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habitDoseVariants,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TrackerEntriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$TrackerEntriesTable,
|
|
TrackerEntry,
|
|
$$TrackerEntriesTableFilterComposer,
|
|
$$TrackerEntriesTableOrderingComposer,
|
|
$$TrackerEntriesTableAnnotationComposer,
|
|
$$TrackerEntriesTableCreateCompanionBuilder,
|
|
$$TrackerEntriesTableUpdateCompanionBuilder,
|
|
(TrackerEntry, $$TrackerEntriesTableReferences),
|
|
TrackerEntry,
|
|
PrefetchHooks Function({bool habitId, bool variantId})
|
|
> {
|
|
$$TrackerEntriesTableTableManager(
|
|
_$AppDatabase db,
|
|
$TrackerEntriesTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$TrackerEntriesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$TrackerEntriesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$TrackerEntriesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> date = const Value.absent(),
|
|
Value<String> value = const Value.absent(),
|
|
Value<String?> loggedAt = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> variantId = const Value.absent(),
|
|
Value<String?> ctxLocation = const Value.absent(),
|
|
Value<String?> ctxCondition = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TrackerEntriesCompanion(
|
|
id: id,
|
|
habitId: habitId,
|
|
date: date,
|
|
value: value,
|
|
loggedAt: loggedAt,
|
|
note: note,
|
|
variantId: variantId,
|
|
ctxLocation: ctxLocation,
|
|
ctxCondition: ctxCondition,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String value,
|
|
Value<String?> loggedAt = const Value.absent(),
|
|
Value<String?> note = const Value.absent(),
|
|
Value<String?> variantId = const Value.absent(),
|
|
Value<String?> ctxLocation = const Value.absent(),
|
|
Value<String?> ctxCondition = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TrackerEntriesCompanion.insert(
|
|
id: id,
|
|
habitId: habitId,
|
|
date: date,
|
|
value: value,
|
|
loggedAt: loggedAt,
|
|
note: note,
|
|
variantId: variantId,
|
|
ctxLocation: ctxLocation,
|
|
ctxCondition: ctxCondition,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$TrackerEntriesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({habitId = false, variantId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable: $$TrackerEntriesTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn:
|
|
$$TrackerEntriesTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (variantId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.variantId,
|
|
referencedTable: $$TrackerEntriesTableReferences
|
|
._variantIdTable(db),
|
|
referencedColumn:
|
|
$$TrackerEntriesTableReferences
|
|
._variantIdTable(db)
|
|
.variantId,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$TrackerEntriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$TrackerEntriesTable,
|
|
TrackerEntry,
|
|
$$TrackerEntriesTableFilterComposer,
|
|
$$TrackerEntriesTableOrderingComposer,
|
|
$$TrackerEntriesTableAnnotationComposer,
|
|
$$TrackerEntriesTableCreateCompanionBuilder,
|
|
$$TrackerEntriesTableUpdateCompanionBuilder,
|
|
(TrackerEntry, $$TrackerEntriesTableReferences),
|
|
TrackerEntry,
|
|
PrefetchHooks Function({bool habitId, bool variantId})
|
|
>;
|
|
typedef $$LapseLogsTableCreateCompanionBuilder =
|
|
LapseLogsCompanion Function({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String labelText,
|
|
required String examineHaltJson,
|
|
required String antecedentJson,
|
|
required String replan,
|
|
required String nextAction,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$LapseLogsTableUpdateCompanionBuilder =
|
|
LapseLogsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> habitId,
|
|
Value<String> date,
|
|
Value<String> labelText,
|
|
Value<String> examineHaltJson,
|
|
Value<String> antecedentJson,
|
|
Value<String> replan,
|
|
Value<String> nextAction,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$LapseLogsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $LapseLogsTable, LapseLog> {
|
|
$$LapseLogsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.lapseLogs.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$LapseLogsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $LapseLogsTable> {
|
|
$$LapseLogsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get labelText => $composableBuilder(
|
|
column: $table.labelText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get examineHaltJson => $composableBuilder(
|
|
column: $table.examineHaltJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get antecedentJson => $composableBuilder(
|
|
column: $table.antecedentJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get replan => $composableBuilder(
|
|
column: $table.replan,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get nextAction => $composableBuilder(
|
|
column: $table.nextAction,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$LapseLogsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $LapseLogsTable> {
|
|
$$LapseLogsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get labelText => $composableBuilder(
|
|
column: $table.labelText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get examineHaltJson => $composableBuilder(
|
|
column: $table.examineHaltJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get antecedentJson => $composableBuilder(
|
|
column: $table.antecedentJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get replan => $composableBuilder(
|
|
column: $table.replan,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get nextAction => $composableBuilder(
|
|
column: $table.nextAction,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$LapseLogsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $LapseLogsTable> {
|
|
$$LapseLogsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get date =>
|
|
$composableBuilder(column: $table.date, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get labelText =>
|
|
$composableBuilder(column: $table.labelText, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get examineHaltJson => $composableBuilder(
|
|
column: $table.examineHaltJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get antecedentJson => $composableBuilder(
|
|
column: $table.antecedentJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get replan =>
|
|
$composableBuilder(column: $table.replan, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get nextAction => $composableBuilder(
|
|
column: $table.nextAction,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$LapseLogsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$LapseLogsTable,
|
|
LapseLog,
|
|
$$LapseLogsTableFilterComposer,
|
|
$$LapseLogsTableOrderingComposer,
|
|
$$LapseLogsTableAnnotationComposer,
|
|
$$LapseLogsTableCreateCompanionBuilder,
|
|
$$LapseLogsTableUpdateCompanionBuilder,
|
|
(LapseLog, $$LapseLogsTableReferences),
|
|
LapseLog,
|
|
PrefetchHooks Function({bool habitId})
|
|
> {
|
|
$$LapseLogsTableTableManager(_$AppDatabase db, $LapseLogsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$LapseLogsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$LapseLogsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$LapseLogsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> date = const Value.absent(),
|
|
Value<String> labelText = const Value.absent(),
|
|
Value<String> examineHaltJson = const Value.absent(),
|
|
Value<String> antecedentJson = const Value.absent(),
|
|
Value<String> replan = const Value.absent(),
|
|
Value<String> nextAction = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => LapseLogsCompanion(
|
|
id: id,
|
|
habitId: habitId,
|
|
date: date,
|
|
labelText: labelText,
|
|
examineHaltJson: examineHaltJson,
|
|
antecedentJson: antecedentJson,
|
|
replan: replan,
|
|
nextAction: nextAction,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String habitId,
|
|
required String date,
|
|
required String labelText,
|
|
required String examineHaltJson,
|
|
required String antecedentJson,
|
|
required String replan,
|
|
required String nextAction,
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => LapseLogsCompanion.insert(
|
|
id: id,
|
|
habitId: habitId,
|
|
date: date,
|
|
labelText: labelText,
|
|
examineHaltJson: examineHaltJson,
|
|
antecedentJson: antecedentJson,
|
|
replan: replan,
|
|
nextAction: nextAction,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$LapseLogsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({habitId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable: $$LapseLogsTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn: $$LapseLogsTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$LapseLogsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$LapseLogsTable,
|
|
LapseLog,
|
|
$$LapseLogsTableFilterComposer,
|
|
$$LapseLogsTableOrderingComposer,
|
|
$$LapseLogsTableAnnotationComposer,
|
|
$$LapseLogsTableCreateCompanionBuilder,
|
|
$$LapseLogsTableUpdateCompanionBuilder,
|
|
(LapseLog, $$LapseLogsTableReferences),
|
|
LapseLog,
|
|
PrefetchHooks Function({bool habitId})
|
|
>;
|
|
typedef $$UrgeLogsTableCreateCompanionBuilder =
|
|
UrgeLogsCompanion Function({
|
|
required String id,
|
|
required String habitId,
|
|
required String occurredAt,
|
|
Value<int?> intensityBefore,
|
|
Value<int?> intensityAfter,
|
|
Value<int?> durationSeconds,
|
|
Value<String?> bodyLocationJson,
|
|
required bool passed,
|
|
Value<String?> methodUsed,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$UrgeLogsTableUpdateCompanionBuilder =
|
|
UrgeLogsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> habitId,
|
|
Value<String> occurredAt,
|
|
Value<int?> intensityBefore,
|
|
Value<int?> intensityAfter,
|
|
Value<int?> durationSeconds,
|
|
Value<String?> bodyLocationJson,
|
|
Value<bool> passed,
|
|
Value<String?> methodUsed,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$UrgeLogsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $UrgeLogsTable, UrgeLog> {
|
|
$$UrgeLogsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.urgeLogs.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$UrgeLogsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $UrgeLogsTable> {
|
|
$$UrgeLogsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get occurredAt => $composableBuilder(
|
|
column: $table.occurredAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get intensityBefore => $composableBuilder(
|
|
column: $table.intensityBefore,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get intensityAfter => $composableBuilder(
|
|
column: $table.intensityAfter,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get durationSeconds => $composableBuilder(
|
|
column: $table.durationSeconds,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get bodyLocationJson => $composableBuilder(
|
|
column: $table.bodyLocationJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get passed => $composableBuilder(
|
|
column: $table.passed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get methodUsed => $composableBuilder(
|
|
column: $table.methodUsed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$UrgeLogsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $UrgeLogsTable> {
|
|
$$UrgeLogsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get occurredAt => $composableBuilder(
|
|
column: $table.occurredAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get intensityBefore => $composableBuilder(
|
|
column: $table.intensityBefore,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get intensityAfter => $composableBuilder(
|
|
column: $table.intensityAfter,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get durationSeconds => $composableBuilder(
|
|
column: $table.durationSeconds,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get bodyLocationJson => $composableBuilder(
|
|
column: $table.bodyLocationJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get passed => $composableBuilder(
|
|
column: $table.passed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get methodUsed => $composableBuilder(
|
|
column: $table.methodUsed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$UrgeLogsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $UrgeLogsTable> {
|
|
$$UrgeLogsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get occurredAt => $composableBuilder(
|
|
column: $table.occurredAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get intensityBefore => $composableBuilder(
|
|
column: $table.intensityBefore,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get intensityAfter => $composableBuilder(
|
|
column: $table.intensityAfter,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get durationSeconds => $composableBuilder(
|
|
column: $table.durationSeconds,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get bodyLocationJson => $composableBuilder(
|
|
column: $table.bodyLocationJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get passed =>
|
|
$composableBuilder(column: $table.passed, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get methodUsed => $composableBuilder(
|
|
column: $table.methodUsed,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$UrgeLogsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$UrgeLogsTable,
|
|
UrgeLog,
|
|
$$UrgeLogsTableFilterComposer,
|
|
$$UrgeLogsTableOrderingComposer,
|
|
$$UrgeLogsTableAnnotationComposer,
|
|
$$UrgeLogsTableCreateCompanionBuilder,
|
|
$$UrgeLogsTableUpdateCompanionBuilder,
|
|
(UrgeLog, $$UrgeLogsTableReferences),
|
|
UrgeLog,
|
|
PrefetchHooks Function({bool habitId})
|
|
> {
|
|
$$UrgeLogsTableTableManager(_$AppDatabase db, $UrgeLogsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$UrgeLogsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$UrgeLogsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$UrgeLogsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> occurredAt = const Value.absent(),
|
|
Value<int?> intensityBefore = const Value.absent(),
|
|
Value<int?> intensityAfter = const Value.absent(),
|
|
Value<int?> durationSeconds = const Value.absent(),
|
|
Value<String?> bodyLocationJson = const Value.absent(),
|
|
Value<bool> passed = const Value.absent(),
|
|
Value<String?> methodUsed = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => UrgeLogsCompanion(
|
|
id: id,
|
|
habitId: habitId,
|
|
occurredAt: occurredAt,
|
|
intensityBefore: intensityBefore,
|
|
intensityAfter: intensityAfter,
|
|
durationSeconds: durationSeconds,
|
|
bodyLocationJson: bodyLocationJson,
|
|
passed: passed,
|
|
methodUsed: methodUsed,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String habitId,
|
|
required String occurredAt,
|
|
Value<int?> intensityBefore = const Value.absent(),
|
|
Value<int?> intensityAfter = const Value.absent(),
|
|
Value<int?> durationSeconds = const Value.absent(),
|
|
Value<String?> bodyLocationJson = const Value.absent(),
|
|
required bool passed,
|
|
Value<String?> methodUsed = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => UrgeLogsCompanion.insert(
|
|
id: id,
|
|
habitId: habitId,
|
|
occurredAt: occurredAt,
|
|
intensityBefore: intensityBefore,
|
|
intensityAfter: intensityAfter,
|
|
durationSeconds: durationSeconds,
|
|
bodyLocationJson: bodyLocationJson,
|
|
passed: passed,
|
|
methodUsed: methodUsed,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$UrgeLogsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({habitId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable: $$UrgeLogsTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn: $$UrgeLogsTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$UrgeLogsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$UrgeLogsTable,
|
|
UrgeLog,
|
|
$$UrgeLogsTableFilterComposer,
|
|
$$UrgeLogsTableOrderingComposer,
|
|
$$UrgeLogsTableAnnotationComposer,
|
|
$$UrgeLogsTableCreateCompanionBuilder,
|
|
$$UrgeLogsTableUpdateCompanionBuilder,
|
|
(UrgeLog, $$UrgeLogsTableReferences),
|
|
UrgeLog,
|
|
PrefetchHooks Function({bool habitId})
|
|
>;
|
|
typedef $$RewardDeclarationsTableCreateCompanionBuilder =
|
|
RewardDeclarationsCompanion Function({
|
|
required String id,
|
|
required String phaseId,
|
|
required String habitId,
|
|
required String tier,
|
|
required String milestoneRule,
|
|
Value<String?> milestoneMachineRuleJson,
|
|
required String rewardText,
|
|
Value<String?> rewardMenuItemId,
|
|
Value<int?> estimatedCostKrw,
|
|
Value<bool?> isEffortTied,
|
|
required String declaredAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$RewardDeclarationsTableUpdateCompanionBuilder =
|
|
RewardDeclarationsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> phaseId,
|
|
Value<String> habitId,
|
|
Value<String> tier,
|
|
Value<String> milestoneRule,
|
|
Value<String?> milestoneMachineRuleJson,
|
|
Value<String> rewardText,
|
|
Value<String?> rewardMenuItemId,
|
|
Value<int?> estimatedCostKrw,
|
|
Value<bool?> isEffortTied,
|
|
Value<String> declaredAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$RewardDeclarationsTableReferences
|
|
extends
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$RewardDeclarationsTable,
|
|
RewardDeclaration
|
|
> {
|
|
$$RewardDeclarationsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias(
|
|
$_aliasNameGenerator(db.rewardDeclarations.phaseId, db.phases.id),
|
|
);
|
|
|
|
$$PhasesTableProcessedTableManager get phaseId {
|
|
final $_column = $_itemColumn<String>('phase_id')!;
|
|
|
|
final manager = $$PhasesTableTableManager(
|
|
$_db,
|
|
$_db.phases,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_phaseIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $HabitsTable _habitIdTable(_$AppDatabase db) => db.habits.createAlias(
|
|
$_aliasNameGenerator(db.rewardDeclarations.habitId, db.habits.id),
|
|
);
|
|
|
|
$$HabitsTableProcessedTableManager get habitId {
|
|
final $_column = $_itemColumn<String>('habit_id')!;
|
|
|
|
final manager = $$HabitsTableTableManager(
|
|
$_db,
|
|
$_db.habits,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_habitIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$RewardClaimsTable, List<RewardClaim>>
|
|
_rewardClaimsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.rewardClaims,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.rewardDeclarations.id,
|
|
db.rewardClaims.declarationId,
|
|
),
|
|
);
|
|
|
|
$$RewardClaimsTableProcessedTableManager get rewardClaimsRefs {
|
|
final manager = $$RewardClaimsTableTableManager(
|
|
$_db,
|
|
$_db.rewardClaims,
|
|
).filter((f) => f.declarationId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_rewardClaimsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$RewardDeclarationsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $RewardDeclarationsTable> {
|
|
$$RewardDeclarationsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get tier => $composableBuilder(
|
|
column: $table.tier,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get milestoneRule => $composableBuilder(
|
|
column: $table.milestoneRule,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get milestoneMachineRuleJson => $composableBuilder(
|
|
column: $table.milestoneMachineRuleJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get rewardText => $composableBuilder(
|
|
column: $table.rewardText,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get rewardMenuItemId => $composableBuilder(
|
|
column: $table.rewardMenuItemId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get estimatedCostKrw => $composableBuilder(
|
|
column: $table.estimatedCostKrw,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get declaredAt => $composableBuilder(
|
|
column: $table.declaredAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$PhasesTableFilterComposer get phaseId {
|
|
final $$PhasesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitsTableFilterComposer get habitId {
|
|
final $$HabitsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> rewardClaimsRefs(
|
|
Expression<bool> Function($$RewardClaimsTableFilterComposer f) f,
|
|
) {
|
|
final $$RewardClaimsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardClaims,
|
|
getReferencedColumn: (t) => t.declarationId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardClaimsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.rewardClaims,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$RewardDeclarationsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $RewardDeclarationsTable> {
|
|
$$RewardDeclarationsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get tier => $composableBuilder(
|
|
column: $table.tier,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get milestoneRule => $composableBuilder(
|
|
column: $table.milestoneRule,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get milestoneMachineRuleJson => $composableBuilder(
|
|
column: $table.milestoneMachineRuleJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get rewardText => $composableBuilder(
|
|
column: $table.rewardText,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get rewardMenuItemId => $composableBuilder(
|
|
column: $table.rewardMenuItemId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get estimatedCostKrw => $composableBuilder(
|
|
column: $table.estimatedCostKrw,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get declaredAt => $composableBuilder(
|
|
column: $table.declaredAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$PhasesTableOrderingComposer get phaseId {
|
|
final $$PhasesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitsTableOrderingComposer get habitId {
|
|
final $$HabitsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$RewardDeclarationsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $RewardDeclarationsTable> {
|
|
$$RewardDeclarationsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get tier =>
|
|
$composableBuilder(column: $table.tier, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get milestoneRule => $composableBuilder(
|
|
column: $table.milestoneRule,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get milestoneMachineRuleJson => $composableBuilder(
|
|
column: $table.milestoneMachineRuleJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get rewardText => $composableBuilder(
|
|
column: $table.rewardText,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get rewardMenuItemId => $composableBuilder(
|
|
column: $table.rewardMenuItemId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get estimatedCostKrw => $composableBuilder(
|
|
column: $table.estimatedCostKrw,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isEffortTied => $composableBuilder(
|
|
column: $table.isEffortTied,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get declaredAt => $composableBuilder(
|
|
column: $table.declaredAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$PhasesTableAnnotationComposer get phaseId {
|
|
final $$PhasesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$HabitsTableAnnotationComposer get habitId {
|
|
final $$HabitsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.habitId,
|
|
referencedTable: $db.habits,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$HabitsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.habits,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> rewardClaimsRefs<T extends Object>(
|
|
Expression<T> Function($$RewardClaimsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$RewardClaimsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.rewardClaims,
|
|
getReferencedColumn: (t) => t.declarationId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardClaimsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.rewardClaims,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$RewardDeclarationsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$RewardDeclarationsTable,
|
|
RewardDeclaration,
|
|
$$RewardDeclarationsTableFilterComposer,
|
|
$$RewardDeclarationsTableOrderingComposer,
|
|
$$RewardDeclarationsTableAnnotationComposer,
|
|
$$RewardDeclarationsTableCreateCompanionBuilder,
|
|
$$RewardDeclarationsTableUpdateCompanionBuilder,
|
|
(RewardDeclaration, $$RewardDeclarationsTableReferences),
|
|
RewardDeclaration,
|
|
PrefetchHooks Function({
|
|
bool phaseId,
|
|
bool habitId,
|
|
bool rewardClaimsRefs,
|
|
})
|
|
> {
|
|
$$RewardDeclarationsTableTableManager(
|
|
_$AppDatabase db,
|
|
$RewardDeclarationsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$RewardDeclarationsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$RewardDeclarationsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$RewardDeclarationsTableAnnotationComposer(
|
|
$db: db,
|
|
$table: table,
|
|
),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> phaseId = const Value.absent(),
|
|
Value<String> habitId = const Value.absent(),
|
|
Value<String> tier = const Value.absent(),
|
|
Value<String> milestoneRule = const Value.absent(),
|
|
Value<String?> milestoneMachineRuleJson = const Value.absent(),
|
|
Value<String> rewardText = const Value.absent(),
|
|
Value<String?> rewardMenuItemId = const Value.absent(),
|
|
Value<int?> estimatedCostKrw = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
Value<String> declaredAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardDeclarationsCompanion(
|
|
id: id,
|
|
phaseId: phaseId,
|
|
habitId: habitId,
|
|
tier: tier,
|
|
milestoneRule: milestoneRule,
|
|
milestoneMachineRuleJson: milestoneMachineRuleJson,
|
|
rewardText: rewardText,
|
|
rewardMenuItemId: rewardMenuItemId,
|
|
estimatedCostKrw: estimatedCostKrw,
|
|
isEffortTied: isEffortTied,
|
|
declaredAt: declaredAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String phaseId,
|
|
required String habitId,
|
|
required String tier,
|
|
required String milestoneRule,
|
|
Value<String?> milestoneMachineRuleJson = const Value.absent(),
|
|
required String rewardText,
|
|
Value<String?> rewardMenuItemId = const Value.absent(),
|
|
Value<int?> estimatedCostKrw = const Value.absent(),
|
|
Value<bool?> isEffortTied = const Value.absent(),
|
|
required String declaredAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardDeclarationsCompanion.insert(
|
|
id: id,
|
|
phaseId: phaseId,
|
|
habitId: habitId,
|
|
tier: tier,
|
|
milestoneRule: milestoneRule,
|
|
milestoneMachineRuleJson: milestoneMachineRuleJson,
|
|
rewardText: rewardText,
|
|
rewardMenuItemId: rewardMenuItemId,
|
|
estimatedCostKrw: estimatedCostKrw,
|
|
isEffortTied: isEffortTied,
|
|
declaredAt: declaredAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$RewardDeclarationsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({phaseId = false, habitId = false, rewardClaimsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (rewardClaimsRefs) db.rewardClaims,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (phaseId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.phaseId,
|
|
referencedTable:
|
|
$$RewardDeclarationsTableReferences
|
|
._phaseIdTable(db),
|
|
referencedColumn:
|
|
$$RewardDeclarationsTableReferences
|
|
._phaseIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (habitId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.habitId,
|
|
referencedTable:
|
|
$$RewardDeclarationsTableReferences
|
|
._habitIdTable(db),
|
|
referencedColumn:
|
|
$$RewardDeclarationsTableReferences
|
|
._habitIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (rewardClaimsRefs)
|
|
await $_getPrefetchedData<
|
|
RewardDeclaration,
|
|
$RewardDeclarationsTable,
|
|
RewardClaim
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$RewardDeclarationsTableReferences
|
|
._rewardClaimsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$RewardDeclarationsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).rewardClaimsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.declarationId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$RewardDeclarationsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$RewardDeclarationsTable,
|
|
RewardDeclaration,
|
|
$$RewardDeclarationsTableFilterComposer,
|
|
$$RewardDeclarationsTableOrderingComposer,
|
|
$$RewardDeclarationsTableAnnotationComposer,
|
|
$$RewardDeclarationsTableCreateCompanionBuilder,
|
|
$$RewardDeclarationsTableUpdateCompanionBuilder,
|
|
(RewardDeclaration, $$RewardDeclarationsTableReferences),
|
|
RewardDeclaration,
|
|
PrefetchHooks Function({
|
|
bool phaseId,
|
|
bool habitId,
|
|
bool rewardClaimsRefs,
|
|
})
|
|
>;
|
|
typedef $$RewardClaimsTableCreateCompanionBuilder =
|
|
RewardClaimsCompanion Function({
|
|
required String id,
|
|
required String declarationId,
|
|
required String milestoneReachedAt,
|
|
required bool fulfilled,
|
|
Value<String?> fulfilledAt,
|
|
Value<String?> reflection,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$RewardClaimsTableUpdateCompanionBuilder =
|
|
RewardClaimsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> declarationId,
|
|
Value<String> milestoneReachedAt,
|
|
Value<bool> fulfilled,
|
|
Value<String?> fulfilledAt,
|
|
Value<String?> reflection,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$RewardClaimsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $RewardClaimsTable, RewardClaim> {
|
|
$$RewardClaimsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $RewardDeclarationsTable _declarationIdTable(_$AppDatabase db) =>
|
|
db.rewardDeclarations.createAlias(
|
|
$_aliasNameGenerator(
|
|
db.rewardClaims.declarationId,
|
|
db.rewardDeclarations.id,
|
|
),
|
|
);
|
|
|
|
$$RewardDeclarationsTableProcessedTableManager get declarationId {
|
|
final $_column = $_itemColumn<String>('declaration_id')!;
|
|
|
|
final manager = $$RewardDeclarationsTableTableManager(
|
|
$_db,
|
|
$_db.rewardDeclarations,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_declarationIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$RewardClaimsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $RewardClaimsTable> {
|
|
$$RewardClaimsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get milestoneReachedAt => $composableBuilder(
|
|
column: $table.milestoneReachedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get fulfilled => $composableBuilder(
|
|
column: $table.fulfilled,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get fulfilledAt => $composableBuilder(
|
|
column: $table.fulfilledAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get reflection => $composableBuilder(
|
|
column: $table.reflection,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$RewardDeclarationsTableFilterComposer get declarationId {
|
|
final $$RewardDeclarationsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.declarationId,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$RewardClaimsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $RewardClaimsTable> {
|
|
$$RewardClaimsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get milestoneReachedAt => $composableBuilder(
|
|
column: $table.milestoneReachedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get fulfilled => $composableBuilder(
|
|
column: $table.fulfilled,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get fulfilledAt => $composableBuilder(
|
|
column: $table.fulfilledAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get reflection => $composableBuilder(
|
|
column: $table.reflection,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$RewardDeclarationsTableOrderingComposer get declarationId {
|
|
final $$RewardDeclarationsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.declarationId,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$RewardClaimsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $RewardClaimsTable> {
|
|
$$RewardClaimsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get milestoneReachedAt => $composableBuilder(
|
|
column: $table.milestoneReachedAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get fulfilled =>
|
|
$composableBuilder(column: $table.fulfilled, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get fulfilledAt => $composableBuilder(
|
|
column: $table.fulfilledAt,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get reflection => $composableBuilder(
|
|
column: $table.reflection,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$RewardDeclarationsTableAnnotationComposer get declarationId {
|
|
final $$RewardDeclarationsTableAnnotationComposer composer =
|
|
$composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.declarationId,
|
|
referencedTable: $db.rewardDeclarations,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$RewardDeclarationsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.rewardDeclarations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$RewardClaimsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$RewardClaimsTable,
|
|
RewardClaim,
|
|
$$RewardClaimsTableFilterComposer,
|
|
$$RewardClaimsTableOrderingComposer,
|
|
$$RewardClaimsTableAnnotationComposer,
|
|
$$RewardClaimsTableCreateCompanionBuilder,
|
|
$$RewardClaimsTableUpdateCompanionBuilder,
|
|
(RewardClaim, $$RewardClaimsTableReferences),
|
|
RewardClaim,
|
|
PrefetchHooks Function({bool declarationId})
|
|
> {
|
|
$$RewardClaimsTableTableManager(_$AppDatabase db, $RewardClaimsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$RewardClaimsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$RewardClaimsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$RewardClaimsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> declarationId = const Value.absent(),
|
|
Value<String> milestoneReachedAt = const Value.absent(),
|
|
Value<bool> fulfilled = const Value.absent(),
|
|
Value<String?> fulfilledAt = const Value.absent(),
|
|
Value<String?> reflection = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardClaimsCompanion(
|
|
id: id,
|
|
declarationId: declarationId,
|
|
milestoneReachedAt: milestoneReachedAt,
|
|
fulfilled: fulfilled,
|
|
fulfilledAt: fulfilledAt,
|
|
reflection: reflection,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String declarationId,
|
|
required String milestoneReachedAt,
|
|
required bool fulfilled,
|
|
Value<String?> fulfilledAt = const Value.absent(),
|
|
Value<String?> reflection = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => RewardClaimsCompanion.insert(
|
|
id: id,
|
|
declarationId: declarationId,
|
|
milestoneReachedAt: milestoneReachedAt,
|
|
fulfilled: fulfilled,
|
|
fulfilledAt: fulfilledAt,
|
|
reflection: reflection,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$RewardClaimsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({declarationId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (declarationId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.declarationId,
|
|
referencedTable: $$RewardClaimsTableReferences
|
|
._declarationIdTable(db),
|
|
referencedColumn: $$RewardClaimsTableReferences
|
|
._declarationIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$RewardClaimsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$RewardClaimsTable,
|
|
RewardClaim,
|
|
$$RewardClaimsTableFilterComposer,
|
|
$$RewardClaimsTableOrderingComposer,
|
|
$$RewardClaimsTableAnnotationComposer,
|
|
$$RewardClaimsTableCreateCompanionBuilder,
|
|
$$RewardClaimsTableUpdateCompanionBuilder,
|
|
(RewardClaim, $$RewardClaimsTableReferences),
|
|
RewardClaim,
|
|
PrefetchHooks Function({bool declarationId})
|
|
>;
|
|
typedef $$ReflectionsTableCreateCompanionBuilder =
|
|
ReflectionsCompanion Function({
|
|
required String id,
|
|
required String userId,
|
|
required String scope,
|
|
required String periodStart,
|
|
required String periodEnd,
|
|
Value<String?> phaseId,
|
|
Value<String?> kept,
|
|
Value<String?> missed,
|
|
Value<String?> adjust,
|
|
Value<String?> identityNote,
|
|
Value<double?> minimumRatio,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ReflectionsTableUpdateCompanionBuilder =
|
|
ReflectionsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> userId,
|
|
Value<String> scope,
|
|
Value<String> periodStart,
|
|
Value<String> periodEnd,
|
|
Value<String?> phaseId,
|
|
Value<String?> kept,
|
|
Value<String?> missed,
|
|
Value<String?> adjust,
|
|
Value<String?> identityNote,
|
|
Value<double?> minimumRatio,
|
|
Value<String?> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ReflectionsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ReflectionsTable, Reflection> {
|
|
$$ReflectionsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $UsersTable _userIdTable(_$AppDatabase db) => db.users.createAlias(
|
|
$_aliasNameGenerator(db.reflections.userId, db.users.id),
|
|
);
|
|
|
|
$$UsersTableProcessedTableManager get userId {
|
|
final $_column = $_itemColumn<String>('user_id')!;
|
|
|
|
final manager = $$UsersTableTableManager(
|
|
$_db,
|
|
$_db.users,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $PhasesTable _phaseIdTable(_$AppDatabase db) => db.phases.createAlias(
|
|
$_aliasNameGenerator(db.reflections.phaseId, db.phases.id),
|
|
);
|
|
|
|
$$PhasesTableProcessedTableManager? get phaseId {
|
|
final $_column = $_itemColumn<String>('phase_id');
|
|
if ($_column == null) return null;
|
|
final manager = $$PhasesTableTableManager(
|
|
$_db,
|
|
$_db.phases,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_phaseIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ReflectionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ReflectionsTable> {
|
|
$$ReflectionsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get scope => $composableBuilder(
|
|
column: $table.scope,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get periodStart => $composableBuilder(
|
|
column: $table.periodStart,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get periodEnd => $composableBuilder(
|
|
column: $table.periodEnd,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get kept => $composableBuilder(
|
|
column: $table.kept,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get missed => $composableBuilder(
|
|
column: $table.missed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get adjust => $composableBuilder(
|
|
column: $table.adjust,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get identityNote => $composableBuilder(
|
|
column: $table.identityNote,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get minimumRatio => $composableBuilder(
|
|
column: $table.minimumRatio,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$UsersTableFilterComposer get userId {
|
|
final $$UsersTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableFilterComposer get phaseId {
|
|
final $$PhasesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ReflectionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ReflectionsTable> {
|
|
$$ReflectionsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get scope => $composableBuilder(
|
|
column: $table.scope,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get periodStart => $composableBuilder(
|
|
column: $table.periodStart,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get periodEnd => $composableBuilder(
|
|
column: $table.periodEnd,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kept => $composableBuilder(
|
|
column: $table.kept,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get missed => $composableBuilder(
|
|
column: $table.missed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get adjust => $composableBuilder(
|
|
column: $table.adjust,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get identityNote => $composableBuilder(
|
|
column: $table.identityNote,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get minimumRatio => $composableBuilder(
|
|
column: $table.minimumRatio,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$UsersTableOrderingComposer get userId {
|
|
final $$UsersTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableOrderingComposer get phaseId {
|
|
final $$PhasesTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ReflectionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ReflectionsTable> {
|
|
$$ReflectionsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get scope =>
|
|
$composableBuilder(column: $table.scope, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get periodStart => $composableBuilder(
|
|
column: $table.periodStart,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get periodEnd =>
|
|
$composableBuilder(column: $table.periodEnd, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get kept =>
|
|
$composableBuilder(column: $table.kept, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get missed =>
|
|
$composableBuilder(column: $table.missed, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get adjust =>
|
|
$composableBuilder(column: $table.adjust, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get identityNote => $composableBuilder(
|
|
column: $table.identityNote,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get minimumRatio => $composableBuilder(
|
|
column: $table.minimumRatio,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
$$UsersTableAnnotationComposer get userId {
|
|
final $$UsersTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.userId,
|
|
referencedTable: $db.users,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$UsersTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.users,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$PhasesTableAnnotationComposer get phaseId {
|
|
final $$PhasesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.phaseId,
|
|
referencedTable: $db.phases,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PhasesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.phases,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ReflectionsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ReflectionsTable,
|
|
Reflection,
|
|
$$ReflectionsTableFilterComposer,
|
|
$$ReflectionsTableOrderingComposer,
|
|
$$ReflectionsTableAnnotationComposer,
|
|
$$ReflectionsTableCreateCompanionBuilder,
|
|
$$ReflectionsTableUpdateCompanionBuilder,
|
|
(Reflection, $$ReflectionsTableReferences),
|
|
Reflection,
|
|
PrefetchHooks Function({bool userId, bool phaseId})
|
|
> {
|
|
$$ReflectionsTableTableManager(_$AppDatabase db, $ReflectionsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ReflectionsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ReflectionsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ReflectionsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> userId = const Value.absent(),
|
|
Value<String> scope = const Value.absent(),
|
|
Value<String> periodStart = const Value.absent(),
|
|
Value<String> periodEnd = const Value.absent(),
|
|
Value<String?> phaseId = const Value.absent(),
|
|
Value<String?> kept = const Value.absent(),
|
|
Value<String?> missed = const Value.absent(),
|
|
Value<String?> adjust = const Value.absent(),
|
|
Value<String?> identityNote = const Value.absent(),
|
|
Value<double?> minimumRatio = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ReflectionsCompanion(
|
|
id: id,
|
|
userId: userId,
|
|
scope: scope,
|
|
periodStart: periodStart,
|
|
periodEnd: periodEnd,
|
|
phaseId: phaseId,
|
|
kept: kept,
|
|
missed: missed,
|
|
adjust: adjust,
|
|
identityNote: identityNote,
|
|
minimumRatio: minimumRatio,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String userId,
|
|
required String scope,
|
|
required String periodStart,
|
|
required String periodEnd,
|
|
Value<String?> phaseId = const Value.absent(),
|
|
Value<String?> kept = const Value.absent(),
|
|
Value<String?> missed = const Value.absent(),
|
|
Value<String?> adjust = const Value.absent(),
|
|
Value<String?> identityNote = const Value.absent(),
|
|
Value<double?> minimumRatio = const Value.absent(),
|
|
Value<String?> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ReflectionsCompanion.insert(
|
|
id: id,
|
|
userId: userId,
|
|
scope: scope,
|
|
periodStart: periodStart,
|
|
periodEnd: periodEnd,
|
|
phaseId: phaseId,
|
|
kept: kept,
|
|
missed: missed,
|
|
adjust: adjust,
|
|
identityNote: identityNote,
|
|
minimumRatio: minimumRatio,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ReflectionsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({userId = false, phaseId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (userId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.userId,
|
|
referencedTable: $$ReflectionsTableReferences
|
|
._userIdTable(db),
|
|
referencedColumn: $$ReflectionsTableReferences
|
|
._userIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (phaseId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.phaseId,
|
|
referencedTable: $$ReflectionsTableReferences
|
|
._phaseIdTable(db),
|
|
referencedColumn: $$ReflectionsTableReferences
|
|
._phaseIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ReflectionsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ReflectionsTable,
|
|
Reflection,
|
|
$$ReflectionsTableFilterComposer,
|
|
$$ReflectionsTableOrderingComposer,
|
|
$$ReflectionsTableAnnotationComposer,
|
|
$$ReflectionsTableCreateCompanionBuilder,
|
|
$$ReflectionsTableUpdateCompanionBuilder,
|
|
(Reflection, $$ReflectionsTableReferences),
|
|
Reflection,
|
|
PrefetchHooks Function({bool userId, bool phaseId})
|
|
>;
|
|
typedef $$MetaKvTableCreateCompanionBuilder =
|
|
MetaKvCompanion Function({
|
|
required String key,
|
|
required String value,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$MetaKvTableUpdateCompanionBuilder =
|
|
MetaKvCompanion Function({
|
|
Value<String> key,
|
|
Value<String> value,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$MetaKvTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MetaKvTable> {
|
|
$$MetaKvTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get key => $composableBuilder(
|
|
column: $table.key,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get value => $composableBuilder(
|
|
column: $table.value,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$MetaKvTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MetaKvTable> {
|
|
$$MetaKvTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get key => $composableBuilder(
|
|
column: $table.key,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get value => $composableBuilder(
|
|
column: $table.value,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$MetaKvTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MetaKvTable> {
|
|
$$MetaKvTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get key =>
|
|
$composableBuilder(column: $table.key, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get value =>
|
|
$composableBuilder(column: $table.value, builder: (column) => column);
|
|
}
|
|
|
|
class $$MetaKvTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$MetaKvTable,
|
|
MetaKvData,
|
|
$$MetaKvTableFilterComposer,
|
|
$$MetaKvTableOrderingComposer,
|
|
$$MetaKvTableAnnotationComposer,
|
|
$$MetaKvTableCreateCompanionBuilder,
|
|
$$MetaKvTableUpdateCompanionBuilder,
|
|
(MetaKvData, BaseReferences<_$AppDatabase, $MetaKvTable, MetaKvData>),
|
|
MetaKvData,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$MetaKvTableTableManager(_$AppDatabase db, $MetaKvTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MetaKvTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MetaKvTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MetaKvTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> key = const Value.absent(),
|
|
Value<String> value = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => MetaKvCompanion(key: key, value: value, rowid: rowid),
|
|
createCompanionCallback:
|
|
({
|
|
required String key,
|
|
required String value,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) =>
|
|
MetaKvCompanion.insert(key: key, value: value, rowid: rowid),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$MetaKvTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MetaKvTable,
|
|
MetaKvData,
|
|
$$MetaKvTableFilterComposer,
|
|
$$MetaKvTableOrderingComposer,
|
|
$$MetaKvTableAnnotationComposer,
|
|
$$MetaKvTableCreateCompanionBuilder,
|
|
$$MetaKvTableUpdateCompanionBuilder,
|
|
(MetaKvData, BaseReferences<_$AppDatabase, $MetaKvTable, MetaKvData>),
|
|
MetaKvData,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$ProtocolsTableTableManager get protocols =>
|
|
$$ProtocolsTableTableManager(_db, _db.protocols);
|
|
$$BreakProtocolsTableTableManager get breakProtocols =>
|
|
$$BreakProtocolsTableTableManager(_db, _db.breakProtocols);
|
|
$$CommonFramesTableTableManager get commonFrames =>
|
|
$$CommonFramesTableTableManager(_db, _db.commonFrames);
|
|
$$MethodologiesTableTableManager get methodologies =>
|
|
$$MethodologiesTableTableManager(_db, _db.methodologies);
|
|
$$FramePatternsTableTableManager get framePatterns =>
|
|
$$FramePatternsTableTableManager(_db, _db.framePatterns);
|
|
$$RewardMenuItemsTableTableManager get rewardMenuItems =>
|
|
$$RewardMenuItemsTableTableManager(_db, _db.rewardMenuItems);
|
|
$$ReferencesTableTableManager get references =>
|
|
$$ReferencesTableTableManager(_db, _db.references);
|
|
$$DietPatternsTableTableManager get dietPatterns =>
|
|
$$DietPatternsTableTableManager(_db, _db.dietPatterns);
|
|
$$UsersTableTableManager get users =>
|
|
$$UsersTableTableManager(_db, _db.users);
|
|
$$PhasesTableTableManager get phases =>
|
|
$$PhasesTableTableManager(_db, _db.phases);
|
|
$$HabitsTableTableManager get habits =>
|
|
$$HabitsTableTableManager(_db, _db.habits);
|
|
$$HabitDoseVariantsTableTableManager get habitDoseVariants =>
|
|
$$HabitDoseVariantsTableTableManager(_db, _db.habitDoseVariants);
|
|
$$IfThenRulesTableTableManager get ifThenRules =>
|
|
$$IfThenRulesTableTableManager(_db, _db.ifThenRules);
|
|
$$TrackerEntriesTableTableManager get trackerEntries =>
|
|
$$TrackerEntriesTableTableManager(_db, _db.trackerEntries);
|
|
$$LapseLogsTableTableManager get lapseLogs =>
|
|
$$LapseLogsTableTableManager(_db, _db.lapseLogs);
|
|
$$UrgeLogsTableTableManager get urgeLogs =>
|
|
$$UrgeLogsTableTableManager(_db, _db.urgeLogs);
|
|
$$RewardDeclarationsTableTableManager get rewardDeclarations =>
|
|
$$RewardDeclarationsTableTableManager(_db, _db.rewardDeclarations);
|
|
$$RewardClaimsTableTableManager get rewardClaims =>
|
|
$$RewardClaimsTableTableManager(_db, _db.rewardClaims);
|
|
$$ReflectionsTableTableManager get reflections =>
|
|
$$ReflectionsTableTableManager(_db, _db.reflections);
|
|
$$MetaKvTableTableManager get metaKv =>
|
|
$$MetaKvTableTableManager(_db, _db.metaKv);
|
|
}
|