// 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 id = GeneratedColumn( '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 startTime = GeneratedColumn( 'start_time', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); static const VerificationMeta _endTimeMeta = const VerificationMeta( 'endTime', ); @override late final GeneratedColumn endTime = GeneratedColumn( 'end_time', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); static const VerificationMeta _distanceMilesMeta = const VerificationMeta( 'distanceMiles', ); @override late final GeneratedColumn distanceMiles = GeneratedColumn( '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 topSpeedMph = GeneratedColumn( '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 maxLeanLeft = GeneratedColumn( '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 maxLeanRight = GeneratedColumn( '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 maxAccelG = GeneratedColumn( '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 maxBrakingG = GeneratedColumn( '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 best0to60Ms = GeneratedColumn( 'best0to60_ms', aliasedName, true, type: DriftSqlType.double, requiredDuringInsert: false, ); static const VerificationMeta _best0to100MsMeta = const VerificationMeta( 'best0to100Ms', ); @override late final GeneratedColumn best0to100Ms = GeneratedColumn( 'best0to100_ms', aliasedName, true, type: DriftSqlType.double, requiredDuringInsert: false, ); @override List 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 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 get $primaryKey => {id}; @override Ride map(Map 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 { 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 toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['start_time'] = Variable(startTime); if (!nullToAbsent || endTime != null) { map['end_time'] = Variable(endTime); } map['distance_miles'] = Variable(distanceMiles); map['top_speed_mph'] = Variable(topSpeedMph); map['max_lean_left'] = Variable(maxLeanLeft); map['max_lean_right'] = Variable(maxLeanRight); map['max_accel_g'] = Variable(maxAccelG); map['max_braking_g'] = Variable(maxBrakingG); if (!nullToAbsent || best0to60Ms != null) { map['best0to60_ms'] = Variable(best0to60Ms); } if (!nullToAbsent || best0to100Ms != null) { map['best0to100_ms'] = Variable(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 json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Ride( id: serializer.fromJson(json['id']), startTime: serializer.fromJson(json['startTime']), endTime: serializer.fromJson(json['endTime']), distanceMiles: serializer.fromJson(json['distanceMiles']), topSpeedMph: serializer.fromJson(json['topSpeedMph']), maxLeanLeft: serializer.fromJson(json['maxLeanLeft']), maxLeanRight: serializer.fromJson(json['maxLeanRight']), maxAccelG: serializer.fromJson(json['maxAccelG']), maxBrakingG: serializer.fromJson(json['maxBrakingG']), best0to60Ms: serializer.fromJson(json['best0to60Ms']), best0to100Ms: serializer.fromJson(json['best0to100Ms']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'startTime': serializer.toJson(startTime), 'endTime': serializer.toJson(endTime), 'distanceMiles': serializer.toJson(distanceMiles), 'topSpeedMph': serializer.toJson(topSpeedMph), 'maxLeanLeft': serializer.toJson(maxLeanLeft), 'maxLeanRight': serializer.toJson(maxLeanRight), 'maxAccelG': serializer.toJson(maxAccelG), 'maxBrakingG': serializer.toJson(maxBrakingG), 'best0to60Ms': serializer.toJson(best0to60Ms), 'best0to100Ms': serializer.toJson(best0to100Ms), }; } Ride copyWith({ int? id, DateTime? startTime, Value endTime = const Value.absent(), double? distanceMiles, double? topSpeedMph, double? maxLeanLeft, double? maxLeanRight, double? maxAccelG, double? maxBrakingG, Value best0to60Ms = const Value.absent(), Value 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 { final Value id; final Value startTime; final Value endTime; final Value distanceMiles; final Value topSpeedMph; final Value maxLeanLeft; final Value maxLeanRight; final Value maxAccelG; final Value maxBrakingG; final Value best0to60Ms; final Value 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 custom({ Expression? id, Expression? startTime, Expression? endTime, Expression? distanceMiles, Expression? topSpeedMph, Expression? maxLeanLeft, Expression? maxLeanRight, Expression? maxAccelG, Expression? maxBrakingG, Expression? best0to60Ms, Expression? 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? id, Value? startTime, Value? endTime, Value? distanceMiles, Value? topSpeedMph, Value? maxLeanLeft, Value? maxLeanRight, Value? maxAccelG, Value? maxBrakingG, Value? best0to60Ms, Value? 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 toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (startTime.present) { map['start_time'] = Variable(startTime.value); } if (endTime.present) { map['end_time'] = Variable(endTime.value); } if (distanceMiles.present) { map['distance_miles'] = Variable(distanceMiles.value); } if (topSpeedMph.present) { map['top_speed_mph'] = Variable(topSpeedMph.value); } if (maxLeanLeft.present) { map['max_lean_left'] = Variable(maxLeanLeft.value); } if (maxLeanRight.present) { map['max_lean_right'] = Variable(maxLeanRight.value); } if (maxAccelG.present) { map['max_accel_g'] = Variable(maxAccelG.value); } if (maxBrakingG.present) { map['max_braking_g'] = Variable(maxBrakingG.value); } if (best0to60Ms.present) { map['best0to60_ms'] = Variable(best0to60Ms.value); } if (best0to100Ms.present) { map['best0to100_ms'] = Variable(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 id = GeneratedColumn( '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 rideId = GeneratedColumn( '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 type = GeneratedColumn( 'type', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _timeMsMeta = const VerificationMeta('timeMs'); @override late final GeneratedColumn timeMs = GeneratedColumn( 'time_ms', aliasedName, false, type: DriftSqlType.double, requiredDuringInsert: true, ); static const VerificationMeta _topSpeedReachedMeta = const VerificationMeta( 'topSpeedReached', ); @override late final GeneratedColumn topSpeedReached = GeneratedColumn( 'top_speed_reached', aliasedName, false, type: DriftSqlType.double, requiredDuringInsert: true, ); static const VerificationMeta _timestampMeta = const VerificationMeta( 'timestamp', ); @override late final GeneratedColumn timestamp = GeneratedColumn( 'timestamp', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); @override List 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 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 get $primaryKey => {id}; @override PerformanceRun map(Map 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 { 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 toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || rideId != null) { map['ride_id'] = Variable(rideId); } map['type'] = Variable(type); map['time_ms'] = Variable(timeMs); map['top_speed_reached'] = Variable(topSpeedReached); map['timestamp'] = Variable(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 json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return PerformanceRun( id: serializer.fromJson(json['id']), rideId: serializer.fromJson(json['rideId']), type: serializer.fromJson(json['type']), timeMs: serializer.fromJson(json['timeMs']), topSpeedReached: serializer.fromJson(json['topSpeedReached']), timestamp: serializer.fromJson(json['timestamp']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'rideId': serializer.toJson(rideId), 'type': serializer.toJson(type), 'timeMs': serializer.toJson(timeMs), 'topSpeedReached': serializer.toJson(topSpeedReached), 'timestamp': serializer.toJson(timestamp), }; } PerformanceRun copyWith({ int? id, Value 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 { final Value id; final Value rideId; final Value type; final Value timeMs; final Value topSpeedReached; final Value 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 custom({ Expression? id, Expression? rideId, Expression? type, Expression? timeMs, Expression? topSpeedReached, Expression? 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? id, Value? rideId, Value? type, Value? timeMs, Value? topSpeedReached, Value? 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 toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (rideId.present) { map['ride_id'] = Variable(rideId.value); } if (type.present) { map['type'] = Variable(type.value); } if (timeMs.present) { map['time_ms'] = Variable(timeMs.value); } if (topSpeedReached.present) { map['top_speed_reached'] = Variable(topSpeedReached.value); } if (timestamp.present) { map['timestamp'] = Variable(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> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [rides, performanceRuns]; } typedef $$RidesTableCreateCompanionBuilder = RidesCompanion Function({ Value id, required DateTime startTime, Value endTime, Value distanceMiles, Value topSpeedMph, Value maxLeanLeft, Value maxLeanRight, Value maxAccelG, Value maxBrakingG, Value best0to60Ms, Value best0to100Ms, }); typedef $$RidesTableUpdateCompanionBuilder = RidesCompanion Function({ Value id, Value startTime, Value endTime, Value distanceMiles, Value topSpeedMph, Value maxLeanLeft, Value maxLeanRight, Value maxAccelG, Value maxBrakingG, Value best0to60Ms, Value best0to100Ms, }); final class $$RidesTableReferences extends BaseReferences<_$AppDatabase, $RidesTable, Ride> { $$RidesTableReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$PerformanceRunsTable, List> _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('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 get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get startTime => $composableBuilder( column: $table.startTime, builder: (column) => ColumnFilters(column), ); ColumnFilters get endTime => $composableBuilder( column: $table.endTime, builder: (column) => ColumnFilters(column), ); ColumnFilters get distanceMiles => $composableBuilder( column: $table.distanceMiles, builder: (column) => ColumnFilters(column), ); ColumnFilters get topSpeedMph => $composableBuilder( column: $table.topSpeedMph, builder: (column) => ColumnFilters(column), ); ColumnFilters get maxLeanLeft => $composableBuilder( column: $table.maxLeanLeft, builder: (column) => ColumnFilters(column), ); ColumnFilters get maxLeanRight => $composableBuilder( column: $table.maxLeanRight, builder: (column) => ColumnFilters(column), ); ColumnFilters get maxAccelG => $composableBuilder( column: $table.maxAccelG, builder: (column) => ColumnFilters(column), ); ColumnFilters get maxBrakingG => $composableBuilder( column: $table.maxBrakingG, builder: (column) => ColumnFilters(column), ); ColumnFilters get best0to60Ms => $composableBuilder( column: $table.best0to60Ms, builder: (column) => ColumnFilters(column), ); ColumnFilters get best0to100Ms => $composableBuilder( column: $table.best0to100Ms, builder: (column) => ColumnFilters(column), ); Expression performanceRunsRefs( Expression 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 get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get startTime => $composableBuilder( column: $table.startTime, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get endTime => $composableBuilder( column: $table.endTime, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get distanceMiles => $composableBuilder( column: $table.distanceMiles, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get topSpeedMph => $composableBuilder( column: $table.topSpeedMph, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get maxLeanLeft => $composableBuilder( column: $table.maxLeanLeft, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get maxLeanRight => $composableBuilder( column: $table.maxLeanRight, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get maxAccelG => $composableBuilder( column: $table.maxAccelG, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get maxBrakingG => $composableBuilder( column: $table.maxBrakingG, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get best0to60Ms => $composableBuilder( column: $table.best0to60Ms, builder: (column) => ColumnOrderings(column), ); ColumnOrderings 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 get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get startTime => $composableBuilder(column: $table.startTime, builder: (column) => column); GeneratedColumn get endTime => $composableBuilder(column: $table.endTime, builder: (column) => column); GeneratedColumn get distanceMiles => $composableBuilder( column: $table.distanceMiles, builder: (column) => column, ); GeneratedColumn get topSpeedMph => $composableBuilder( column: $table.topSpeedMph, builder: (column) => column, ); GeneratedColumn get maxLeanLeft => $composableBuilder( column: $table.maxLeanLeft, builder: (column) => column, ); GeneratedColumn get maxLeanRight => $composableBuilder( column: $table.maxLeanRight, builder: (column) => column, ); GeneratedColumn get maxAccelG => $composableBuilder(column: $table.maxAccelG, builder: (column) => column); GeneratedColumn get maxBrakingG => $composableBuilder( column: $table.maxBrakingG, builder: (column) => column, ); GeneratedColumn get best0to60Ms => $composableBuilder( column: $table.best0to60Ms, builder: (column) => column, ); GeneratedColumn get best0to100Ms => $composableBuilder( column: $table.best0to100Ms, builder: (column) => column, ); Expression performanceRunsRefs( Expression 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 id = const Value.absent(), Value startTime = const Value.absent(), Value endTime = const Value.absent(), Value distanceMiles = const Value.absent(), Value topSpeedMph = const Value.absent(), Value maxLeanLeft = const Value.absent(), Value maxLeanRight = const Value.absent(), Value maxAccelG = const Value.absent(), Value maxBrakingG = const Value.absent(), Value best0to60Ms = const Value.absent(), Value 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 id = const Value.absent(), required DateTime startTime, Value endTime = const Value.absent(), Value distanceMiles = const Value.absent(), Value topSpeedMph = const Value.absent(), Value maxLeanLeft = const Value.absent(), Value maxLeanRight = const Value.absent(), Value maxAccelG = const Value.absent(), Value maxBrakingG = const Value.absent(), Value best0to60Ms = const Value.absent(), Value 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 id, Value rideId, required String type, required double timeMs, required double topSpeedReached, required DateTime timestamp, }); typedef $$PerformanceRunsTableUpdateCompanionBuilder = PerformanceRunsCompanion Function({ Value id, Value rideId, Value type, Value timeMs, Value topSpeedReached, Value 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('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 get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get type => $composableBuilder( column: $table.type, builder: (column) => ColumnFilters(column), ); ColumnFilters get timeMs => $composableBuilder( column: $table.timeMs, builder: (column) => ColumnFilters(column), ); ColumnFilters get topSpeedReached => $composableBuilder( column: $table.topSpeedReached, builder: (column) => ColumnFilters(column), ); ColumnFilters 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 get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get type => $composableBuilder( column: $table.type, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get timeMs => $composableBuilder( column: $table.timeMs, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get topSpeedReached => $composableBuilder( column: $table.topSpeedReached, builder: (column) => ColumnOrderings(column), ); ColumnOrderings 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 get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get type => $composableBuilder(column: $table.type, builder: (column) => column); GeneratedColumn get timeMs => $composableBuilder(column: $table.timeMs, builder: (column) => column); GeneratedColumn get topSpeedReached => $composableBuilder( column: $table.topSpeedReached, builder: (column) => column, ); GeneratedColumn 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 id = const Value.absent(), Value rideId = const Value.absent(), Value type = const Value.absent(), Value timeMs = const Value.absent(), Value topSpeedReached = const Value.absent(), Value timestamp = const Value.absent(), }) => PerformanceRunsCompanion( id: id, rideId: rideId, type: type, timeMs: timeMs, topSpeedReached: topSpeedReached, timestamp: timestamp, ), createCompanionCallback: ({ Value id = const Value.absent(), Value 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); }