6243 lines
195 KiB
Dart
6243 lines
195 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $ExercisesTable extends Exercises
|
|
with TableInfo<$ExercisesTable, Exercise> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ExercisesTable(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 _instructionsMeta = const VerificationMeta(
|
|
'instructions',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> instructions = GeneratedColumn<String>(
|
|
'instructions',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _enrichmentMeta = const VerificationMeta(
|
|
'enrichment',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> enrichment = GeneratedColumn<String>(
|
|
'enrichment',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _tagsMeta = const VerificationMeta('tags');
|
|
@override
|
|
late final GeneratedColumn<String> tags = GeneratedColumn<String>(
|
|
'tags',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _videoUrlMeta = const VerificationMeta(
|
|
'videoUrl',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> videoUrl = GeneratedColumn<String>(
|
|
'video_url',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
instructions,
|
|
enrichment,
|
|
tags,
|
|
videoUrl,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'exercises';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Exercise> 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('instructions')) {
|
|
context.handle(
|
|
_instructionsMeta,
|
|
instructions.isAcceptableOrUnknown(
|
|
data['instructions']!,
|
|
_instructionsMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('enrichment')) {
|
|
context.handle(
|
|
_enrichmentMeta,
|
|
enrichment.isAcceptableOrUnknown(data['enrichment']!, _enrichmentMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('tags')) {
|
|
context.handle(
|
|
_tagsMeta,
|
|
tags.isAcceptableOrUnknown(data['tags']!, _tagsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('video_url')) {
|
|
context.handle(
|
|
_videoUrlMeta,
|
|
videoUrl.isAcceptableOrUnknown(data['video_url']!, _videoUrlMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Exercise map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Exercise(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
instructions: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}instructions'],
|
|
),
|
|
enrichment: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}enrichment'],
|
|
),
|
|
tags: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tags'],
|
|
),
|
|
videoUrl: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}video_url'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ExercisesTable createAlias(String alias) {
|
|
return $ExercisesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Exercise extends DataClass implements Insertable<Exercise> {
|
|
final String id;
|
|
final String name;
|
|
final String? instructions;
|
|
final String? enrichment;
|
|
final String? tags;
|
|
final String? videoUrl;
|
|
const Exercise({
|
|
required this.id,
|
|
required this.name,
|
|
this.instructions,
|
|
this.enrichment,
|
|
this.tags,
|
|
this.videoUrl,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || instructions != null) {
|
|
map['instructions'] = Variable<String>(instructions);
|
|
}
|
|
if (!nullToAbsent || enrichment != null) {
|
|
map['enrichment'] = Variable<String>(enrichment);
|
|
}
|
|
if (!nullToAbsent || tags != null) {
|
|
map['tags'] = Variable<String>(tags);
|
|
}
|
|
if (!nullToAbsent || videoUrl != null) {
|
|
map['video_url'] = Variable<String>(videoUrl);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ExercisesCompanion toCompanion(bool nullToAbsent) {
|
|
return ExercisesCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
instructions: instructions == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(instructions),
|
|
enrichment: enrichment == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(enrichment),
|
|
tags: tags == null && nullToAbsent ? const Value.absent() : Value(tags),
|
|
videoUrl: videoUrl == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(videoUrl),
|
|
);
|
|
}
|
|
|
|
factory Exercise.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Exercise(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
instructions: serializer.fromJson<String?>(json['instructions']),
|
|
enrichment: serializer.fromJson<String?>(json['enrichment']),
|
|
tags: serializer.fromJson<String?>(json['tags']),
|
|
videoUrl: serializer.fromJson<String?>(json['videoUrl']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'instructions': serializer.toJson<String?>(instructions),
|
|
'enrichment': serializer.toJson<String?>(enrichment),
|
|
'tags': serializer.toJson<String?>(tags),
|
|
'videoUrl': serializer.toJson<String?>(videoUrl),
|
|
};
|
|
}
|
|
|
|
Exercise copyWith({
|
|
String? id,
|
|
String? name,
|
|
Value<String?> instructions = const Value.absent(),
|
|
Value<String?> enrichment = const Value.absent(),
|
|
Value<String?> tags = const Value.absent(),
|
|
Value<String?> videoUrl = const Value.absent(),
|
|
}) => Exercise(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
instructions: instructions.present ? instructions.value : this.instructions,
|
|
enrichment: enrichment.present ? enrichment.value : this.enrichment,
|
|
tags: tags.present ? tags.value : this.tags,
|
|
videoUrl: videoUrl.present ? videoUrl.value : this.videoUrl,
|
|
);
|
|
Exercise copyWithCompanion(ExercisesCompanion data) {
|
|
return Exercise(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
instructions: data.instructions.present
|
|
? data.instructions.value
|
|
: this.instructions,
|
|
enrichment: data.enrichment.present
|
|
? data.enrichment.value
|
|
: this.enrichment,
|
|
tags: data.tags.present ? data.tags.value : this.tags,
|
|
videoUrl: data.videoUrl.present ? data.videoUrl.value : this.videoUrl,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Exercise(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('instructions: $instructions, ')
|
|
..write('enrichment: $enrichment, ')
|
|
..write('tags: $tags, ')
|
|
..write('videoUrl: $videoUrl')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, name, instructions, enrichment, tags, videoUrl);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Exercise &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.instructions == this.instructions &&
|
|
other.enrichment == this.enrichment &&
|
|
other.tags == this.tags &&
|
|
other.videoUrl == this.videoUrl);
|
|
}
|
|
|
|
class ExercisesCompanion extends UpdateCompanion<Exercise> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String?> instructions;
|
|
final Value<String?> enrichment;
|
|
final Value<String?> tags;
|
|
final Value<String?> videoUrl;
|
|
final Value<int> rowid;
|
|
const ExercisesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.instructions = const Value.absent(),
|
|
this.enrichment = const Value.absent(),
|
|
this.tags = const Value.absent(),
|
|
this.videoUrl = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ExercisesCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
this.instructions = const Value.absent(),
|
|
this.enrichment = const Value.absent(),
|
|
this.tags = const Value.absent(),
|
|
this.videoUrl = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name);
|
|
static Insertable<Exercise> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? instructions,
|
|
Expression<String>? enrichment,
|
|
Expression<String>? tags,
|
|
Expression<String>? videoUrl,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (instructions != null) 'instructions': instructions,
|
|
if (enrichment != null) 'enrichment': enrichment,
|
|
if (tags != null) 'tags': tags,
|
|
if (videoUrl != null) 'video_url': videoUrl,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ExercisesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String?>? instructions,
|
|
Value<String?>? enrichment,
|
|
Value<String?>? tags,
|
|
Value<String?>? videoUrl,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ExercisesCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
instructions: instructions ?? this.instructions,
|
|
enrichment: enrichment ?? this.enrichment,
|
|
tags: tags ?? this.tags,
|
|
videoUrl: videoUrl ?? this.videoUrl,
|
|
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 (instructions.present) {
|
|
map['instructions'] = Variable<String>(instructions.value);
|
|
}
|
|
if (enrichment.present) {
|
|
map['enrichment'] = Variable<String>(enrichment.value);
|
|
}
|
|
if (tags.present) {
|
|
map['tags'] = Variable<String>(tags.value);
|
|
}
|
|
if (videoUrl.present) {
|
|
map['video_url'] = Variable<String>(videoUrl.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ExercisesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('instructions: $instructions, ')
|
|
..write('enrichment: $enrichment, ')
|
|
..write('tags: $tags, ')
|
|
..write('videoUrl: $videoUrl, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $TrainingPlansTable extends TrainingPlans
|
|
with TableInfo<$TrainingPlansTable, TrainingPlan> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$TrainingPlansTable(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 _sectionsMeta = const VerificationMeta(
|
|
'sections',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sections = GeneratedColumn<String>(
|
|
'sections',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, name, sections];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'training_plans';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<TrainingPlan> 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('sections')) {
|
|
context.handle(
|
|
_sectionsMeta,
|
|
sections.isAcceptableOrUnknown(data['sections']!, _sectionsMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
TrainingPlan map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return TrainingPlan(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
sections: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}sections'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$TrainingPlansTable createAlias(String alias) {
|
|
return $TrainingPlansTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class TrainingPlan extends DataClass implements Insertable<TrainingPlan> {
|
|
final String id;
|
|
final String name;
|
|
final String? sections;
|
|
const TrainingPlan({required this.id, required this.name, this.sections});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || sections != null) {
|
|
map['sections'] = Variable<String>(sections);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
TrainingPlansCompanion toCompanion(bool nullToAbsent) {
|
|
return TrainingPlansCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
sections: sections == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(sections),
|
|
);
|
|
}
|
|
|
|
factory TrainingPlan.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return TrainingPlan(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
sections: serializer.fromJson<String?>(json['sections']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'sections': serializer.toJson<String?>(sections),
|
|
};
|
|
}
|
|
|
|
TrainingPlan copyWith({
|
|
String? id,
|
|
String? name,
|
|
Value<String?> sections = const Value.absent(),
|
|
}) => TrainingPlan(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
sections: sections.present ? sections.value : this.sections,
|
|
);
|
|
TrainingPlan copyWithCompanion(TrainingPlansCompanion data) {
|
|
return TrainingPlan(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
sections: data.sections.present ? data.sections.value : this.sections,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TrainingPlan(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('sections: $sections')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, sections);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is TrainingPlan &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.sections == this.sections);
|
|
}
|
|
|
|
class TrainingPlansCompanion extends UpdateCompanion<TrainingPlan> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String?> sections;
|
|
final Value<int> rowid;
|
|
const TrainingPlansCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.sections = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
TrainingPlansCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
this.sections = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name);
|
|
static Insertable<TrainingPlan> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? sections,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (sections != null) 'sections': sections,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
TrainingPlansCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String?>? sections,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return TrainingPlansCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
sections: sections ?? this.sections,
|
|
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 (sections.present) {
|
|
map['sections'] = Variable<String>(sections.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TrainingPlansCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('sections: $sections, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ProgramsTable extends Programs with TableInfo<$ProgramsTable, Program> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProgramsTable(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 _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> createdAt = GeneratedColumn<String>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, name, createdAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'programs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Program> 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('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Program map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Program(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProgramsTable createAlias(String alias) {
|
|
return $ProgramsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Program extends DataClass implements Insertable<Program> {
|
|
final String id;
|
|
final String name;
|
|
final String createdAt;
|
|
const Program({
|
|
required this.id,
|
|
required this.name,
|
|
required this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ProgramsCompanion toCompanion(bool nullToAbsent) {
|
|
return ProgramsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory Program.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Program(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
createdAt: serializer.fromJson<String>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'createdAt': serializer.toJson<String>(createdAt),
|
|
};
|
|
}
|
|
|
|
Program copyWith({String? id, String? name, String? createdAt}) => Program(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
Program copyWithCompanion(ProgramsCompanion data) {
|
|
return Program(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Program(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Program &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ProgramsCompanion extends UpdateCompanion<Program> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String> createdAt;
|
|
final Value<int> rowid;
|
|
const ProgramsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProgramsCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required String createdAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<Program> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProgramsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProgramsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
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 (name.present) {
|
|
map['name'] = Variable<String>(name.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('ProgramsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ProgramWeeksTable extends ProgramWeeks
|
|
with TableInfo<$ProgramWeeksTable, ProgramWeek> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProgramWeeksTable(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 _programIdMeta = const VerificationMeta(
|
|
'programId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> programId = GeneratedColumn<String>(
|
|
'program_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES programs (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _positionMeta = const VerificationMeta(
|
|
'position',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
|
|
@override
|
|
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
|
|
'notes',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, programId, position, notes];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'program_weeks';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ProgramWeek> 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('program_id')) {
|
|
context.handle(
|
|
_programIdMeta,
|
|
programId.isAcceptableOrUnknown(data['program_id']!, _programIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIdMeta);
|
|
}
|
|
if (data.containsKey('position')) {
|
|
context.handle(
|
|
_positionMeta,
|
|
position.isAcceptableOrUnknown(data['position']!, _positionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMeta);
|
|
}
|
|
if (data.containsKey('notes')) {
|
|
context.handle(
|
|
_notesMeta,
|
|
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ProgramWeek map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ProgramWeek(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
programId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_id'],
|
|
)!,
|
|
position: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position'],
|
|
)!,
|
|
notes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}notes'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProgramWeeksTable createAlias(String alias) {
|
|
return $ProgramWeeksTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ProgramWeek extends DataClass implements Insertable<ProgramWeek> {
|
|
final String id;
|
|
final String programId;
|
|
final int position;
|
|
final String? notes;
|
|
const ProgramWeek({
|
|
required this.id,
|
|
required this.programId,
|
|
required this.position,
|
|
this.notes,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['program_id'] = Variable<String>(programId);
|
|
map['position'] = Variable<int>(position);
|
|
if (!nullToAbsent || notes != null) {
|
|
map['notes'] = Variable<String>(notes);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
ProgramWeeksCompanion toCompanion(bool nullToAbsent) {
|
|
return ProgramWeeksCompanion(
|
|
id: Value(id),
|
|
programId: Value(programId),
|
|
position: Value(position),
|
|
notes: notes == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(notes),
|
|
);
|
|
}
|
|
|
|
factory ProgramWeek.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ProgramWeek(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
programId: serializer.fromJson<String>(json['programId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
notes: serializer.fromJson<String?>(json['notes']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'programId': serializer.toJson<String>(programId),
|
|
'position': serializer.toJson<int>(position),
|
|
'notes': serializer.toJson<String?>(notes),
|
|
};
|
|
}
|
|
|
|
ProgramWeek copyWith({
|
|
String? id,
|
|
String? programId,
|
|
int? position,
|
|
Value<String?> notes = const Value.absent(),
|
|
}) => ProgramWeek(
|
|
id: id ?? this.id,
|
|
programId: programId ?? this.programId,
|
|
position: position ?? this.position,
|
|
notes: notes.present ? notes.value : this.notes,
|
|
);
|
|
ProgramWeek copyWithCompanion(ProgramWeeksCompanion data) {
|
|
return ProgramWeek(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
programId: data.programId.present ? data.programId.value : this.programId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
notes: data.notes.present ? data.notes.value : this.notes,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramWeek(')
|
|
..write('id: $id, ')
|
|
..write('programId: $programId, ')
|
|
..write('position: $position, ')
|
|
..write('notes: $notes')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, programId, position, notes);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ProgramWeek &&
|
|
other.id == this.id &&
|
|
other.programId == this.programId &&
|
|
other.position == this.position &&
|
|
other.notes == this.notes);
|
|
}
|
|
|
|
class ProgramWeeksCompanion extends UpdateCompanion<ProgramWeek> {
|
|
final Value<String> id;
|
|
final Value<String> programId;
|
|
final Value<int> position;
|
|
final Value<String?> notes;
|
|
final Value<int> rowid;
|
|
const ProgramWeeksCompanion({
|
|
this.id = const Value.absent(),
|
|
this.programId = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProgramWeeksCompanion.insert({
|
|
required String id,
|
|
required String programId,
|
|
required int position,
|
|
this.notes = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
programId = Value(programId),
|
|
position = Value(position);
|
|
static Insertable<ProgramWeek> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? programId,
|
|
Expression<int>? position,
|
|
Expression<String>? notes,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (programId != null) 'program_id': programId,
|
|
if (position != null) 'position': position,
|
|
if (notes != null) 'notes': notes,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProgramWeeksCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? programId,
|
|
Value<int>? position,
|
|
Value<String?>? notes,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProgramWeeksCompanion(
|
|
id: id ?? this.id,
|
|
programId: programId ?? this.programId,
|
|
position: position ?? this.position,
|
|
notes: notes ?? this.notes,
|
|
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 (programId.present) {
|
|
map['program_id'] = Variable<String>(programId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (notes.present) {
|
|
map['notes'] = Variable<String>(notes.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramWeeksCompanion(')
|
|
..write('id: $id, ')
|
|
..write('programId: $programId, ')
|
|
..write('position: $position, ')
|
|
..write('notes: $notes, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ProgramWorkoutsTable extends ProgramWorkouts
|
|
with TableInfo<$ProgramWorkoutsTable, ProgramWorkout> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProgramWorkoutsTable(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 _weekIdMeta = const VerificationMeta('weekId');
|
|
@override
|
|
late final GeneratedColumn<String> weekId = GeneratedColumn<String>(
|
|
'week_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES program_weeks (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _programIdMeta = const VerificationMeta(
|
|
'programId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> programId = GeneratedColumn<String>(
|
|
'program_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES programs (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _dayMeta = const VerificationMeta('day');
|
|
@override
|
|
late final GeneratedColumn<String> day = GeneratedColumn<String>(
|
|
'day',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _typeMeta = const VerificationMeta('type');
|
|
@override
|
|
late final GeneratedColumn<String> type = GeneratedColumn<String>(
|
|
'type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _refIdMeta = const VerificationMeta('refId');
|
|
@override
|
|
late final GeneratedColumn<String> refId = GeneratedColumn<String>(
|
|
'ref_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _descriptionMeta = const VerificationMeta(
|
|
'description',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _completedMeta = const VerificationMeta(
|
|
'completed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> completed = GeneratedColumn<bool>(
|
|
'completed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("completed" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
weekId,
|
|
programId,
|
|
day,
|
|
type,
|
|
refId,
|
|
name,
|
|
description,
|
|
completed,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'program_workouts';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ProgramWorkout> 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('week_id')) {
|
|
context.handle(
|
|
_weekIdMeta,
|
|
weekId.isAcceptableOrUnknown(data['week_id']!, _weekIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_weekIdMeta);
|
|
}
|
|
if (data.containsKey('program_id')) {
|
|
context.handle(
|
|
_programIdMeta,
|
|
programId.isAcceptableOrUnknown(data['program_id']!, _programIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_programIdMeta);
|
|
}
|
|
if (data.containsKey('day')) {
|
|
context.handle(
|
|
_dayMeta,
|
|
day.isAcceptableOrUnknown(data['day']!, _dayMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dayMeta);
|
|
}
|
|
if (data.containsKey('type')) {
|
|
context.handle(
|
|
_typeMeta,
|
|
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_typeMeta);
|
|
}
|
|
if (data.containsKey('ref_id')) {
|
|
context.handle(
|
|
_refIdMeta,
|
|
refId.isAcceptableOrUnknown(data['ref_id']!, _refIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!,
|
|
_descriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('completed')) {
|
|
context.handle(
|
|
_completedMeta,
|
|
completed.isAcceptableOrUnknown(data['completed']!, _completedMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ProgramWorkout map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ProgramWorkout(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
weekId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}week_id'],
|
|
)!,
|
|
programId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}program_id'],
|
|
)!,
|
|
day: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}day'],
|
|
)!,
|
|
type: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}type'],
|
|
)!,
|
|
refId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}ref_id'],
|
|
),
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
),
|
|
description: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}description'],
|
|
),
|
|
completed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}completed'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProgramWorkoutsTable createAlias(String alias) {
|
|
return $ProgramWorkoutsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ProgramWorkout extends DataClass implements Insertable<ProgramWorkout> {
|
|
final String id;
|
|
final String weekId;
|
|
final String programId;
|
|
final String day;
|
|
final String type;
|
|
final String? refId;
|
|
final String? name;
|
|
final String? description;
|
|
final bool completed;
|
|
const ProgramWorkout({
|
|
required this.id,
|
|
required this.weekId,
|
|
required this.programId,
|
|
required this.day,
|
|
required this.type,
|
|
this.refId,
|
|
this.name,
|
|
this.description,
|
|
required this.completed,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['week_id'] = Variable<String>(weekId);
|
|
map['program_id'] = Variable<String>(programId);
|
|
map['day'] = Variable<String>(day);
|
|
map['type'] = Variable<String>(type);
|
|
if (!nullToAbsent || refId != null) {
|
|
map['ref_id'] = Variable<String>(refId);
|
|
}
|
|
if (!nullToAbsent || name != null) {
|
|
map['name'] = Variable<String>(name);
|
|
}
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
map['completed'] = Variable<bool>(completed);
|
|
return map;
|
|
}
|
|
|
|
ProgramWorkoutsCompanion toCompanion(bool nullToAbsent) {
|
|
return ProgramWorkoutsCompanion(
|
|
id: Value(id),
|
|
weekId: Value(weekId),
|
|
programId: Value(programId),
|
|
day: Value(day),
|
|
type: Value(type),
|
|
refId: refId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(refId),
|
|
name: name == null && nullToAbsent ? const Value.absent() : Value(name),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
completed: Value(completed),
|
|
);
|
|
}
|
|
|
|
factory ProgramWorkout.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ProgramWorkout(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
weekId: serializer.fromJson<String>(json['weekId']),
|
|
programId: serializer.fromJson<String>(json['programId']),
|
|
day: serializer.fromJson<String>(json['day']),
|
|
type: serializer.fromJson<String>(json['type']),
|
|
refId: serializer.fromJson<String?>(json['refId']),
|
|
name: serializer.fromJson<String?>(json['name']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
completed: serializer.fromJson<bool>(json['completed']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'weekId': serializer.toJson<String>(weekId),
|
|
'programId': serializer.toJson<String>(programId),
|
|
'day': serializer.toJson<String>(day),
|
|
'type': serializer.toJson<String>(type),
|
|
'refId': serializer.toJson<String?>(refId),
|
|
'name': serializer.toJson<String?>(name),
|
|
'description': serializer.toJson<String?>(description),
|
|
'completed': serializer.toJson<bool>(completed),
|
|
};
|
|
}
|
|
|
|
ProgramWorkout copyWith({
|
|
String? id,
|
|
String? weekId,
|
|
String? programId,
|
|
String? day,
|
|
String? type,
|
|
Value<String?> refId = const Value.absent(),
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
bool? completed,
|
|
}) => ProgramWorkout(
|
|
id: id ?? this.id,
|
|
weekId: weekId ?? this.weekId,
|
|
programId: programId ?? this.programId,
|
|
day: day ?? this.day,
|
|
type: type ?? this.type,
|
|
refId: refId.present ? refId.value : this.refId,
|
|
name: name.present ? name.value : this.name,
|
|
description: description.present ? description.value : this.description,
|
|
completed: completed ?? this.completed,
|
|
);
|
|
ProgramWorkout copyWithCompanion(ProgramWorkoutsCompanion data) {
|
|
return ProgramWorkout(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
weekId: data.weekId.present ? data.weekId.value : this.weekId,
|
|
programId: data.programId.present ? data.programId.value : this.programId,
|
|
day: data.day.present ? data.day.value : this.day,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
refId: data.refId.present ? data.refId.value : this.refId,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
description: data.description.present
|
|
? data.description.value
|
|
: this.description,
|
|
completed: data.completed.present ? data.completed.value : this.completed,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramWorkout(')
|
|
..write('id: $id, ')
|
|
..write('weekId: $weekId, ')
|
|
..write('programId: $programId, ')
|
|
..write('day: $day, ')
|
|
..write('type: $type, ')
|
|
..write('refId: $refId, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('completed: $completed')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
weekId,
|
|
programId,
|
|
day,
|
|
type,
|
|
refId,
|
|
name,
|
|
description,
|
|
completed,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ProgramWorkout &&
|
|
other.id == this.id &&
|
|
other.weekId == this.weekId &&
|
|
other.programId == this.programId &&
|
|
other.day == this.day &&
|
|
other.type == this.type &&
|
|
other.refId == this.refId &&
|
|
other.name == this.name &&
|
|
other.description == this.description &&
|
|
other.completed == this.completed);
|
|
}
|
|
|
|
class ProgramWorkoutsCompanion extends UpdateCompanion<ProgramWorkout> {
|
|
final Value<String> id;
|
|
final Value<String> weekId;
|
|
final Value<String> programId;
|
|
final Value<String> day;
|
|
final Value<String> type;
|
|
final Value<String?> refId;
|
|
final Value<String?> name;
|
|
final Value<String?> description;
|
|
final Value<bool> completed;
|
|
final Value<int> rowid;
|
|
const ProgramWorkoutsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.weekId = const Value.absent(),
|
|
this.programId = const Value.absent(),
|
|
this.day = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
this.refId = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.completed = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProgramWorkoutsCompanion.insert({
|
|
required String id,
|
|
required String weekId,
|
|
required String programId,
|
|
required String day,
|
|
required String type,
|
|
this.refId = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.completed = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
weekId = Value(weekId),
|
|
programId = Value(programId),
|
|
day = Value(day),
|
|
type = Value(type);
|
|
static Insertable<ProgramWorkout> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? weekId,
|
|
Expression<String>? programId,
|
|
Expression<String>? day,
|
|
Expression<String>? type,
|
|
Expression<String>? refId,
|
|
Expression<String>? name,
|
|
Expression<String>? description,
|
|
Expression<bool>? completed,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (weekId != null) 'week_id': weekId,
|
|
if (programId != null) 'program_id': programId,
|
|
if (day != null) 'day': day,
|
|
if (type != null) 'type': type,
|
|
if (refId != null) 'ref_id': refId,
|
|
if (name != null) 'name': name,
|
|
if (description != null) 'description': description,
|
|
if (completed != null) 'completed': completed,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProgramWorkoutsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? weekId,
|
|
Value<String>? programId,
|
|
Value<String>? day,
|
|
Value<String>? type,
|
|
Value<String?>? refId,
|
|
Value<String?>? name,
|
|
Value<String?>? description,
|
|
Value<bool>? completed,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProgramWorkoutsCompanion(
|
|
id: id ?? this.id,
|
|
weekId: weekId ?? this.weekId,
|
|
programId: programId ?? this.programId,
|
|
day: day ?? this.day,
|
|
type: type ?? this.type,
|
|
refId: refId ?? this.refId,
|
|
name: name ?? this.name,
|
|
description: description ?? this.description,
|
|
completed: completed ?? this.completed,
|
|
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 (weekId.present) {
|
|
map['week_id'] = Variable<String>(weekId.value);
|
|
}
|
|
if (programId.present) {
|
|
map['program_id'] = Variable<String>(programId.value);
|
|
}
|
|
if (day.present) {
|
|
map['day'] = Variable<String>(day.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(type.value);
|
|
}
|
|
if (refId.present) {
|
|
map['ref_id'] = Variable<String>(refId.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (completed.present) {
|
|
map['completed'] = Variable<bool>(completed.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProgramWorkoutsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('weekId: $weekId, ')
|
|
..write('programId: $programId, ')
|
|
..write('day: $day, ')
|
|
..write('type: $type, ')
|
|
..write('refId: $refId, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('completed: $completed, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $AnalysisSessionsTable extends AnalysisSessions
|
|
with TableInfo<$AnalysisSessionsTable, AnalysisSession> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$AnalysisSessionsTable(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 _dateMeta = const VerificationMeta('date');
|
|
@override
|
|
late final GeneratedColumn<String> date = GeneratedColumn<String>(
|
|
'date',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _videoPathMeta = const VerificationMeta(
|
|
'videoPath',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> videoPath = GeneratedColumn<String>(
|
|
'video_path',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, name, date, videoPath];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'analysis_sessions';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<AnalysisSession> 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('date')) {
|
|
context.handle(
|
|
_dateMeta,
|
|
date.isAcceptableOrUnknown(data['date']!, _dateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dateMeta);
|
|
}
|
|
if (data.containsKey('video_path')) {
|
|
context.handle(
|
|
_videoPathMeta,
|
|
videoPath.isAcceptableOrUnknown(data['video_path']!, _videoPathMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
AnalysisSession map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return AnalysisSession(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
date: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}date'],
|
|
)!,
|
|
videoPath: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}video_path'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$AnalysisSessionsTable createAlias(String alias) {
|
|
return $AnalysisSessionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class AnalysisSession extends DataClass implements Insertable<AnalysisSession> {
|
|
final String id;
|
|
final String name;
|
|
final String date;
|
|
final String? videoPath;
|
|
const AnalysisSession({
|
|
required this.id,
|
|
required this.name,
|
|
required this.date,
|
|
this.videoPath,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['date'] = Variable<String>(date);
|
|
if (!nullToAbsent || videoPath != null) {
|
|
map['video_path'] = Variable<String>(videoPath);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
AnalysisSessionsCompanion toCompanion(bool nullToAbsent) {
|
|
return AnalysisSessionsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
date: Value(date),
|
|
videoPath: videoPath == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(videoPath),
|
|
);
|
|
}
|
|
|
|
factory AnalysisSession.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return AnalysisSession(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
date: serializer.fromJson<String>(json['date']),
|
|
videoPath: serializer.fromJson<String?>(json['videoPath']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'date': serializer.toJson<String>(date),
|
|
'videoPath': serializer.toJson<String?>(videoPath),
|
|
};
|
|
}
|
|
|
|
AnalysisSession copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? date,
|
|
Value<String?> videoPath = const Value.absent(),
|
|
}) => AnalysisSession(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
date: date ?? this.date,
|
|
videoPath: videoPath.present ? videoPath.value : this.videoPath,
|
|
);
|
|
AnalysisSession copyWithCompanion(AnalysisSessionsCompanion data) {
|
|
return AnalysisSession(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
date: data.date.present ? data.date.value : this.date,
|
|
videoPath: data.videoPath.present ? data.videoPath.value : this.videoPath,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AnalysisSession(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('date: $date, ')
|
|
..write('videoPath: $videoPath')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, date, videoPath);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is AnalysisSession &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.date == this.date &&
|
|
other.videoPath == this.videoPath);
|
|
}
|
|
|
|
class AnalysisSessionsCompanion extends UpdateCompanion<AnalysisSession> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String> date;
|
|
final Value<String?> videoPath;
|
|
final Value<int> rowid;
|
|
const AnalysisSessionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.videoPath = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
AnalysisSessionsCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required String date,
|
|
this.videoPath = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
date = Value(date);
|
|
static Insertable<AnalysisSession> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? date,
|
|
Expression<String>? videoPath,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (date != null) 'date': date,
|
|
if (videoPath != null) 'video_path': videoPath,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
AnalysisSessionsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String>? date,
|
|
Value<String?>? videoPath,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return AnalysisSessionsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
date: date ?? this.date,
|
|
videoPath: videoPath ?? this.videoPath,
|
|
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 (date.present) {
|
|
map['date'] = Variable<String>(date.value);
|
|
}
|
|
if (videoPath.present) {
|
|
map['video_path'] = Variable<String>(videoPath.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AnalysisSessionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('date: $date, ')
|
|
..write('videoPath: $videoPath, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $AnnotationsTable extends Annotations
|
|
with TableInfo<$AnnotationsTable, Annotation> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$AnnotationsTable(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 _sessionIdMeta = const VerificationMeta(
|
|
'sessionId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sessionId = GeneratedColumn<String>(
|
|
'session_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES analysis_sessions (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _startTimeMeta = const VerificationMeta(
|
|
'startTime',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> startTime = GeneratedColumn<double>(
|
|
'start_time',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _endTimeMeta = const VerificationMeta(
|
|
'endTime',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> endTime = GeneratedColumn<double>(
|
|
'end_time',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _descriptionMeta = const VerificationMeta(
|
|
'description',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _colorMeta = const VerificationMeta('color');
|
|
@override
|
|
late final GeneratedColumn<String> color = GeneratedColumn<String>(
|
|
'color',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
sessionId,
|
|
startTime,
|
|
endTime,
|
|
name,
|
|
description,
|
|
color,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'annotations';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Annotation> 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('session_id')) {
|
|
context.handle(
|
|
_sessionIdMeta,
|
|
sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_sessionIdMeta);
|
|
}
|
|
if (data.containsKey('start_time')) {
|
|
context.handle(
|
|
_startTimeMeta,
|
|
startTime.isAcceptableOrUnknown(data['start_time']!, _startTimeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_startTimeMeta);
|
|
}
|
|
if (data.containsKey('end_time')) {
|
|
context.handle(
|
|
_endTimeMeta,
|
|
endTime.isAcceptableOrUnknown(data['end_time']!, _endTimeMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_endTimeMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!,
|
|
_descriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('color')) {
|
|
context.handle(
|
|
_colorMeta,
|
|
color.isAcceptableOrUnknown(data['color']!, _colorMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Annotation map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Annotation(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
sessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}session_id'],
|
|
)!,
|
|
startTime: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}start_time'],
|
|
)!,
|
|
endTime: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}end_time'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
),
|
|
description: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}description'],
|
|
),
|
|
color: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}color'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$AnnotationsTable createAlias(String alias) {
|
|
return $AnnotationsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Annotation extends DataClass implements Insertable<Annotation> {
|
|
final String id;
|
|
final String sessionId;
|
|
final double startTime;
|
|
final double endTime;
|
|
final String? name;
|
|
final String? description;
|
|
final String? color;
|
|
const Annotation({
|
|
required this.id,
|
|
required this.sessionId,
|
|
required this.startTime,
|
|
required this.endTime,
|
|
this.name,
|
|
this.description,
|
|
this.color,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['session_id'] = Variable<String>(sessionId);
|
|
map['start_time'] = Variable<double>(startTime);
|
|
map['end_time'] = Variable<double>(endTime);
|
|
if (!nullToAbsent || name != null) {
|
|
map['name'] = Variable<String>(name);
|
|
}
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
if (!nullToAbsent || color != null) {
|
|
map['color'] = Variable<String>(color);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
AnnotationsCompanion toCompanion(bool nullToAbsent) {
|
|
return AnnotationsCompanion(
|
|
id: Value(id),
|
|
sessionId: Value(sessionId),
|
|
startTime: Value(startTime),
|
|
endTime: Value(endTime),
|
|
name: name == null && nullToAbsent ? const Value.absent() : Value(name),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
color: color == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(color),
|
|
);
|
|
}
|
|
|
|
factory Annotation.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Annotation(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
sessionId: serializer.fromJson<String>(json['sessionId']),
|
|
startTime: serializer.fromJson<double>(json['startTime']),
|
|
endTime: serializer.fromJson<double>(json['endTime']),
|
|
name: serializer.fromJson<String?>(json['name']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
color: serializer.fromJson<String?>(json['color']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'sessionId': serializer.toJson<String>(sessionId),
|
|
'startTime': serializer.toJson<double>(startTime),
|
|
'endTime': serializer.toJson<double>(endTime),
|
|
'name': serializer.toJson<String?>(name),
|
|
'description': serializer.toJson<String?>(description),
|
|
'color': serializer.toJson<String?>(color),
|
|
};
|
|
}
|
|
|
|
Annotation copyWith({
|
|
String? id,
|
|
String? sessionId,
|
|
double? startTime,
|
|
double? endTime,
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> color = const Value.absent(),
|
|
}) => Annotation(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
startTime: startTime ?? this.startTime,
|
|
endTime: endTime ?? this.endTime,
|
|
name: name.present ? name.value : this.name,
|
|
description: description.present ? description.value : this.description,
|
|
color: color.present ? color.value : this.color,
|
|
);
|
|
Annotation copyWithCompanion(AnnotationsCompanion data) {
|
|
return Annotation(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
|
|
startTime: data.startTime.present ? data.startTime.value : this.startTime,
|
|
endTime: data.endTime.present ? data.endTime.value : this.endTime,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
description: data.description.present
|
|
? data.description.value
|
|
: this.description,
|
|
color: data.color.present ? data.color.value : this.color,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Annotation(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('startTime: $startTime, ')
|
|
..write('endTime: $endTime, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('color: $color')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, sessionId, startTime, endTime, name, description, color);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Annotation &&
|
|
other.id == this.id &&
|
|
other.sessionId == this.sessionId &&
|
|
other.startTime == this.startTime &&
|
|
other.endTime == this.endTime &&
|
|
other.name == this.name &&
|
|
other.description == this.description &&
|
|
other.color == this.color);
|
|
}
|
|
|
|
class AnnotationsCompanion extends UpdateCompanion<Annotation> {
|
|
final Value<String> id;
|
|
final Value<String> sessionId;
|
|
final Value<double> startTime;
|
|
final Value<double> endTime;
|
|
final Value<String?> name;
|
|
final Value<String?> description;
|
|
final Value<String?> color;
|
|
final Value<int> rowid;
|
|
const AnnotationsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.sessionId = const Value.absent(),
|
|
this.startTime = const Value.absent(),
|
|
this.endTime = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.color = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
AnnotationsCompanion.insert({
|
|
required String id,
|
|
required String sessionId,
|
|
required double startTime,
|
|
required double endTime,
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.color = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
sessionId = Value(sessionId),
|
|
startTime = Value(startTime),
|
|
endTime = Value(endTime);
|
|
static Insertable<Annotation> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? sessionId,
|
|
Expression<double>? startTime,
|
|
Expression<double>? endTime,
|
|
Expression<String>? name,
|
|
Expression<String>? description,
|
|
Expression<String>? color,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (sessionId != null) 'session_id': sessionId,
|
|
if (startTime != null) 'start_time': startTime,
|
|
if (endTime != null) 'end_time': endTime,
|
|
if (name != null) 'name': name,
|
|
if (description != null) 'description': description,
|
|
if (color != null) 'color': color,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
AnnotationsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? sessionId,
|
|
Value<double>? startTime,
|
|
Value<double>? endTime,
|
|
Value<String?>? name,
|
|
Value<String?>? description,
|
|
Value<String?>? color,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return AnnotationsCompanion(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
startTime: startTime ?? this.startTime,
|
|
endTime: endTime ?? this.endTime,
|
|
name: name ?? this.name,
|
|
description: description ?? this.description,
|
|
color: color ?? this.color,
|
|
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 (sessionId.present) {
|
|
map['session_id'] = Variable<String>(sessionId.value);
|
|
}
|
|
if (startTime.present) {
|
|
map['start_time'] = Variable<double>(startTime.value);
|
|
}
|
|
if (endTime.present) {
|
|
map['end_time'] = Variable<double>(endTime.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (color.present) {
|
|
map['color'] = Variable<String>(color.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AnnotationsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('startTime: $startTime, ')
|
|
..write('endTime: $endTime, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('color: $color, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ChatSessionsTable extends ChatSessions
|
|
with TableInfo<$ChatSessionsTable, ChatSession> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ChatSessionsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
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 _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, title, createdAt, updatedAt];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'chat_sessions';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ChatSession> 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),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ChatSession map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ChatSession(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
),
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ChatSessionsTable createAlias(String alias) {
|
|
return $ChatSessionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ChatSession extends DataClass implements Insertable<ChatSession> {
|
|
final String id;
|
|
final String? title;
|
|
final String createdAt;
|
|
final String updatedAt;
|
|
const ChatSession({
|
|
required this.id,
|
|
this.title,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
if (!nullToAbsent || title != null) {
|
|
map['title'] = Variable<String>(title);
|
|
}
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
map['updated_at'] = Variable<String>(updatedAt);
|
|
return map;
|
|
}
|
|
|
|
ChatSessionsCompanion toCompanion(bool nullToAbsent) {
|
|
return ChatSessionsCompanion(
|
|
id: Value(id),
|
|
title: title == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(title),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
);
|
|
}
|
|
|
|
factory ChatSession.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ChatSession(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
title: serializer.fromJson<String?>(json['title']),
|
|
createdAt: serializer.fromJson<String>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<String>(json['updatedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'title': serializer.toJson<String?>(title),
|
|
'createdAt': serializer.toJson<String>(createdAt),
|
|
'updatedAt': serializer.toJson<String>(updatedAt),
|
|
};
|
|
}
|
|
|
|
ChatSession copyWith({
|
|
String? id,
|
|
Value<String?> title = const Value.absent(),
|
|
String? createdAt,
|
|
String? updatedAt,
|
|
}) => ChatSession(
|
|
id: id ?? this.id,
|
|
title: title.present ? title.value : this.title,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
);
|
|
ChatSession copyWithCompanion(ChatSessionsCompanion data) {
|
|
return ChatSession(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ChatSession(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, title, createdAt, updatedAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ChatSession &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt);
|
|
}
|
|
|
|
class ChatSessionsCompanion extends UpdateCompanion<ChatSession> {
|
|
final Value<String> id;
|
|
final Value<String?> title;
|
|
final Value<String> createdAt;
|
|
final Value<String> updatedAt;
|
|
final Value<int> rowid;
|
|
const ChatSessionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ChatSessionsCompanion.insert({
|
|
required String id,
|
|
this.title = const Value.absent(),
|
|
required String createdAt,
|
|
required String updatedAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt);
|
|
static Insertable<ChatSession> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? createdAt,
|
|
Expression<String>? updatedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ChatSessionsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String?>? title,
|
|
Value<String>? createdAt,
|
|
Value<String>? updatedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ChatSessionsCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
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 (createdAt.present) {
|
|
map['created_at'] = Variable<String>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<String>(updatedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ChatSessionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ChatMessagesTable extends ChatMessages
|
|
with TableInfo<$ChatMessagesTable, ChatMessage> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ChatMessagesTable(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 _sessionIdMeta = const VerificationMeta(
|
|
'sessionId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> sessionId = GeneratedColumn<String>(
|
|
'session_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES chat_sessions (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _roleMeta = const VerificationMeta('role');
|
|
@override
|
|
late final GeneratedColumn<String> role = GeneratedColumn<String>(
|
|
'role',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _contentMeta = const VerificationMeta(
|
|
'content',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> content = GeneratedColumn<String>(
|
|
'content',
|
|
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,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
sessionId,
|
|
role,
|
|
content,
|
|
createdAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'chat_messages';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ChatMessage> 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('session_id')) {
|
|
context.handle(
|
|
_sessionIdMeta,
|
|
sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_sessionIdMeta);
|
|
}
|
|
if (data.containsKey('role')) {
|
|
context.handle(
|
|
_roleMeta,
|
|
role.isAcceptableOrUnknown(data['role']!, _roleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_roleMeta);
|
|
}
|
|
if (data.containsKey('content')) {
|
|
context.handle(
|
|
_contentMeta,
|
|
content.isAcceptableOrUnknown(data['content']!, _contentMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_contentMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ChatMessage map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ChatMessage(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
sessionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}session_id'],
|
|
)!,
|
|
role: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}role'],
|
|
)!,
|
|
content: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}content'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ChatMessagesTable createAlias(String alias) {
|
|
return $ChatMessagesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ChatMessage extends DataClass implements Insertable<ChatMessage> {
|
|
final String id;
|
|
final String sessionId;
|
|
final String role;
|
|
final String content;
|
|
final String createdAt;
|
|
const ChatMessage({
|
|
required this.id,
|
|
required this.sessionId,
|
|
required this.role,
|
|
required this.content,
|
|
required this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['session_id'] = Variable<String>(sessionId);
|
|
map['role'] = Variable<String>(role);
|
|
map['content'] = Variable<String>(content);
|
|
map['created_at'] = Variable<String>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
ChatMessagesCompanion toCompanion(bool nullToAbsent) {
|
|
return ChatMessagesCompanion(
|
|
id: Value(id),
|
|
sessionId: Value(sessionId),
|
|
role: Value(role),
|
|
content: Value(content),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory ChatMessage.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ChatMessage(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
sessionId: serializer.fromJson<String>(json['sessionId']),
|
|
role: serializer.fromJson<String>(json['role']),
|
|
content: serializer.fromJson<String>(json['content']),
|
|
createdAt: serializer.fromJson<String>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'sessionId': serializer.toJson<String>(sessionId),
|
|
'role': serializer.toJson<String>(role),
|
|
'content': serializer.toJson<String>(content),
|
|
'createdAt': serializer.toJson<String>(createdAt),
|
|
};
|
|
}
|
|
|
|
ChatMessage copyWith({
|
|
String? id,
|
|
String? sessionId,
|
|
String? role,
|
|
String? content,
|
|
String? createdAt,
|
|
}) => ChatMessage(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
role: role ?? this.role,
|
|
content: content ?? this.content,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
ChatMessage copyWithCompanion(ChatMessagesCompanion data) {
|
|
return ChatMessage(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId,
|
|
role: data.role.present ? data.role.value : this.role,
|
|
content: data.content.present ? data.content.value : this.content,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ChatMessage(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('role: $role, ')
|
|
..write('content: $content, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, sessionId, role, content, createdAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ChatMessage &&
|
|
other.id == this.id &&
|
|
other.sessionId == this.sessionId &&
|
|
other.role == this.role &&
|
|
other.content == this.content &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class ChatMessagesCompanion extends UpdateCompanion<ChatMessage> {
|
|
final Value<String> id;
|
|
final Value<String> sessionId;
|
|
final Value<String> role;
|
|
final Value<String> content;
|
|
final Value<String> createdAt;
|
|
final Value<int> rowid;
|
|
const ChatMessagesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.sessionId = const Value.absent(),
|
|
this.role = const Value.absent(),
|
|
this.content = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ChatMessagesCompanion.insert({
|
|
required String id,
|
|
required String sessionId,
|
|
required String role,
|
|
required String content,
|
|
required String createdAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
sessionId = Value(sessionId),
|
|
role = Value(role),
|
|
content = Value(content),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<ChatMessage> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? sessionId,
|
|
Expression<String>? role,
|
|
Expression<String>? content,
|
|
Expression<String>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (sessionId != null) 'session_id': sessionId,
|
|
if (role != null) 'role': role,
|
|
if (content != null) 'content': content,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ChatMessagesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? sessionId,
|
|
Value<String>? role,
|
|
Value<String>? content,
|
|
Value<String>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ChatMessagesCompanion(
|
|
id: id ?? this.id,
|
|
sessionId: sessionId ?? this.sessionId,
|
|
role: role ?? this.role,
|
|
content: content ?? this.content,
|
|
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 (sessionId.present) {
|
|
map['session_id'] = Variable<String>(sessionId.value);
|
|
}
|
|
if (role.present) {
|
|
map['role'] = Variable<String>(role.value);
|
|
}
|
|
if (content.present) {
|
|
map['content'] = Variable<String>(content.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('ChatMessagesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('sessionId: $sessionId, ')
|
|
..write('role: $role, ')
|
|
..write('content: $content, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $ExercisesTable exercises = $ExercisesTable(this);
|
|
late final $TrainingPlansTable trainingPlans = $TrainingPlansTable(this);
|
|
late final $ProgramsTable programs = $ProgramsTable(this);
|
|
late final $ProgramWeeksTable programWeeks = $ProgramWeeksTable(this);
|
|
late final $ProgramWorkoutsTable programWorkouts = $ProgramWorkoutsTable(
|
|
this,
|
|
);
|
|
late final $AnalysisSessionsTable analysisSessions = $AnalysisSessionsTable(
|
|
this,
|
|
);
|
|
late final $AnnotationsTable annotations = $AnnotationsTable(this);
|
|
late final $ChatSessionsTable chatSessions = $ChatSessionsTable(this);
|
|
late final $ChatMessagesTable chatMessages = $ChatMessagesTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
exercises,
|
|
trainingPlans,
|
|
programs,
|
|
programWeeks,
|
|
programWorkouts,
|
|
analysisSessions,
|
|
annotations,
|
|
chatSessions,
|
|
chatMessages,
|
|
];
|
|
@override
|
|
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'programs',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('program_weeks', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'program_weeks',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('program_workouts', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'programs',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('program_workouts', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'analysis_sessions',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('annotations', kind: UpdateKind.delete)],
|
|
),
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'chat_sessions',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('chat_messages', kind: UpdateKind.delete)],
|
|
),
|
|
]);
|
|
}
|
|
|
|
typedef $$ExercisesTableCreateCompanionBuilder =
|
|
ExercisesCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> instructions,
|
|
Value<String?> enrichment,
|
|
Value<String?> tags,
|
|
Value<String?> videoUrl,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ExercisesTableUpdateCompanionBuilder =
|
|
ExercisesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String?> instructions,
|
|
Value<String?> enrichment,
|
|
Value<String?> tags,
|
|
Value<String?> videoUrl,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ExercisesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableFilterComposer({
|
|
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 instructions => $composableBuilder(
|
|
column: $table.instructions,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get enrichment => $composableBuilder(
|
|
column: $table.enrichment,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get tags => $composableBuilder(
|
|
column: $table.tags,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get videoUrl => $composableBuilder(
|
|
column: $table.videoUrl,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ExercisesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableOrderingComposer({
|
|
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 instructions => $composableBuilder(
|
|
column: $table.instructions,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get enrichment => $composableBuilder(
|
|
column: $table.enrichment,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get tags => $composableBuilder(
|
|
column: $table.tags,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get videoUrl => $composableBuilder(
|
|
column: $table.videoUrl,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ExercisesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ExercisesTable> {
|
|
$$ExercisesTableAnnotationComposer({
|
|
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 instructions => $composableBuilder(
|
|
column: $table.instructions,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get enrichment => $composableBuilder(
|
|
column: $table.enrichment,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get tags =>
|
|
$composableBuilder(column: $table.tags, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get videoUrl =>
|
|
$composableBuilder(column: $table.videoUrl, builder: (column) => column);
|
|
}
|
|
|
|
class $$ExercisesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ExercisesTable,
|
|
Exercise,
|
|
$$ExercisesTableFilterComposer,
|
|
$$ExercisesTableOrderingComposer,
|
|
$$ExercisesTableAnnotationComposer,
|
|
$$ExercisesTableCreateCompanionBuilder,
|
|
$$ExercisesTableUpdateCompanionBuilder,
|
|
(Exercise, BaseReferences<_$AppDatabase, $ExercisesTable, Exercise>),
|
|
Exercise,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ExercisesTableTableManager(_$AppDatabase db, $ExercisesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ExercisesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ExercisesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ExercisesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> instructions = const Value.absent(),
|
|
Value<String?> enrichment = const Value.absent(),
|
|
Value<String?> tags = const Value.absent(),
|
|
Value<String?> videoUrl = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExercisesCompanion(
|
|
id: id,
|
|
name: name,
|
|
instructions: instructions,
|
|
enrichment: enrichment,
|
|
tags: tags,
|
|
videoUrl: videoUrl,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> instructions = const Value.absent(),
|
|
Value<String?> enrichment = const Value.absent(),
|
|
Value<String?> tags = const Value.absent(),
|
|
Value<String?> videoUrl = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ExercisesCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
instructions: instructions,
|
|
enrichment: enrichment,
|
|
tags: tags,
|
|
videoUrl: videoUrl,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ExercisesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ExercisesTable,
|
|
Exercise,
|
|
$$ExercisesTableFilterComposer,
|
|
$$ExercisesTableOrderingComposer,
|
|
$$ExercisesTableAnnotationComposer,
|
|
$$ExercisesTableCreateCompanionBuilder,
|
|
$$ExercisesTableUpdateCompanionBuilder,
|
|
(Exercise, BaseReferences<_$AppDatabase, $ExercisesTable, Exercise>),
|
|
Exercise,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$TrainingPlansTableCreateCompanionBuilder =
|
|
TrainingPlansCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> sections,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$TrainingPlansTableUpdateCompanionBuilder =
|
|
TrainingPlansCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String?> sections,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$TrainingPlansTableFilterComposer
|
|
extends Composer<_$AppDatabase, $TrainingPlansTable> {
|
|
$$TrainingPlansTableFilterComposer({
|
|
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 sections => $composableBuilder(
|
|
column: $table.sections,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$TrainingPlansTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $TrainingPlansTable> {
|
|
$$TrainingPlansTableOrderingComposer({
|
|
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 sections => $composableBuilder(
|
|
column: $table.sections,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$TrainingPlansTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $TrainingPlansTable> {
|
|
$$TrainingPlansTableAnnotationComposer({
|
|
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 sections =>
|
|
$composableBuilder(column: $table.sections, builder: (column) => column);
|
|
}
|
|
|
|
class $$TrainingPlansTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$TrainingPlansTable,
|
|
TrainingPlan,
|
|
$$TrainingPlansTableFilterComposer,
|
|
$$TrainingPlansTableOrderingComposer,
|
|
$$TrainingPlansTableAnnotationComposer,
|
|
$$TrainingPlansTableCreateCompanionBuilder,
|
|
$$TrainingPlansTableUpdateCompanionBuilder,
|
|
(
|
|
TrainingPlan,
|
|
BaseReferences<_$AppDatabase, $TrainingPlansTable, TrainingPlan>,
|
|
),
|
|
TrainingPlan,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$TrainingPlansTableTableManager(_$AppDatabase db, $TrainingPlansTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$TrainingPlansTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$TrainingPlansTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$TrainingPlansTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> sections = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TrainingPlansCompanion(
|
|
id: id,
|
|
name: name,
|
|
sections: sections,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> sections = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TrainingPlansCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
sections: sections,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$TrainingPlansTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$TrainingPlansTable,
|
|
TrainingPlan,
|
|
$$TrainingPlansTableFilterComposer,
|
|
$$TrainingPlansTableOrderingComposer,
|
|
$$TrainingPlansTableAnnotationComposer,
|
|
$$TrainingPlansTableCreateCompanionBuilder,
|
|
$$TrainingPlansTableUpdateCompanionBuilder,
|
|
(
|
|
TrainingPlan,
|
|
BaseReferences<_$AppDatabase, $TrainingPlansTable, TrainingPlan>,
|
|
),
|
|
TrainingPlan,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$ProgramsTableCreateCompanionBuilder =
|
|
ProgramsCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required String createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProgramsTableUpdateCompanionBuilder =
|
|
ProgramsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProgramsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ProgramsTable, Program> {
|
|
$$ProgramsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$ProgramWeeksTable, List<ProgramWeek>>
|
|
_programWeeksRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.programWeeks,
|
|
aliasName: $_aliasNameGenerator(db.programs.id, db.programWeeks.programId),
|
|
);
|
|
|
|
$$ProgramWeeksTableProcessedTableManager get programWeeksRefs {
|
|
final manager = $$ProgramWeeksTableTableManager(
|
|
$_db,
|
|
$_db.programWeeks,
|
|
).filter((f) => f.programId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_programWeeksRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ProgramWorkoutsTable, List<ProgramWorkout>>
|
|
_programWorkoutsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.programWorkouts,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.programs.id,
|
|
db.programWorkouts.programId,
|
|
),
|
|
);
|
|
|
|
$$ProgramWorkoutsTableProcessedTableManager get programWorkoutsRefs {
|
|
final manager = $$ProgramWorkoutsTableTableManager(
|
|
$_db,
|
|
$_db.programWorkouts,
|
|
).filter((f) => f.programId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programWorkoutsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableFilterComposer({
|
|
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 createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> programWeeksRefs(
|
|
Expression<bool> Function($$ProgramWeeksTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramWeeksTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWeeks,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWeeksTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programWeeks,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> programWorkoutsRefs(
|
|
Expression<bool> Function($$ProgramWorkoutsTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramWorkoutsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWorkouts,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWorkoutsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programWorkouts,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableOrderingComposer({
|
|
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 createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ProgramsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProgramsTable> {
|
|
$$ProgramsTableAnnotationComposer({
|
|
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 createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
Expression<T> programWeeksRefs<T extends Object>(
|
|
Expression<T> Function($$ProgramWeeksTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramWeeksTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWeeks,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWeeksTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programWeeks,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> programWorkoutsRefs<T extends Object>(
|
|
Expression<T> Function($$ProgramWorkoutsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramWorkoutsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWorkouts,
|
|
getReferencedColumn: (t) => t.programId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWorkoutsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programWorkouts,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProgramsTable,
|
|
Program,
|
|
$$ProgramsTableFilterComposer,
|
|
$$ProgramsTableOrderingComposer,
|
|
$$ProgramsTableAnnotationComposer,
|
|
$$ProgramsTableCreateCompanionBuilder,
|
|
$$ProgramsTableUpdateCompanionBuilder,
|
|
(Program, $$ProgramsTableReferences),
|
|
Program,
|
|
PrefetchHooks Function({
|
|
bool programWeeksRefs,
|
|
bool programWorkoutsRefs,
|
|
})
|
|
> {
|
|
$$ProgramsTableTableManager(_$AppDatabase db, $ProgramsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProgramsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProgramsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProgramsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramsCompanion(
|
|
id: id,
|
|
name: name,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
required String createdAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProgramsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({programWeeksRefs = false, programWorkoutsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (programWeeksRefs) db.programWeeks,
|
|
if (programWorkoutsRefs) db.programWorkouts,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (programWeeksRefs)
|
|
await $_getPrefetchedData<
|
|
Program,
|
|
$ProgramsTable,
|
|
ProgramWeek
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProgramsTableReferences
|
|
._programWeeksRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProgramsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programWeeksRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.programId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (programWorkoutsRefs)
|
|
await $_getPrefetchedData<
|
|
Program,
|
|
$ProgramsTable,
|
|
ProgramWorkout
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProgramsTableReferences
|
|
._programWorkoutsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProgramsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programWorkoutsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.programId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProgramsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProgramsTable,
|
|
Program,
|
|
$$ProgramsTableFilterComposer,
|
|
$$ProgramsTableOrderingComposer,
|
|
$$ProgramsTableAnnotationComposer,
|
|
$$ProgramsTableCreateCompanionBuilder,
|
|
$$ProgramsTableUpdateCompanionBuilder,
|
|
(Program, $$ProgramsTableReferences),
|
|
Program,
|
|
PrefetchHooks Function({bool programWeeksRefs, bool programWorkoutsRefs})
|
|
>;
|
|
typedef $$ProgramWeeksTableCreateCompanionBuilder =
|
|
ProgramWeeksCompanion Function({
|
|
required String id,
|
|
required String programId,
|
|
required int position,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProgramWeeksTableUpdateCompanionBuilder =
|
|
ProgramWeeksCompanion Function({
|
|
Value<String> id,
|
|
Value<String> programId,
|
|
Value<int> position,
|
|
Value<String?> notes,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProgramWeeksTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ProgramWeeksTable, ProgramWeek> {
|
|
$$ProgramWeeksTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $ProgramsTable _programIdTable(_$AppDatabase db) =>
|
|
db.programs.createAlias(
|
|
$_aliasNameGenerator(db.programWeeks.programId, db.programs.id),
|
|
);
|
|
|
|
$$ProgramsTableProcessedTableManager get programId {
|
|
final $_column = $_itemColumn<String>('program_id')!;
|
|
|
|
final manager = $$ProgramsTableTableManager(
|
|
$_db,
|
|
$_db.programs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_programIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$ProgramWorkoutsTable, List<ProgramWorkout>>
|
|
_programWorkoutsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.programWorkouts,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.programWeeks.id,
|
|
db.programWorkouts.weekId,
|
|
),
|
|
);
|
|
|
|
$$ProgramWorkoutsTableProcessedTableManager get programWorkoutsRefs {
|
|
final manager = $$ProgramWorkoutsTableTableManager(
|
|
$_db,
|
|
$_db.programWorkouts,
|
|
).filter((f) => f.weekId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_programWorkoutsRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProgramWeeksTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProgramWeeksTable> {
|
|
$$ProgramWeeksTableFilterComposer({
|
|
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<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ProgramsTableFilterComposer get programId {
|
|
final $$ProgramsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<bool> programWorkoutsRefs(
|
|
Expression<bool> Function($$ProgramWorkoutsTableFilterComposer f) f,
|
|
) {
|
|
final $$ProgramWorkoutsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWorkouts,
|
|
getReferencedColumn: (t) => t.weekId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWorkoutsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programWorkouts,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramWeeksTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProgramWeeksTable> {
|
|
$$ProgramWeeksTableOrderingComposer({
|
|
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<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get notes => $composableBuilder(
|
|
column: $table.notes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ProgramsTableOrderingComposer get programId {
|
|
final $$ProgramsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramWeeksTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProgramWeeksTable> {
|
|
$$ProgramWeeksTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get position =>
|
|
$composableBuilder(column: $table.position, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get notes =>
|
|
$composableBuilder(column: $table.notes, builder: (column) => column);
|
|
|
|
$$ProgramsTableAnnotationComposer get programId {
|
|
final $$ProgramsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
Expression<T> programWorkoutsRefs<T extends Object>(
|
|
Expression<T> Function($$ProgramWorkoutsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ProgramWorkoutsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.programWorkouts,
|
|
getReferencedColumn: (t) => t.weekId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWorkoutsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programWorkouts,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProgramWeeksTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProgramWeeksTable,
|
|
ProgramWeek,
|
|
$$ProgramWeeksTableFilterComposer,
|
|
$$ProgramWeeksTableOrderingComposer,
|
|
$$ProgramWeeksTableAnnotationComposer,
|
|
$$ProgramWeeksTableCreateCompanionBuilder,
|
|
$$ProgramWeeksTableUpdateCompanionBuilder,
|
|
(ProgramWeek, $$ProgramWeeksTableReferences),
|
|
ProgramWeek,
|
|
PrefetchHooks Function({bool programId, bool programWorkoutsRefs})
|
|
> {
|
|
$$ProgramWeeksTableTableManager(_$AppDatabase db, $ProgramWeeksTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProgramWeeksTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProgramWeeksTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProgramWeeksTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> programId = const Value.absent(),
|
|
Value<int> position = const Value.absent(),
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramWeeksCompanion(
|
|
id: id,
|
|
programId: programId,
|
|
position: position,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String programId,
|
|
required int position,
|
|
Value<String?> notes = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramWeeksCompanion.insert(
|
|
id: id,
|
|
programId: programId,
|
|
position: position,
|
|
notes: notes,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProgramWeeksTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({programId = false, programWorkoutsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (programWorkoutsRefs) db.programWorkouts,
|
|
],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (programId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.programId,
|
|
referencedTable:
|
|
$$ProgramWeeksTableReferences
|
|
._programIdTable(db),
|
|
referencedColumn:
|
|
$$ProgramWeeksTableReferences
|
|
._programIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (programWorkoutsRefs)
|
|
await $_getPrefetchedData<
|
|
ProgramWeek,
|
|
$ProgramWeeksTable,
|
|
ProgramWorkout
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProgramWeeksTableReferences
|
|
._programWorkoutsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProgramWeeksTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).programWorkoutsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.weekId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProgramWeeksTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProgramWeeksTable,
|
|
ProgramWeek,
|
|
$$ProgramWeeksTableFilterComposer,
|
|
$$ProgramWeeksTableOrderingComposer,
|
|
$$ProgramWeeksTableAnnotationComposer,
|
|
$$ProgramWeeksTableCreateCompanionBuilder,
|
|
$$ProgramWeeksTableUpdateCompanionBuilder,
|
|
(ProgramWeek, $$ProgramWeeksTableReferences),
|
|
ProgramWeek,
|
|
PrefetchHooks Function({bool programId, bool programWorkoutsRefs})
|
|
>;
|
|
typedef $$ProgramWorkoutsTableCreateCompanionBuilder =
|
|
ProgramWorkoutsCompanion Function({
|
|
required String id,
|
|
required String weekId,
|
|
required String programId,
|
|
required String day,
|
|
required String type,
|
|
Value<String?> refId,
|
|
Value<String?> name,
|
|
Value<String?> description,
|
|
Value<bool> completed,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProgramWorkoutsTableUpdateCompanionBuilder =
|
|
ProgramWorkoutsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> weekId,
|
|
Value<String> programId,
|
|
Value<String> day,
|
|
Value<String> type,
|
|
Value<String?> refId,
|
|
Value<String?> name,
|
|
Value<String?> description,
|
|
Value<bool> completed,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProgramWorkoutsTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $ProgramWorkoutsTable, ProgramWorkout> {
|
|
$$ProgramWorkoutsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $ProgramWeeksTable _weekIdTable(_$AppDatabase db) =>
|
|
db.programWeeks.createAlias(
|
|
$_aliasNameGenerator(db.programWorkouts.weekId, db.programWeeks.id),
|
|
);
|
|
|
|
$$ProgramWeeksTableProcessedTableManager get weekId {
|
|
final $_column = $_itemColumn<String>('week_id')!;
|
|
|
|
final manager = $$ProgramWeeksTableTableManager(
|
|
$_db,
|
|
$_db.programWeeks,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_weekIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $ProgramsTable _programIdTable(_$AppDatabase db) =>
|
|
db.programs.createAlias(
|
|
$_aliasNameGenerator(db.programWorkouts.programId, db.programs.id),
|
|
);
|
|
|
|
$$ProgramsTableProcessedTableManager get programId {
|
|
final $_column = $_itemColumn<String>('program_id')!;
|
|
|
|
final manager = $$ProgramsTableTableManager(
|
|
$_db,
|
|
$_db.programs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_programIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProgramWorkoutsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProgramWorkoutsTable> {
|
|
$$ProgramWorkoutsTableFilterComposer({
|
|
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 day => $composableBuilder(
|
|
column: $table.day,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get refId => $composableBuilder(
|
|
column: $table.refId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get completed => $composableBuilder(
|
|
column: $table.completed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ProgramWeeksTableFilterComposer get weekId {
|
|
final $$ProgramWeeksTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.weekId,
|
|
referencedTable: $db.programWeeks,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWeeksTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programWeeks,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableFilterComposer get programId {
|
|
final $$ProgramsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramWorkoutsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProgramWorkoutsTable> {
|
|
$$ProgramWorkoutsTableOrderingComposer({
|
|
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 day => $composableBuilder(
|
|
column: $table.day,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get refId => $composableBuilder(
|
|
column: $table.refId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get completed => $composableBuilder(
|
|
column: $table.completed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ProgramWeeksTableOrderingComposer get weekId {
|
|
final $$ProgramWeeksTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.weekId,
|
|
referencedTable: $db.programWeeks,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWeeksTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.programWeeks,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableOrderingComposer get programId {
|
|
final $$ProgramsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramWorkoutsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProgramWorkoutsTable> {
|
|
$$ProgramWorkoutsTableAnnotationComposer({
|
|
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 day =>
|
|
$composableBuilder(column: $table.day, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get type =>
|
|
$composableBuilder(column: $table.type, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get refId =>
|
|
$composableBuilder(column: $table.refId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get completed =>
|
|
$composableBuilder(column: $table.completed, builder: (column) => column);
|
|
|
|
$$ProgramWeeksTableAnnotationComposer get weekId {
|
|
final $$ProgramWeeksTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.weekId,
|
|
referencedTable: $db.programWeeks,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramWeeksTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programWeeks,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProgramsTableAnnotationComposer get programId {
|
|
final $$ProgramsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.programId,
|
|
referencedTable: $db.programs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProgramsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.programs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ProgramWorkoutsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProgramWorkoutsTable,
|
|
ProgramWorkout,
|
|
$$ProgramWorkoutsTableFilterComposer,
|
|
$$ProgramWorkoutsTableOrderingComposer,
|
|
$$ProgramWorkoutsTableAnnotationComposer,
|
|
$$ProgramWorkoutsTableCreateCompanionBuilder,
|
|
$$ProgramWorkoutsTableUpdateCompanionBuilder,
|
|
(ProgramWorkout, $$ProgramWorkoutsTableReferences),
|
|
ProgramWorkout,
|
|
PrefetchHooks Function({bool weekId, bool programId})
|
|
> {
|
|
$$ProgramWorkoutsTableTableManager(
|
|
_$AppDatabase db,
|
|
$ProgramWorkoutsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProgramWorkoutsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProgramWorkoutsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProgramWorkoutsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> weekId = const Value.absent(),
|
|
Value<String> programId = const Value.absent(),
|
|
Value<String> day = const Value.absent(),
|
|
Value<String> type = const Value.absent(),
|
|
Value<String?> refId = const Value.absent(),
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<bool> completed = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramWorkoutsCompanion(
|
|
id: id,
|
|
weekId: weekId,
|
|
programId: programId,
|
|
day: day,
|
|
type: type,
|
|
refId: refId,
|
|
name: name,
|
|
description: description,
|
|
completed: completed,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String weekId,
|
|
required String programId,
|
|
required String day,
|
|
required String type,
|
|
Value<String?> refId = const Value.absent(),
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<bool> completed = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProgramWorkoutsCompanion.insert(
|
|
id: id,
|
|
weekId: weekId,
|
|
programId: programId,
|
|
day: day,
|
|
type: type,
|
|
refId: refId,
|
|
name: name,
|
|
description: description,
|
|
completed: completed,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProgramWorkoutsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({weekId = false, programId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (weekId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.weekId,
|
|
referencedTable:
|
|
$$ProgramWorkoutsTableReferences
|
|
._weekIdTable(db),
|
|
referencedColumn:
|
|
$$ProgramWorkoutsTableReferences
|
|
._weekIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (programId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.programId,
|
|
referencedTable:
|
|
$$ProgramWorkoutsTableReferences
|
|
._programIdTable(db),
|
|
referencedColumn:
|
|
$$ProgramWorkoutsTableReferences
|
|
._programIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProgramWorkoutsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProgramWorkoutsTable,
|
|
ProgramWorkout,
|
|
$$ProgramWorkoutsTableFilterComposer,
|
|
$$ProgramWorkoutsTableOrderingComposer,
|
|
$$ProgramWorkoutsTableAnnotationComposer,
|
|
$$ProgramWorkoutsTableCreateCompanionBuilder,
|
|
$$ProgramWorkoutsTableUpdateCompanionBuilder,
|
|
(ProgramWorkout, $$ProgramWorkoutsTableReferences),
|
|
ProgramWorkout,
|
|
PrefetchHooks Function({bool weekId, bool programId})
|
|
>;
|
|
typedef $$AnalysisSessionsTableCreateCompanionBuilder =
|
|
AnalysisSessionsCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required String date,
|
|
Value<String?> videoPath,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$AnalysisSessionsTableUpdateCompanionBuilder =
|
|
AnalysisSessionsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String> date,
|
|
Value<String?> videoPath,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$AnalysisSessionsTableReferences
|
|
extends
|
|
BaseReferences<_$AppDatabase, $AnalysisSessionsTable, AnalysisSession> {
|
|
$$AnalysisSessionsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static MultiTypedResultKey<$AnnotationsTable, List<Annotation>>
|
|
_annotationsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.annotations,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.analysisSessions.id,
|
|
db.annotations.sessionId,
|
|
),
|
|
);
|
|
|
|
$$AnnotationsTableProcessedTableManager get annotationsRefs {
|
|
final manager = $$AnnotationsTableTableManager(
|
|
$_db,
|
|
$_db.annotations,
|
|
).filter((f) => f.sessionId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_annotationsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$AnalysisSessionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $AnalysisSessionsTable> {
|
|
$$AnalysisSessionsTableFilterComposer({
|
|
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 date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get videoPath => $composableBuilder(
|
|
column: $table.videoPath,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> annotationsRefs(
|
|
Expression<bool> Function($$AnnotationsTableFilterComposer f) f,
|
|
) {
|
|
final $$AnnotationsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.annotations,
|
|
getReferencedColumn: (t) => t.sessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$AnnotationsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.annotations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$AnalysisSessionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $AnalysisSessionsTable> {
|
|
$$AnalysisSessionsTableOrderingComposer({
|
|
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 date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get videoPath => $composableBuilder(
|
|
column: $table.videoPath,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$AnalysisSessionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $AnalysisSessionsTable> {
|
|
$$AnalysisSessionsTableAnnotationComposer({
|
|
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 date =>
|
|
$composableBuilder(column: $table.date, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get videoPath =>
|
|
$composableBuilder(column: $table.videoPath, builder: (column) => column);
|
|
|
|
Expression<T> annotationsRefs<T extends Object>(
|
|
Expression<T> Function($$AnnotationsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$AnnotationsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.annotations,
|
|
getReferencedColumn: (t) => t.sessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$AnnotationsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.annotations,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$AnalysisSessionsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$AnalysisSessionsTable,
|
|
AnalysisSession,
|
|
$$AnalysisSessionsTableFilterComposer,
|
|
$$AnalysisSessionsTableOrderingComposer,
|
|
$$AnalysisSessionsTableAnnotationComposer,
|
|
$$AnalysisSessionsTableCreateCompanionBuilder,
|
|
$$AnalysisSessionsTableUpdateCompanionBuilder,
|
|
(AnalysisSession, $$AnalysisSessionsTableReferences),
|
|
AnalysisSession,
|
|
PrefetchHooks Function({bool annotationsRefs})
|
|
> {
|
|
$$AnalysisSessionsTableTableManager(
|
|
_$AppDatabase db,
|
|
$AnalysisSessionsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$AnalysisSessionsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$AnalysisSessionsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$AnalysisSessionsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> date = const Value.absent(),
|
|
Value<String?> videoPath = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AnalysisSessionsCompanion(
|
|
id: id,
|
|
name: name,
|
|
date: date,
|
|
videoPath: videoPath,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
required String date,
|
|
Value<String?> videoPath = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AnalysisSessionsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
date: date,
|
|
videoPath: videoPath,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$AnalysisSessionsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({annotationsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [if (annotationsRefs) db.annotations],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (annotationsRefs)
|
|
await $_getPrefetchedData<
|
|
AnalysisSession,
|
|
$AnalysisSessionsTable,
|
|
Annotation
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$AnalysisSessionsTableReferences
|
|
._annotationsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$AnalysisSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).annotationsRefs,
|
|
referencedItemsForCurrentItem: (item, referencedItems) =>
|
|
referencedItems.where((e) => e.sessionId == item.id),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$AnalysisSessionsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$AnalysisSessionsTable,
|
|
AnalysisSession,
|
|
$$AnalysisSessionsTableFilterComposer,
|
|
$$AnalysisSessionsTableOrderingComposer,
|
|
$$AnalysisSessionsTableAnnotationComposer,
|
|
$$AnalysisSessionsTableCreateCompanionBuilder,
|
|
$$AnalysisSessionsTableUpdateCompanionBuilder,
|
|
(AnalysisSession, $$AnalysisSessionsTableReferences),
|
|
AnalysisSession,
|
|
PrefetchHooks Function({bool annotationsRefs})
|
|
>;
|
|
typedef $$AnnotationsTableCreateCompanionBuilder =
|
|
AnnotationsCompanion Function({
|
|
required String id,
|
|
required String sessionId,
|
|
required double startTime,
|
|
required double endTime,
|
|
Value<String?> name,
|
|
Value<String?> description,
|
|
Value<String?> color,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$AnnotationsTableUpdateCompanionBuilder =
|
|
AnnotationsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> sessionId,
|
|
Value<double> startTime,
|
|
Value<double> endTime,
|
|
Value<String?> name,
|
|
Value<String?> description,
|
|
Value<String?> color,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$AnnotationsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $AnnotationsTable, Annotation> {
|
|
$$AnnotationsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $AnalysisSessionsTable _sessionIdTable(_$AppDatabase db) =>
|
|
db.analysisSessions.createAlias(
|
|
$_aliasNameGenerator(db.annotations.sessionId, db.analysisSessions.id),
|
|
);
|
|
|
|
$$AnalysisSessionsTableProcessedTableManager get sessionId {
|
|
final $_column = $_itemColumn<String>('session_id')!;
|
|
|
|
final manager = $$AnalysisSessionsTableTableManager(
|
|
$_db,
|
|
$_db.analysisSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_sessionIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$AnnotationsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $AnnotationsTable> {
|
|
$$AnnotationsTableFilterComposer({
|
|
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<double> get startTime => $composableBuilder(
|
|
column: $table.startTime,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get endTime => $composableBuilder(
|
|
column: $table.endTime,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get color => $composableBuilder(
|
|
column: $table.color,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$AnalysisSessionsTableFilterComposer get sessionId {
|
|
final $$AnalysisSessionsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.analysisSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$AnalysisSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.analysisSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$AnnotationsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $AnnotationsTable> {
|
|
$$AnnotationsTableOrderingComposer({
|
|
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<double> get startTime => $composableBuilder(
|
|
column: $table.startTime,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get endTime => $composableBuilder(
|
|
column: $table.endTime,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get color => $composableBuilder(
|
|
column: $table.color,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$AnalysisSessionsTableOrderingComposer get sessionId {
|
|
final $$AnalysisSessionsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.analysisSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$AnalysisSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.analysisSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$AnnotationsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $AnnotationsTable> {
|
|
$$AnnotationsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get startTime =>
|
|
$composableBuilder(column: $table.startTime, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get endTime =>
|
|
$composableBuilder(column: $table.endTime, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get color =>
|
|
$composableBuilder(column: $table.color, builder: (column) => column);
|
|
|
|
$$AnalysisSessionsTableAnnotationComposer get sessionId {
|
|
final $$AnalysisSessionsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.analysisSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$AnalysisSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.analysisSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$AnnotationsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$AnnotationsTable,
|
|
Annotation,
|
|
$$AnnotationsTableFilterComposer,
|
|
$$AnnotationsTableOrderingComposer,
|
|
$$AnnotationsTableAnnotationComposer,
|
|
$$AnnotationsTableCreateCompanionBuilder,
|
|
$$AnnotationsTableUpdateCompanionBuilder,
|
|
(Annotation, $$AnnotationsTableReferences),
|
|
Annotation,
|
|
PrefetchHooks Function({bool sessionId})
|
|
> {
|
|
$$AnnotationsTableTableManager(_$AppDatabase db, $AnnotationsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$AnnotationsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$AnnotationsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$AnnotationsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> sessionId = const Value.absent(),
|
|
Value<double> startTime = const Value.absent(),
|
|
Value<double> endTime = const Value.absent(),
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> color = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AnnotationsCompanion(
|
|
id: id,
|
|
sessionId: sessionId,
|
|
startTime: startTime,
|
|
endTime: endTime,
|
|
name: name,
|
|
description: description,
|
|
color: color,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String sessionId,
|
|
required double startTime,
|
|
required double endTime,
|
|
Value<String?> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<String?> color = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => AnnotationsCompanion.insert(
|
|
id: id,
|
|
sessionId: sessionId,
|
|
startTime: startTime,
|
|
endTime: endTime,
|
|
name: name,
|
|
description: description,
|
|
color: color,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$AnnotationsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({sessionId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (sessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.sessionId,
|
|
referencedTable: $$AnnotationsTableReferences
|
|
._sessionIdTable(db),
|
|
referencedColumn: $$AnnotationsTableReferences
|
|
._sessionIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$AnnotationsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$AnnotationsTable,
|
|
Annotation,
|
|
$$AnnotationsTableFilterComposer,
|
|
$$AnnotationsTableOrderingComposer,
|
|
$$AnnotationsTableAnnotationComposer,
|
|
$$AnnotationsTableCreateCompanionBuilder,
|
|
$$AnnotationsTableUpdateCompanionBuilder,
|
|
(Annotation, $$AnnotationsTableReferences),
|
|
Annotation,
|
|
PrefetchHooks Function({bool sessionId})
|
|
>;
|
|
typedef $$ChatSessionsTableCreateCompanionBuilder =
|
|
ChatSessionsCompanion Function({
|
|
required String id,
|
|
Value<String?> title,
|
|
required String createdAt,
|
|
required String updatedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ChatSessionsTableUpdateCompanionBuilder =
|
|
ChatSessionsCompanion Function({
|
|
Value<String> id,
|
|
Value<String?> title,
|
|
Value<String> createdAt,
|
|
Value<String> updatedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ChatSessionsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ChatSessionsTable, ChatSession> {
|
|
$$ChatSessionsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$ChatMessagesTable, List<ChatMessage>>
|
|
_chatMessagesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.chatMessages,
|
|
aliasName: $_aliasNameGenerator(
|
|
db.chatSessions.id,
|
|
db.chatMessages.sessionId,
|
|
),
|
|
);
|
|
|
|
$$ChatMessagesTableProcessedTableManager get chatMessagesRefs {
|
|
final manager = $$ChatMessagesTableTableManager(
|
|
$_db,
|
|
$_db.chatMessages,
|
|
).filter((f) => f.sessionId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_chatMessagesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ChatSessionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ChatSessionsTable> {
|
|
$$ChatSessionsTableFilterComposer({
|
|
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 createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> chatMessagesRefs(
|
|
Expression<bool> Function($$ChatMessagesTableFilterComposer f) f,
|
|
) {
|
|
final $$ChatMessagesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.chatMessages,
|
|
getReferencedColumn: (t) => t.sessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ChatMessagesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.chatMessages,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ChatSessionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ChatSessionsTable> {
|
|
$$ChatSessionsTableOrderingComposer({
|
|
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 createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ChatSessionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ChatSessionsTable> {
|
|
$$ChatSessionsTableAnnotationComposer({
|
|
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 createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
Expression<T> chatMessagesRefs<T extends Object>(
|
|
Expression<T> Function($$ChatMessagesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$ChatMessagesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.chatMessages,
|
|
getReferencedColumn: (t) => t.sessionId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ChatMessagesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.chatMessages,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ChatSessionsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ChatSessionsTable,
|
|
ChatSession,
|
|
$$ChatSessionsTableFilterComposer,
|
|
$$ChatSessionsTableOrderingComposer,
|
|
$$ChatSessionsTableAnnotationComposer,
|
|
$$ChatSessionsTableCreateCompanionBuilder,
|
|
$$ChatSessionsTableUpdateCompanionBuilder,
|
|
(ChatSession, $$ChatSessionsTableReferences),
|
|
ChatSession,
|
|
PrefetchHooks Function({bool chatMessagesRefs})
|
|
> {
|
|
$$ChatSessionsTableTableManager(_$AppDatabase db, $ChatSessionsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ChatSessionsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ChatSessionsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ChatSessionsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String?> title = const Value.absent(),
|
|
Value<String> createdAt = const Value.absent(),
|
|
Value<String> updatedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChatSessionsCompanion(
|
|
id: id,
|
|
title: title,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
Value<String?> title = const Value.absent(),
|
|
required String createdAt,
|
|
required String updatedAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChatSessionsCompanion.insert(
|
|
id: id,
|
|
title: title,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ChatSessionsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({chatMessagesRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [if (chatMessagesRefs) db.chatMessages],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (chatMessagesRefs)
|
|
await $_getPrefetchedData<
|
|
ChatSession,
|
|
$ChatSessionsTable,
|
|
ChatMessage
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ChatSessionsTableReferences
|
|
._chatMessagesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ChatSessionsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).chatMessagesRefs,
|
|
referencedItemsForCurrentItem: (item, referencedItems) =>
|
|
referencedItems.where((e) => e.sessionId == item.id),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ChatSessionsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ChatSessionsTable,
|
|
ChatSession,
|
|
$$ChatSessionsTableFilterComposer,
|
|
$$ChatSessionsTableOrderingComposer,
|
|
$$ChatSessionsTableAnnotationComposer,
|
|
$$ChatSessionsTableCreateCompanionBuilder,
|
|
$$ChatSessionsTableUpdateCompanionBuilder,
|
|
(ChatSession, $$ChatSessionsTableReferences),
|
|
ChatSession,
|
|
PrefetchHooks Function({bool chatMessagesRefs})
|
|
>;
|
|
typedef $$ChatMessagesTableCreateCompanionBuilder =
|
|
ChatMessagesCompanion Function({
|
|
required String id,
|
|
required String sessionId,
|
|
required String role,
|
|
required String content,
|
|
required String createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ChatMessagesTableUpdateCompanionBuilder =
|
|
ChatMessagesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> sessionId,
|
|
Value<String> role,
|
|
Value<String> content,
|
|
Value<String> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ChatMessagesTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ChatMessagesTable, ChatMessage> {
|
|
$$ChatMessagesTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $ChatSessionsTable _sessionIdTable(_$AppDatabase db) =>
|
|
db.chatSessions.createAlias(
|
|
$_aliasNameGenerator(db.chatMessages.sessionId, db.chatSessions.id),
|
|
);
|
|
|
|
$$ChatSessionsTableProcessedTableManager get sessionId {
|
|
final $_column = $_itemColumn<String>('session_id')!;
|
|
|
|
final manager = $$ChatSessionsTableTableManager(
|
|
$_db,
|
|
$_db.chatSessions,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_sessionIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ChatMessagesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ChatMessagesTable> {
|
|
$$ChatMessagesTableFilterComposer({
|
|
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 role => $composableBuilder(
|
|
column: $table.role,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get content => $composableBuilder(
|
|
column: $table.content,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$ChatSessionsTableFilterComposer get sessionId {
|
|
final $$ChatSessionsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.chatSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ChatSessionsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.chatSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ChatMessagesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ChatMessagesTable> {
|
|
$$ChatMessagesTableOrderingComposer({
|
|
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 role => $composableBuilder(
|
|
column: $table.role,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get content => $composableBuilder(
|
|
column: $table.content,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$ChatSessionsTableOrderingComposer get sessionId {
|
|
final $$ChatSessionsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.chatSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ChatSessionsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.chatSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ChatMessagesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ChatMessagesTable> {
|
|
$$ChatMessagesTableAnnotationComposer({
|
|
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 role =>
|
|
$composableBuilder(column: $table.role, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get content =>
|
|
$composableBuilder(column: $table.content, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
$$ChatSessionsTableAnnotationComposer get sessionId {
|
|
final $$ChatSessionsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.sessionId,
|
|
referencedTable: $db.chatSessions,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ChatSessionsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.chatSessions,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$ChatMessagesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ChatMessagesTable,
|
|
ChatMessage,
|
|
$$ChatMessagesTableFilterComposer,
|
|
$$ChatMessagesTableOrderingComposer,
|
|
$$ChatMessagesTableAnnotationComposer,
|
|
$$ChatMessagesTableCreateCompanionBuilder,
|
|
$$ChatMessagesTableUpdateCompanionBuilder,
|
|
(ChatMessage, $$ChatMessagesTableReferences),
|
|
ChatMessage,
|
|
PrefetchHooks Function({bool sessionId})
|
|
> {
|
|
$$ChatMessagesTableTableManager(_$AppDatabase db, $ChatMessagesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ChatMessagesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ChatMessagesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ChatMessagesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> sessionId = const Value.absent(),
|
|
Value<String> role = const Value.absent(),
|
|
Value<String> content = const Value.absent(),
|
|
Value<String> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChatMessagesCompanion(
|
|
id: id,
|
|
sessionId: sessionId,
|
|
role: role,
|
|
content: content,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String sessionId,
|
|
required String role,
|
|
required String content,
|
|
required String createdAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ChatMessagesCompanion.insert(
|
|
id: id,
|
|
sessionId: sessionId,
|
|
role: role,
|
|
content: content,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ChatMessagesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({sessionId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (sessionId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.sessionId,
|
|
referencedTable: $$ChatMessagesTableReferences
|
|
._sessionIdTable(db),
|
|
referencedColumn: $$ChatMessagesTableReferences
|
|
._sessionIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ChatMessagesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ChatMessagesTable,
|
|
ChatMessage,
|
|
$$ChatMessagesTableFilterComposer,
|
|
$$ChatMessagesTableOrderingComposer,
|
|
$$ChatMessagesTableAnnotationComposer,
|
|
$$ChatMessagesTableCreateCompanionBuilder,
|
|
$$ChatMessagesTableUpdateCompanionBuilder,
|
|
(ChatMessage, $$ChatMessagesTableReferences),
|
|
ChatMessage,
|
|
PrefetchHooks Function({bool sessionId})
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$ExercisesTableTableManager get exercises =>
|
|
$$ExercisesTableTableManager(_db, _db.exercises);
|
|
$$TrainingPlansTableTableManager get trainingPlans =>
|
|
$$TrainingPlansTableTableManager(_db, _db.trainingPlans);
|
|
$$ProgramsTableTableManager get programs =>
|
|
$$ProgramsTableTableManager(_db, _db.programs);
|
|
$$ProgramWeeksTableTableManager get programWeeks =>
|
|
$$ProgramWeeksTableTableManager(_db, _db.programWeeks);
|
|
$$ProgramWorkoutsTableTableManager get programWorkouts =>
|
|
$$ProgramWorkoutsTableTableManager(_db, _db.programWorkouts);
|
|
$$AnalysisSessionsTableTableManager get analysisSessions =>
|
|
$$AnalysisSessionsTableTableManager(_db, _db.analysisSessions);
|
|
$$AnnotationsTableTableManager get annotations =>
|
|
$$AnnotationsTableTableManager(_db, _db.annotations);
|
|
$$ChatSessionsTableTableManager get chatSessions =>
|
|
$$ChatSessionsTableTableManager(_db, _db.chatSessions);
|
|
$$ChatMessagesTableTableManager get chatMessages =>
|
|
$$ChatMessagesTableTableManager(_db, _db.chatMessages);
|
|
}
|