MotorSignal-App/lib/database/database.g.dart

1867 lines
59 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'database.dart';
// ignore_for_file: type=lint
class $RidesTable extends Rides with TableInfo<$RidesTable, Ride> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$RidesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
hasAutoIncrement: true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'PRIMARY KEY AUTOINCREMENT',
),
);
static const VerificationMeta _startTimeMeta = const VerificationMeta(
'startTime',
);
@override
late final GeneratedColumn<DateTime> startTime = GeneratedColumn<DateTime>(
'start_time',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: true,
);
static const VerificationMeta _endTimeMeta = const VerificationMeta(
'endTime',
);
@override
late final GeneratedColumn<DateTime> endTime = GeneratedColumn<DateTime>(
'end_time',
aliasedName,
true,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
);
static const VerificationMeta _distanceMilesMeta = const VerificationMeta(
'distanceMiles',
);
@override
late final GeneratedColumn<double> distanceMiles = GeneratedColumn<double>(
'distance_miles',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _topSpeedMphMeta = const VerificationMeta(
'topSpeedMph',
);
@override
late final GeneratedColumn<double> topSpeedMph = GeneratedColumn<double>(
'top_speed_mph',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _maxLeanLeftMeta = const VerificationMeta(
'maxLeanLeft',
);
@override
late final GeneratedColumn<double> maxLeanLeft = GeneratedColumn<double>(
'max_lean_left',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _maxLeanRightMeta = const VerificationMeta(
'maxLeanRight',
);
@override
late final GeneratedColumn<double> maxLeanRight = GeneratedColumn<double>(
'max_lean_right',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _maxAccelGMeta = const VerificationMeta(
'maxAccelG',
);
@override
late final GeneratedColumn<double> maxAccelG = GeneratedColumn<double>(
'max_accel_g',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _maxBrakingGMeta = const VerificationMeta(
'maxBrakingG',
);
@override
late final GeneratedColumn<double> maxBrakingG = GeneratedColumn<double>(
'max_braking_g',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: false,
defaultValue: const Constant(0.0),
);
static const VerificationMeta _best0to60MsMeta = const VerificationMeta(
'best0to60Ms',
);
@override
late final GeneratedColumn<double> best0to60Ms = GeneratedColumn<double>(
'best0to60_ms',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
);
static const VerificationMeta _best0to100MsMeta = const VerificationMeta(
'best0to100Ms',
);
@override
late final GeneratedColumn<double> best0to100Ms = GeneratedColumn<double>(
'best0to100_ms',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
startTime,
endTime,
distanceMiles,
topSpeedMph,
maxLeanLeft,
maxLeanRight,
maxAccelG,
maxBrakingG,
best0to60Ms,
best0to100Ms,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'rides';
@override
VerificationContext validateIntegrity(
Insertable<Ride> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
}
if (data.containsKey('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),
);
}
if (data.containsKey('distance_miles')) {
context.handle(
_distanceMilesMeta,
distanceMiles.isAcceptableOrUnknown(
data['distance_miles']!,
_distanceMilesMeta,
),
);
}
if (data.containsKey('top_speed_mph')) {
context.handle(
_topSpeedMphMeta,
topSpeedMph.isAcceptableOrUnknown(
data['top_speed_mph']!,
_topSpeedMphMeta,
),
);
}
if (data.containsKey('max_lean_left')) {
context.handle(
_maxLeanLeftMeta,
maxLeanLeft.isAcceptableOrUnknown(
data['max_lean_left']!,
_maxLeanLeftMeta,
),
);
}
if (data.containsKey('max_lean_right')) {
context.handle(
_maxLeanRightMeta,
maxLeanRight.isAcceptableOrUnknown(
data['max_lean_right']!,
_maxLeanRightMeta,
),
);
}
if (data.containsKey('max_accel_g')) {
context.handle(
_maxAccelGMeta,
maxAccelG.isAcceptableOrUnknown(data['max_accel_g']!, _maxAccelGMeta),
);
}
if (data.containsKey('max_braking_g')) {
context.handle(
_maxBrakingGMeta,
maxBrakingG.isAcceptableOrUnknown(
data['max_braking_g']!,
_maxBrakingGMeta,
),
);
}
if (data.containsKey('best0to60_ms')) {
context.handle(
_best0to60MsMeta,
best0to60Ms.isAcceptableOrUnknown(
data['best0to60_ms']!,
_best0to60MsMeta,
),
);
}
if (data.containsKey('best0to100_ms')) {
context.handle(
_best0to100MsMeta,
best0to100Ms.isAcceptableOrUnknown(
data['best0to100_ms']!,
_best0to100MsMeta,
),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Ride map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Ride(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
startTime: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}start_time'],
)!,
endTime: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}end_time'],
),
distanceMiles: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}distance_miles'],
)!,
topSpeedMph: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}top_speed_mph'],
)!,
maxLeanLeft: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}max_lean_left'],
)!,
maxLeanRight: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}max_lean_right'],
)!,
maxAccelG: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}max_accel_g'],
)!,
maxBrakingG: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}max_braking_g'],
)!,
best0to60Ms: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}best0to60_ms'],
),
best0to100Ms: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}best0to100_ms'],
),
);
}
@override
$RidesTable createAlias(String alias) {
return $RidesTable(attachedDatabase, alias);
}
}
class Ride extends DataClass implements Insertable<Ride> {
final int id;
final DateTime startTime;
final DateTime? endTime;
final double distanceMiles;
final double topSpeedMph;
final double maxLeanLeft;
final double maxLeanRight;
final double maxAccelG;
final double maxBrakingG;
final double? best0to60Ms;
final double? best0to100Ms;
const Ride({
required this.id,
required this.startTime,
this.endTime,
required this.distanceMiles,
required this.topSpeedMph,
required this.maxLeanLeft,
required this.maxLeanRight,
required this.maxAccelG,
required this.maxBrakingG,
this.best0to60Ms,
this.best0to100Ms,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<int>(id);
map['start_time'] = Variable<DateTime>(startTime);
if (!nullToAbsent || endTime != null) {
map['end_time'] = Variable<DateTime>(endTime);
}
map['distance_miles'] = Variable<double>(distanceMiles);
map['top_speed_mph'] = Variable<double>(topSpeedMph);
map['max_lean_left'] = Variable<double>(maxLeanLeft);
map['max_lean_right'] = Variable<double>(maxLeanRight);
map['max_accel_g'] = Variable<double>(maxAccelG);
map['max_braking_g'] = Variable<double>(maxBrakingG);
if (!nullToAbsent || best0to60Ms != null) {
map['best0to60_ms'] = Variable<double>(best0to60Ms);
}
if (!nullToAbsent || best0to100Ms != null) {
map['best0to100_ms'] = Variable<double>(best0to100Ms);
}
return map;
}
RidesCompanion toCompanion(bool nullToAbsent) {
return RidesCompanion(
id: Value(id),
startTime: Value(startTime),
endTime: endTime == null && nullToAbsent
? const Value.absent()
: Value(endTime),
distanceMiles: Value(distanceMiles),
topSpeedMph: Value(topSpeedMph),
maxLeanLeft: Value(maxLeanLeft),
maxLeanRight: Value(maxLeanRight),
maxAccelG: Value(maxAccelG),
maxBrakingG: Value(maxBrakingG),
best0to60Ms: best0to60Ms == null && nullToAbsent
? const Value.absent()
: Value(best0to60Ms),
best0to100Ms: best0to100Ms == null && nullToAbsent
? const Value.absent()
: Value(best0to100Ms),
);
}
factory Ride.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Ride(
id: serializer.fromJson<int>(json['id']),
startTime: serializer.fromJson<DateTime>(json['startTime']),
endTime: serializer.fromJson<DateTime?>(json['endTime']),
distanceMiles: serializer.fromJson<double>(json['distanceMiles']),
topSpeedMph: serializer.fromJson<double>(json['topSpeedMph']),
maxLeanLeft: serializer.fromJson<double>(json['maxLeanLeft']),
maxLeanRight: serializer.fromJson<double>(json['maxLeanRight']),
maxAccelG: serializer.fromJson<double>(json['maxAccelG']),
maxBrakingG: serializer.fromJson<double>(json['maxBrakingG']),
best0to60Ms: serializer.fromJson<double?>(json['best0to60Ms']),
best0to100Ms: serializer.fromJson<double?>(json['best0to100Ms']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<int>(id),
'startTime': serializer.toJson<DateTime>(startTime),
'endTime': serializer.toJson<DateTime?>(endTime),
'distanceMiles': serializer.toJson<double>(distanceMiles),
'topSpeedMph': serializer.toJson<double>(topSpeedMph),
'maxLeanLeft': serializer.toJson<double>(maxLeanLeft),
'maxLeanRight': serializer.toJson<double>(maxLeanRight),
'maxAccelG': serializer.toJson<double>(maxAccelG),
'maxBrakingG': serializer.toJson<double>(maxBrakingG),
'best0to60Ms': serializer.toJson<double?>(best0to60Ms),
'best0to100Ms': serializer.toJson<double?>(best0to100Ms),
};
}
Ride copyWith({
int? id,
DateTime? startTime,
Value<DateTime?> endTime = const Value.absent(),
double? distanceMiles,
double? topSpeedMph,
double? maxLeanLeft,
double? maxLeanRight,
double? maxAccelG,
double? maxBrakingG,
Value<double?> best0to60Ms = const Value.absent(),
Value<double?> best0to100Ms = const Value.absent(),
}) => Ride(
id: id ?? this.id,
startTime: startTime ?? this.startTime,
endTime: endTime.present ? endTime.value : this.endTime,
distanceMiles: distanceMiles ?? this.distanceMiles,
topSpeedMph: topSpeedMph ?? this.topSpeedMph,
maxLeanLeft: maxLeanLeft ?? this.maxLeanLeft,
maxLeanRight: maxLeanRight ?? this.maxLeanRight,
maxAccelG: maxAccelG ?? this.maxAccelG,
maxBrakingG: maxBrakingG ?? this.maxBrakingG,
best0to60Ms: best0to60Ms.present ? best0to60Ms.value : this.best0to60Ms,
best0to100Ms: best0to100Ms.present ? best0to100Ms.value : this.best0to100Ms,
);
Ride copyWithCompanion(RidesCompanion data) {
return Ride(
id: data.id.present ? data.id.value : this.id,
startTime: data.startTime.present ? data.startTime.value : this.startTime,
endTime: data.endTime.present ? data.endTime.value : this.endTime,
distanceMiles: data.distanceMiles.present
? data.distanceMiles.value
: this.distanceMiles,
topSpeedMph: data.topSpeedMph.present
? data.topSpeedMph.value
: this.topSpeedMph,
maxLeanLeft: data.maxLeanLeft.present
? data.maxLeanLeft.value
: this.maxLeanLeft,
maxLeanRight: data.maxLeanRight.present
? data.maxLeanRight.value
: this.maxLeanRight,
maxAccelG: data.maxAccelG.present ? data.maxAccelG.value : this.maxAccelG,
maxBrakingG: data.maxBrakingG.present
? data.maxBrakingG.value
: this.maxBrakingG,
best0to60Ms: data.best0to60Ms.present
? data.best0to60Ms.value
: this.best0to60Ms,
best0to100Ms: data.best0to100Ms.present
? data.best0to100Ms.value
: this.best0to100Ms,
);
}
@override
String toString() {
return (StringBuffer('Ride(')
..write('id: $id, ')
..write('startTime: $startTime, ')
..write('endTime: $endTime, ')
..write('distanceMiles: $distanceMiles, ')
..write('topSpeedMph: $topSpeedMph, ')
..write('maxLeanLeft: $maxLeanLeft, ')
..write('maxLeanRight: $maxLeanRight, ')
..write('maxAccelG: $maxAccelG, ')
..write('maxBrakingG: $maxBrakingG, ')
..write('best0to60Ms: $best0to60Ms, ')
..write('best0to100Ms: $best0to100Ms')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
startTime,
endTime,
distanceMiles,
topSpeedMph,
maxLeanLeft,
maxLeanRight,
maxAccelG,
maxBrakingG,
best0to60Ms,
best0to100Ms,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Ride &&
other.id == this.id &&
other.startTime == this.startTime &&
other.endTime == this.endTime &&
other.distanceMiles == this.distanceMiles &&
other.topSpeedMph == this.topSpeedMph &&
other.maxLeanLeft == this.maxLeanLeft &&
other.maxLeanRight == this.maxLeanRight &&
other.maxAccelG == this.maxAccelG &&
other.maxBrakingG == this.maxBrakingG &&
other.best0to60Ms == this.best0to60Ms &&
other.best0to100Ms == this.best0to100Ms);
}
class RidesCompanion extends UpdateCompanion<Ride> {
final Value<int> id;
final Value<DateTime> startTime;
final Value<DateTime?> endTime;
final Value<double> distanceMiles;
final Value<double> topSpeedMph;
final Value<double> maxLeanLeft;
final Value<double> maxLeanRight;
final Value<double> maxAccelG;
final Value<double> maxBrakingG;
final Value<double?> best0to60Ms;
final Value<double?> best0to100Ms;
const RidesCompanion({
this.id = const Value.absent(),
this.startTime = const Value.absent(),
this.endTime = const Value.absent(),
this.distanceMiles = const Value.absent(),
this.topSpeedMph = const Value.absent(),
this.maxLeanLeft = const Value.absent(),
this.maxLeanRight = const Value.absent(),
this.maxAccelG = const Value.absent(),
this.maxBrakingG = const Value.absent(),
this.best0to60Ms = const Value.absent(),
this.best0to100Ms = const Value.absent(),
});
RidesCompanion.insert({
this.id = const Value.absent(),
required DateTime startTime,
this.endTime = const Value.absent(),
this.distanceMiles = const Value.absent(),
this.topSpeedMph = const Value.absent(),
this.maxLeanLeft = const Value.absent(),
this.maxLeanRight = const Value.absent(),
this.maxAccelG = const Value.absent(),
this.maxBrakingG = const Value.absent(),
this.best0to60Ms = const Value.absent(),
this.best0to100Ms = const Value.absent(),
}) : startTime = Value(startTime);
static Insertable<Ride> custom({
Expression<int>? id,
Expression<DateTime>? startTime,
Expression<DateTime>? endTime,
Expression<double>? distanceMiles,
Expression<double>? topSpeedMph,
Expression<double>? maxLeanLeft,
Expression<double>? maxLeanRight,
Expression<double>? maxAccelG,
Expression<double>? maxBrakingG,
Expression<double>? best0to60Ms,
Expression<double>? best0to100Ms,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (startTime != null) 'start_time': startTime,
if (endTime != null) 'end_time': endTime,
if (distanceMiles != null) 'distance_miles': distanceMiles,
if (topSpeedMph != null) 'top_speed_mph': topSpeedMph,
if (maxLeanLeft != null) 'max_lean_left': maxLeanLeft,
if (maxLeanRight != null) 'max_lean_right': maxLeanRight,
if (maxAccelG != null) 'max_accel_g': maxAccelG,
if (maxBrakingG != null) 'max_braking_g': maxBrakingG,
if (best0to60Ms != null) 'best0to60_ms': best0to60Ms,
if (best0to100Ms != null) 'best0to100_ms': best0to100Ms,
});
}
RidesCompanion copyWith({
Value<int>? id,
Value<DateTime>? startTime,
Value<DateTime?>? endTime,
Value<double>? distanceMiles,
Value<double>? topSpeedMph,
Value<double>? maxLeanLeft,
Value<double>? maxLeanRight,
Value<double>? maxAccelG,
Value<double>? maxBrakingG,
Value<double?>? best0to60Ms,
Value<double?>? best0to100Ms,
}) {
return RidesCompanion(
id: id ?? this.id,
startTime: startTime ?? this.startTime,
endTime: endTime ?? this.endTime,
distanceMiles: distanceMiles ?? this.distanceMiles,
topSpeedMph: topSpeedMph ?? this.topSpeedMph,
maxLeanLeft: maxLeanLeft ?? this.maxLeanLeft,
maxLeanRight: maxLeanRight ?? this.maxLeanRight,
maxAccelG: maxAccelG ?? this.maxAccelG,
maxBrakingG: maxBrakingG ?? this.maxBrakingG,
best0to60Ms: best0to60Ms ?? this.best0to60Ms,
best0to100Ms: best0to100Ms ?? this.best0to100Ms,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<int>(id.value);
}
if (startTime.present) {
map['start_time'] = Variable<DateTime>(startTime.value);
}
if (endTime.present) {
map['end_time'] = Variable<DateTime>(endTime.value);
}
if (distanceMiles.present) {
map['distance_miles'] = Variable<double>(distanceMiles.value);
}
if (topSpeedMph.present) {
map['top_speed_mph'] = Variable<double>(topSpeedMph.value);
}
if (maxLeanLeft.present) {
map['max_lean_left'] = Variable<double>(maxLeanLeft.value);
}
if (maxLeanRight.present) {
map['max_lean_right'] = Variable<double>(maxLeanRight.value);
}
if (maxAccelG.present) {
map['max_accel_g'] = Variable<double>(maxAccelG.value);
}
if (maxBrakingG.present) {
map['max_braking_g'] = Variable<double>(maxBrakingG.value);
}
if (best0to60Ms.present) {
map['best0to60_ms'] = Variable<double>(best0to60Ms.value);
}
if (best0to100Ms.present) {
map['best0to100_ms'] = Variable<double>(best0to100Ms.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('RidesCompanion(')
..write('id: $id, ')
..write('startTime: $startTime, ')
..write('endTime: $endTime, ')
..write('distanceMiles: $distanceMiles, ')
..write('topSpeedMph: $topSpeedMph, ')
..write('maxLeanLeft: $maxLeanLeft, ')
..write('maxLeanRight: $maxLeanRight, ')
..write('maxAccelG: $maxAccelG, ')
..write('maxBrakingG: $maxBrakingG, ')
..write('best0to60Ms: $best0to60Ms, ')
..write('best0to100Ms: $best0to100Ms')
..write(')'))
.toString();
}
}
class $PerformanceRunsTable extends PerformanceRuns
with TableInfo<$PerformanceRunsTable, PerformanceRun> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$PerformanceRunsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
hasAutoIncrement: true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'PRIMARY KEY AUTOINCREMENT',
),
);
static const VerificationMeta _rideIdMeta = const VerificationMeta('rideId');
@override
late final GeneratedColumn<int> rideId = GeneratedColumn<int>(
'ride_id',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'REFERENCES rides (id)',
),
);
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 _timeMsMeta = const VerificationMeta('timeMs');
@override
late final GeneratedColumn<double> timeMs = GeneratedColumn<double>(
'time_ms',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: true,
);
static const VerificationMeta _topSpeedReachedMeta = const VerificationMeta(
'topSpeedReached',
);
@override
late final GeneratedColumn<double> topSpeedReached = GeneratedColumn<double>(
'top_speed_reached',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: true,
);
static const VerificationMeta _timestampMeta = const VerificationMeta(
'timestamp',
);
@override
late final GeneratedColumn<DateTime> timestamp = GeneratedColumn<DateTime>(
'timestamp',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: true,
);
@override
List<GeneratedColumn> get $columns => [
id,
rideId,
type,
timeMs,
topSpeedReached,
timestamp,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'performance_runs';
@override
VerificationContext validateIntegrity(
Insertable<PerformanceRun> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
}
if (data.containsKey('ride_id')) {
context.handle(
_rideIdMeta,
rideId.isAcceptableOrUnknown(data['ride_id']!, _rideIdMeta),
);
}
if (data.containsKey('type')) {
context.handle(
_typeMeta,
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
);
} else if (isInserting) {
context.missing(_typeMeta);
}
if (data.containsKey('time_ms')) {
context.handle(
_timeMsMeta,
timeMs.isAcceptableOrUnknown(data['time_ms']!, _timeMsMeta),
);
} else if (isInserting) {
context.missing(_timeMsMeta);
}
if (data.containsKey('top_speed_reached')) {
context.handle(
_topSpeedReachedMeta,
topSpeedReached.isAcceptableOrUnknown(
data['top_speed_reached']!,
_topSpeedReachedMeta,
),
);
} else if (isInserting) {
context.missing(_topSpeedReachedMeta);
}
if (data.containsKey('timestamp')) {
context.handle(
_timestampMeta,
timestamp.isAcceptableOrUnknown(data['timestamp']!, _timestampMeta),
);
} else if (isInserting) {
context.missing(_timestampMeta);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
PerformanceRun map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return PerformanceRun(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
rideId: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}ride_id'],
),
type: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}type'],
)!,
timeMs: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}time_ms'],
)!,
topSpeedReached: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}top_speed_reached'],
)!,
timestamp: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}timestamp'],
)!,
);
}
@override
$PerformanceRunsTable createAlias(String alias) {
return $PerformanceRunsTable(attachedDatabase, alias);
}
}
class PerformanceRun extends DataClass implements Insertable<PerformanceRun> {
final int id;
final int? rideId;
final String type;
final double timeMs;
final double topSpeedReached;
final DateTime timestamp;
const PerformanceRun({
required this.id,
this.rideId,
required this.type,
required this.timeMs,
required this.topSpeedReached,
required this.timestamp,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<int>(id);
if (!nullToAbsent || rideId != null) {
map['ride_id'] = Variable<int>(rideId);
}
map['type'] = Variable<String>(type);
map['time_ms'] = Variable<double>(timeMs);
map['top_speed_reached'] = Variable<double>(topSpeedReached);
map['timestamp'] = Variable<DateTime>(timestamp);
return map;
}
PerformanceRunsCompanion toCompanion(bool nullToAbsent) {
return PerformanceRunsCompanion(
id: Value(id),
rideId: rideId == null && nullToAbsent
? const Value.absent()
: Value(rideId),
type: Value(type),
timeMs: Value(timeMs),
topSpeedReached: Value(topSpeedReached),
timestamp: Value(timestamp),
);
}
factory PerformanceRun.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return PerformanceRun(
id: serializer.fromJson<int>(json['id']),
rideId: serializer.fromJson<int?>(json['rideId']),
type: serializer.fromJson<String>(json['type']),
timeMs: serializer.fromJson<double>(json['timeMs']),
topSpeedReached: serializer.fromJson<double>(json['topSpeedReached']),
timestamp: serializer.fromJson<DateTime>(json['timestamp']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<int>(id),
'rideId': serializer.toJson<int?>(rideId),
'type': serializer.toJson<String>(type),
'timeMs': serializer.toJson<double>(timeMs),
'topSpeedReached': serializer.toJson<double>(topSpeedReached),
'timestamp': serializer.toJson<DateTime>(timestamp),
};
}
PerformanceRun copyWith({
int? id,
Value<int?> rideId = const Value.absent(),
String? type,
double? timeMs,
double? topSpeedReached,
DateTime? timestamp,
}) => PerformanceRun(
id: id ?? this.id,
rideId: rideId.present ? rideId.value : this.rideId,
type: type ?? this.type,
timeMs: timeMs ?? this.timeMs,
topSpeedReached: topSpeedReached ?? this.topSpeedReached,
timestamp: timestamp ?? this.timestamp,
);
PerformanceRun copyWithCompanion(PerformanceRunsCompanion data) {
return PerformanceRun(
id: data.id.present ? data.id.value : this.id,
rideId: data.rideId.present ? data.rideId.value : this.rideId,
type: data.type.present ? data.type.value : this.type,
timeMs: data.timeMs.present ? data.timeMs.value : this.timeMs,
topSpeedReached: data.topSpeedReached.present
? data.topSpeedReached.value
: this.topSpeedReached,
timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp,
);
}
@override
String toString() {
return (StringBuffer('PerformanceRun(')
..write('id: $id, ')
..write('rideId: $rideId, ')
..write('type: $type, ')
..write('timeMs: $timeMs, ')
..write('topSpeedReached: $topSpeedReached, ')
..write('timestamp: $timestamp')
..write(')'))
.toString();
}
@override
int get hashCode =>
Object.hash(id, rideId, type, timeMs, topSpeedReached, timestamp);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is PerformanceRun &&
other.id == this.id &&
other.rideId == this.rideId &&
other.type == this.type &&
other.timeMs == this.timeMs &&
other.topSpeedReached == this.topSpeedReached &&
other.timestamp == this.timestamp);
}
class PerformanceRunsCompanion extends UpdateCompanion<PerformanceRun> {
final Value<int> id;
final Value<int?> rideId;
final Value<String> type;
final Value<double> timeMs;
final Value<double> topSpeedReached;
final Value<DateTime> timestamp;
const PerformanceRunsCompanion({
this.id = const Value.absent(),
this.rideId = const Value.absent(),
this.type = const Value.absent(),
this.timeMs = const Value.absent(),
this.topSpeedReached = const Value.absent(),
this.timestamp = const Value.absent(),
});
PerformanceRunsCompanion.insert({
this.id = const Value.absent(),
this.rideId = const Value.absent(),
required String type,
required double timeMs,
required double topSpeedReached,
required DateTime timestamp,
}) : type = Value(type),
timeMs = Value(timeMs),
topSpeedReached = Value(topSpeedReached),
timestamp = Value(timestamp);
static Insertable<PerformanceRun> custom({
Expression<int>? id,
Expression<int>? rideId,
Expression<String>? type,
Expression<double>? timeMs,
Expression<double>? topSpeedReached,
Expression<DateTime>? timestamp,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (rideId != null) 'ride_id': rideId,
if (type != null) 'type': type,
if (timeMs != null) 'time_ms': timeMs,
if (topSpeedReached != null) 'top_speed_reached': topSpeedReached,
if (timestamp != null) 'timestamp': timestamp,
});
}
PerformanceRunsCompanion copyWith({
Value<int>? id,
Value<int?>? rideId,
Value<String>? type,
Value<double>? timeMs,
Value<double>? topSpeedReached,
Value<DateTime>? timestamp,
}) {
return PerformanceRunsCompanion(
id: id ?? this.id,
rideId: rideId ?? this.rideId,
type: type ?? this.type,
timeMs: timeMs ?? this.timeMs,
topSpeedReached: topSpeedReached ?? this.topSpeedReached,
timestamp: timestamp ?? this.timestamp,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<int>(id.value);
}
if (rideId.present) {
map['ride_id'] = Variable<int>(rideId.value);
}
if (type.present) {
map['type'] = Variable<String>(type.value);
}
if (timeMs.present) {
map['time_ms'] = Variable<double>(timeMs.value);
}
if (topSpeedReached.present) {
map['top_speed_reached'] = Variable<double>(topSpeedReached.value);
}
if (timestamp.present) {
map['timestamp'] = Variable<DateTime>(timestamp.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('PerformanceRunsCompanion(')
..write('id: $id, ')
..write('rideId: $rideId, ')
..write('type: $type, ')
..write('timeMs: $timeMs, ')
..write('topSpeedReached: $topSpeedReached, ')
..write('timestamp: $timestamp')
..write(')'))
.toString();
}
}
abstract class _$AppDatabase extends GeneratedDatabase {
_$AppDatabase(QueryExecutor e) : super(e);
$AppDatabaseManager get managers => $AppDatabaseManager(this);
late final $RidesTable rides = $RidesTable(this);
late final $PerformanceRunsTable performanceRuns = $PerformanceRunsTable(
this,
);
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [rides, performanceRuns];
}
typedef $$RidesTableCreateCompanionBuilder =
RidesCompanion Function({
Value<int> id,
required DateTime startTime,
Value<DateTime?> endTime,
Value<double> distanceMiles,
Value<double> topSpeedMph,
Value<double> maxLeanLeft,
Value<double> maxLeanRight,
Value<double> maxAccelG,
Value<double> maxBrakingG,
Value<double?> best0to60Ms,
Value<double?> best0to100Ms,
});
typedef $$RidesTableUpdateCompanionBuilder =
RidesCompanion Function({
Value<int> id,
Value<DateTime> startTime,
Value<DateTime?> endTime,
Value<double> distanceMiles,
Value<double> topSpeedMph,
Value<double> maxLeanLeft,
Value<double> maxLeanRight,
Value<double> maxAccelG,
Value<double> maxBrakingG,
Value<double?> best0to60Ms,
Value<double?> best0to100Ms,
});
final class $$RidesTableReferences
extends BaseReferences<_$AppDatabase, $RidesTable, Ride> {
$$RidesTableReferences(super.$_db, super.$_table, super.$_typedResult);
static MultiTypedResultKey<$PerformanceRunsTable, List<PerformanceRun>>
_performanceRunsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
db.performanceRuns,
aliasName: 'rides__id__performance_runs__ride_id',
);
$$PerformanceRunsTableProcessedTableManager get performanceRunsRefs {
final manager = $$PerformanceRunsTableTableManager(
$_db,
$_db.performanceRuns,
).filter((f) => f.rideId.id.sqlEquals($_itemColumn<int>('id')!));
final cache = $_typedResult.readTableOrNull(
_performanceRunsRefsTable($_db),
);
return ProcessedTableManager(
manager.$state.copyWith(prefetchedData: cache),
);
}
}
class $$RidesTableFilterComposer extends Composer<_$AppDatabase, $RidesTable> {
$$RidesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get startTime => $composableBuilder(
column: $table.startTime,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get endTime => $composableBuilder(
column: $table.endTime,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get distanceMiles => $composableBuilder(
column: $table.distanceMiles,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get topSpeedMph => $composableBuilder(
column: $table.topSpeedMph,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get maxLeanLeft => $composableBuilder(
column: $table.maxLeanLeft,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get maxLeanRight => $composableBuilder(
column: $table.maxLeanRight,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get maxAccelG => $composableBuilder(
column: $table.maxAccelG,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get maxBrakingG => $composableBuilder(
column: $table.maxBrakingG,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get best0to60Ms => $composableBuilder(
column: $table.best0to60Ms,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get best0to100Ms => $composableBuilder(
column: $table.best0to100Ms,
builder: (column) => ColumnFilters(column),
);
Expression<bool> performanceRunsRefs(
Expression<bool> Function($$PerformanceRunsTableFilterComposer f) f,
) {
final $$PerformanceRunsTableFilterComposer composer = $composerBuilder(
composer: this,
getCurrentColumn: (t) => t.id,
referencedTable: $db.performanceRuns,
getReferencedColumn: (t) => t.rideId,
builder:
(
joinBuilder, {
$addJoinBuilderToRootComposer,
$removeJoinBuilderFromRootComposer,
}) => $$PerformanceRunsTableFilterComposer(
$db: $db,
$table: $db.performanceRuns,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
joinBuilder: joinBuilder,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer,
),
);
return f(composer);
}
}
class $$RidesTableOrderingComposer
extends Composer<_$AppDatabase, $RidesTable> {
$$RidesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get startTime => $composableBuilder(
column: $table.startTime,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get endTime => $composableBuilder(
column: $table.endTime,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get distanceMiles => $composableBuilder(
column: $table.distanceMiles,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get topSpeedMph => $composableBuilder(
column: $table.topSpeedMph,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get maxLeanLeft => $composableBuilder(
column: $table.maxLeanLeft,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get maxLeanRight => $composableBuilder(
column: $table.maxLeanRight,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get maxAccelG => $composableBuilder(
column: $table.maxAccelG,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get maxBrakingG => $composableBuilder(
column: $table.maxBrakingG,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get best0to60Ms => $composableBuilder(
column: $table.best0to60Ms,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get best0to100Ms => $composableBuilder(
column: $table.best0to100Ms,
builder: (column) => ColumnOrderings(column),
);
}
class $$RidesTableAnnotationComposer
extends Composer<_$AppDatabase, $RidesTable> {
$$RidesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<DateTime> get startTime =>
$composableBuilder(column: $table.startTime, builder: (column) => column);
GeneratedColumn<DateTime> get endTime =>
$composableBuilder(column: $table.endTime, builder: (column) => column);
GeneratedColumn<double> get distanceMiles => $composableBuilder(
column: $table.distanceMiles,
builder: (column) => column,
);
GeneratedColumn<double> get topSpeedMph => $composableBuilder(
column: $table.topSpeedMph,
builder: (column) => column,
);
GeneratedColumn<double> get maxLeanLeft => $composableBuilder(
column: $table.maxLeanLeft,
builder: (column) => column,
);
GeneratedColumn<double> get maxLeanRight => $composableBuilder(
column: $table.maxLeanRight,
builder: (column) => column,
);
GeneratedColumn<double> get maxAccelG =>
$composableBuilder(column: $table.maxAccelG, builder: (column) => column);
GeneratedColumn<double> get maxBrakingG => $composableBuilder(
column: $table.maxBrakingG,
builder: (column) => column,
);
GeneratedColumn<double> get best0to60Ms => $composableBuilder(
column: $table.best0to60Ms,
builder: (column) => column,
);
GeneratedColumn<double> get best0to100Ms => $composableBuilder(
column: $table.best0to100Ms,
builder: (column) => column,
);
Expression<T> performanceRunsRefs<T extends Object>(
Expression<T> Function($$PerformanceRunsTableAnnotationComposer a) f,
) {
final $$PerformanceRunsTableAnnotationComposer composer = $composerBuilder(
composer: this,
getCurrentColumn: (t) => t.id,
referencedTable: $db.performanceRuns,
getReferencedColumn: (t) => t.rideId,
builder:
(
joinBuilder, {
$addJoinBuilderToRootComposer,
$removeJoinBuilderFromRootComposer,
}) => $$PerformanceRunsTableAnnotationComposer(
$db: $db,
$table: $db.performanceRuns,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
joinBuilder: joinBuilder,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer,
),
);
return f(composer);
}
}
class $$RidesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$RidesTable,
Ride,
$$RidesTableFilterComposer,
$$RidesTableOrderingComposer,
$$RidesTableAnnotationComposer,
$$RidesTableCreateCompanionBuilder,
$$RidesTableUpdateCompanionBuilder,
(Ride, $$RidesTableReferences),
Ride,
PrefetchHooks Function({bool performanceRunsRefs})
> {
$$RidesTableTableManager(_$AppDatabase db, $RidesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$RidesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$RidesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$RidesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<DateTime> startTime = const Value.absent(),
Value<DateTime?> endTime = const Value.absent(),
Value<double> distanceMiles = const Value.absent(),
Value<double> topSpeedMph = const Value.absent(),
Value<double> maxLeanLeft = const Value.absent(),
Value<double> maxLeanRight = const Value.absent(),
Value<double> maxAccelG = const Value.absent(),
Value<double> maxBrakingG = const Value.absent(),
Value<double?> best0to60Ms = const Value.absent(),
Value<double?> best0to100Ms = const Value.absent(),
}) => RidesCompanion(
id: id,
startTime: startTime,
endTime: endTime,
distanceMiles: distanceMiles,
topSpeedMph: topSpeedMph,
maxLeanLeft: maxLeanLeft,
maxLeanRight: maxLeanRight,
maxAccelG: maxAccelG,
maxBrakingG: maxBrakingG,
best0to60Ms: best0to60Ms,
best0to100Ms: best0to100Ms,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required DateTime startTime,
Value<DateTime?> endTime = const Value.absent(),
Value<double> distanceMiles = const Value.absent(),
Value<double> topSpeedMph = const Value.absent(),
Value<double> maxLeanLeft = const Value.absent(),
Value<double> maxLeanRight = const Value.absent(),
Value<double> maxAccelG = const Value.absent(),
Value<double> maxBrakingG = const Value.absent(),
Value<double?> best0to60Ms = const Value.absent(),
Value<double?> best0to100Ms = const Value.absent(),
}) => RidesCompanion.insert(
id: id,
startTime: startTime,
endTime: endTime,
distanceMiles: distanceMiles,
topSpeedMph: topSpeedMph,
maxLeanLeft: maxLeanLeft,
maxLeanRight: maxLeanRight,
maxAccelG: maxAccelG,
maxBrakingG: maxBrakingG,
best0to60Ms: best0to60Ms,
best0to100Ms: best0to100Ms,
),
withReferenceMapper: (p0) => p0
.map(
(e) =>
(e.readTable(table), $$RidesTableReferences(db, table, e)),
)
.toList(),
prefetchHooksCallback: ({performanceRunsRefs = false}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [
if (performanceRunsRefs) db.performanceRuns,
],
addJoins: null,
getPrefetchedDataCallback: (items) async {
return [
if (performanceRunsRefs)
await $_getPrefetchedData<
Ride,
$RidesTable,
PerformanceRun
>(
currentTable: table,
referencedTable: $$RidesTableReferences
._performanceRunsRefsTable(db),
managerFromTypedResult: (p0) => $$RidesTableReferences(
db,
table,
p0,
).performanceRunsRefs,
referencedItemsForCurrentItem: (item, referencedItems) =>
referencedItems.where((e) => e.rideId == item.id),
typedResults: items,
),
];
},
);
},
),
);
}
typedef $$RidesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$RidesTable,
Ride,
$$RidesTableFilterComposer,
$$RidesTableOrderingComposer,
$$RidesTableAnnotationComposer,
$$RidesTableCreateCompanionBuilder,
$$RidesTableUpdateCompanionBuilder,
(Ride, $$RidesTableReferences),
Ride,
PrefetchHooks Function({bool performanceRunsRefs})
>;
typedef $$PerformanceRunsTableCreateCompanionBuilder =
PerformanceRunsCompanion Function({
Value<int> id,
Value<int?> rideId,
required String type,
required double timeMs,
required double topSpeedReached,
required DateTime timestamp,
});
typedef $$PerformanceRunsTableUpdateCompanionBuilder =
PerformanceRunsCompanion Function({
Value<int> id,
Value<int?> rideId,
Value<String> type,
Value<double> timeMs,
Value<double> topSpeedReached,
Value<DateTime> timestamp,
});
final class $$PerformanceRunsTableReferences
extends
BaseReferences<_$AppDatabase, $PerformanceRunsTable, PerformanceRun> {
$$PerformanceRunsTableReferences(
super.$_db,
super.$_table,
super.$_typedResult,
);
static $RidesTable _rideIdTable(_$AppDatabase db) =>
db.rides.createAlias('performance_runs__ride_id__rides__id');
$$RidesTableProcessedTableManager? get rideId {
final $_column = $_itemColumn<int>('ride_id');
if ($_column == null) return null;
final manager = $$RidesTableTableManager(
$_db,
$_db.rides,
).filter((f) => f.id.sqlEquals($_column));
final item = $_typedResult.readTableOrNull(_rideIdTable($_db));
if (item == null) return manager;
return ProcessedTableManager(
manager.$state.copyWith(prefetchedData: [item]),
);
}
}
class $$PerformanceRunsTableFilterComposer
extends Composer<_$AppDatabase, $PerformanceRunsTable> {
$$PerformanceRunsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get timeMs => $composableBuilder(
column: $table.timeMs,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get topSpeedReached => $composableBuilder(
column: $table.topSpeedReached,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get timestamp => $composableBuilder(
column: $table.timestamp,
builder: (column) => ColumnFilters(column),
);
$$RidesTableFilterComposer get rideId {
final $$RidesTableFilterComposer composer = $composerBuilder(
composer: this,
getCurrentColumn: (t) => t.rideId,
referencedTable: $db.rides,
getReferencedColumn: (t) => t.id,
builder:
(
joinBuilder, {
$addJoinBuilderToRootComposer,
$removeJoinBuilderFromRootComposer,
}) => $$RidesTableFilterComposer(
$db: $db,
$table: $db.rides,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
joinBuilder: joinBuilder,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer,
),
);
return composer;
}
}
class $$PerformanceRunsTableOrderingComposer
extends Composer<_$AppDatabase, $PerformanceRunsTable> {
$$PerformanceRunsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get timeMs => $composableBuilder(
column: $table.timeMs,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get topSpeedReached => $composableBuilder(
column: $table.topSpeedReached,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get timestamp => $composableBuilder(
column: $table.timestamp,
builder: (column) => ColumnOrderings(column),
);
$$RidesTableOrderingComposer get rideId {
final $$RidesTableOrderingComposer composer = $composerBuilder(
composer: this,
getCurrentColumn: (t) => t.rideId,
referencedTable: $db.rides,
getReferencedColumn: (t) => t.id,
builder:
(
joinBuilder, {
$addJoinBuilderToRootComposer,
$removeJoinBuilderFromRootComposer,
}) => $$RidesTableOrderingComposer(
$db: $db,
$table: $db.rides,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
joinBuilder: joinBuilder,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer,
),
);
return composer;
}
}
class $$PerformanceRunsTableAnnotationComposer
extends Composer<_$AppDatabase, $PerformanceRunsTable> {
$$PerformanceRunsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get type =>
$composableBuilder(column: $table.type, builder: (column) => column);
GeneratedColumn<double> get timeMs =>
$composableBuilder(column: $table.timeMs, builder: (column) => column);
GeneratedColumn<double> get topSpeedReached => $composableBuilder(
column: $table.topSpeedReached,
builder: (column) => column,
);
GeneratedColumn<DateTime> get timestamp =>
$composableBuilder(column: $table.timestamp, builder: (column) => column);
$$RidesTableAnnotationComposer get rideId {
final $$RidesTableAnnotationComposer composer = $composerBuilder(
composer: this,
getCurrentColumn: (t) => t.rideId,
referencedTable: $db.rides,
getReferencedColumn: (t) => t.id,
builder:
(
joinBuilder, {
$addJoinBuilderToRootComposer,
$removeJoinBuilderFromRootComposer,
}) => $$RidesTableAnnotationComposer(
$db: $db,
$table: $db.rides,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
joinBuilder: joinBuilder,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer,
),
);
return composer;
}
}
class $$PerformanceRunsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$PerformanceRunsTable,
PerformanceRun,
$$PerformanceRunsTableFilterComposer,
$$PerformanceRunsTableOrderingComposer,
$$PerformanceRunsTableAnnotationComposer,
$$PerformanceRunsTableCreateCompanionBuilder,
$$PerformanceRunsTableUpdateCompanionBuilder,
(PerformanceRun, $$PerformanceRunsTableReferences),
PerformanceRun,
PrefetchHooks Function({bool rideId})
> {
$$PerformanceRunsTableTableManager(
_$AppDatabase db,
$PerformanceRunsTable table,
) : super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$PerformanceRunsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$PerformanceRunsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$PerformanceRunsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<int?> rideId = const Value.absent(),
Value<String> type = const Value.absent(),
Value<double> timeMs = const Value.absent(),
Value<double> topSpeedReached = const Value.absent(),
Value<DateTime> timestamp = const Value.absent(),
}) => PerformanceRunsCompanion(
id: id,
rideId: rideId,
type: type,
timeMs: timeMs,
topSpeedReached: topSpeedReached,
timestamp: timestamp,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<int?> rideId = const Value.absent(),
required String type,
required double timeMs,
required double topSpeedReached,
required DateTime timestamp,
}) => PerformanceRunsCompanion.insert(
id: id,
rideId: rideId,
type: type,
timeMs: timeMs,
topSpeedReached: topSpeedReached,
timestamp: timestamp,
),
withReferenceMapper: (p0) => p0
.map(
(e) => (
e.readTable(table),
$$PerformanceRunsTableReferences(db, table, e),
),
)
.toList(),
prefetchHooksCallback: ({rideId = false}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [],
addJoins:
<
T extends TableManagerState<
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic,
dynamic
>
>(state) {
if (rideId) {
state =
state.withJoin(
currentTable: table,
currentColumn: table.rideId,
referencedTable:
$$PerformanceRunsTableReferences
._rideIdTable(db),
referencedColumn:
$$PerformanceRunsTableReferences
._rideIdTable(db)
.id,
)
as T;
}
return state;
},
getPrefetchedDataCallback: (items) async {
return [];
},
);
},
),
);
}
typedef $$PerformanceRunsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$PerformanceRunsTable,
PerformanceRun,
$$PerformanceRunsTableFilterComposer,
$$PerformanceRunsTableOrderingComposer,
$$PerformanceRunsTableAnnotationComposer,
$$PerformanceRunsTableCreateCompanionBuilder,
$$PerformanceRunsTableUpdateCompanionBuilder,
(PerformanceRun, $$PerformanceRunsTableReferences),
PerformanceRun,
PrefetchHooks Function({bool rideId})
>;
class $AppDatabaseManager {
final _$AppDatabase _db;
$AppDatabaseManager(this._db);
$$RidesTableTableManager get rides =>
$$RidesTableTableManager(_db, _db.rides);
$$PerformanceRunsTableTableManager get performanceRuns =>
$$PerformanceRunsTableTableManager(_db, _db.performanceRuns);
}