511 lines
16 KiB
Dart
511 lines
16 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $WolleTable extends Wolle with TableInfo<$WolleTable, WolleData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$WolleTable(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 _manufactureMeta =
|
|
const VerificationMeta('manufacture');
|
|
@override
|
|
late final GeneratedColumn<String> manufacture = GeneratedColumn<String>(
|
|
'manufacture', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title', aliasedName, false,
|
|
type: DriftSqlType.string, requiredDuringInsert: true);
|
|
static const VerificationMeta _colorMeta = const VerificationMeta('color');
|
|
@override
|
|
late final GeneratedColumn<int> color = GeneratedColumn<int>(
|
|
'color', aliasedName, false,
|
|
type: DriftSqlType.int, requiredDuringInsert: true);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, manufacture, title, color];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'wolle';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<WolleData> 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('manufacture')) {
|
|
context.handle(
|
|
_manufactureMeta,
|
|
manufacture.isAcceptableOrUnknown(
|
|
data['manufacture']!, _manufactureMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_manufactureMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('color')) {
|
|
context.handle(
|
|
_colorMeta, color.isAcceptableOrUnknown(data['color']!, _colorMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_colorMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
WolleData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return WolleData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
manufacture: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}manufacture'])!,
|
|
title: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
|
color: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}color'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$WolleTable createAlias(String alias) {
|
|
return $WolleTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class WolleData extends DataClass implements Insertable<WolleData> {
|
|
final int id;
|
|
final String manufacture;
|
|
final String title;
|
|
final int color;
|
|
const WolleData(
|
|
{required this.id,
|
|
required this.manufacture,
|
|
required this.title,
|
|
required this.color});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['manufacture'] = Variable<String>(manufacture);
|
|
map['title'] = Variable<String>(title);
|
|
map['color'] = Variable<int>(color);
|
|
return map;
|
|
}
|
|
|
|
WolleCompanion toCompanion(bool nullToAbsent) {
|
|
return WolleCompanion(
|
|
id: Value(id),
|
|
manufacture: Value(manufacture),
|
|
title: Value(title),
|
|
color: Value(color),
|
|
);
|
|
}
|
|
|
|
factory WolleData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return WolleData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
manufacture: serializer.fromJson<String>(json['manufacture']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
color: serializer.fromJson<int>(json['color']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'manufacture': serializer.toJson<String>(manufacture),
|
|
'title': serializer.toJson<String>(title),
|
|
'color': serializer.toJson<int>(color),
|
|
};
|
|
}
|
|
|
|
WolleData copyWith(
|
|
{int? id, String? manufacture, String? title, int? color}) =>
|
|
WolleData(
|
|
id: id ?? this.id,
|
|
manufacture: manufacture ?? this.manufacture,
|
|
title: title ?? this.title,
|
|
color: color ?? this.color,
|
|
);
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WolleData(')
|
|
..write('id: $id, ')
|
|
..write('manufacture: $manufacture, ')
|
|
..write('title: $title, ')
|
|
..write('color: $color')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, manufacture, title, color);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is WolleData &&
|
|
other.id == this.id &&
|
|
other.manufacture == this.manufacture &&
|
|
other.title == this.title &&
|
|
other.color == this.color);
|
|
}
|
|
|
|
class WolleCompanion extends UpdateCompanion<WolleData> {
|
|
final Value<int> id;
|
|
final Value<String> manufacture;
|
|
final Value<String> title;
|
|
final Value<int> color;
|
|
const WolleCompanion({
|
|
this.id = const Value.absent(),
|
|
this.manufacture = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.color = const Value.absent(),
|
|
});
|
|
WolleCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String manufacture,
|
|
required String title,
|
|
required int color,
|
|
}) : manufacture = Value(manufacture),
|
|
title = Value(title),
|
|
color = Value(color);
|
|
static Insertable<WolleData> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? manufacture,
|
|
Expression<String>? title,
|
|
Expression<int>? color,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (manufacture != null) 'manufacture': manufacture,
|
|
if (title != null) 'title': title,
|
|
if (color != null) 'color': color,
|
|
});
|
|
}
|
|
|
|
WolleCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<String>? manufacture,
|
|
Value<String>? title,
|
|
Value<int>? color}) {
|
|
return WolleCompanion(
|
|
id: id ?? this.id,
|
|
manufacture: manufacture ?? this.manufacture,
|
|
title: title ?? this.title,
|
|
color: color ?? this.color,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (manufacture.present) {
|
|
map['manufacture'] = Variable<String>(manufacture.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (color.present) {
|
|
map['color'] = Variable<int>(color.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('WolleCompanion(')
|
|
..write('id: $id, ')
|
|
..write('manufacture: $manufacture, ')
|
|
..write('title: $title, ')
|
|
..write('color: $color')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $TempRangeTable extends TempRange
|
|
with TableInfo<$TempRangeTable, TempRangeData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$TempRangeTable(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 _minMeta = const VerificationMeta('min');
|
|
@override
|
|
late final GeneratedColumn<double> min = GeneratedColumn<double>(
|
|
'min', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _maxMeta = const VerificationMeta('max');
|
|
@override
|
|
late final GeneratedColumn<double> max = GeneratedColumn<double>(
|
|
'max', aliasedName, false,
|
|
type: DriftSqlType.double, requiredDuringInsert: true);
|
|
static const VerificationMeta _wolleMeta = const VerificationMeta('wolle');
|
|
@override
|
|
late final GeneratedColumn<int> wolle = GeneratedColumn<int>(
|
|
'wolle', aliasedName, false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints:
|
|
GeneratedColumn.constraintIsAlways('REFERENCES wolle (id)'));
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, min, max, wolle];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'temp_range';
|
|
@override
|
|
VerificationContext validateIntegrity(Insertable<TempRangeData> 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('min')) {
|
|
context.handle(
|
|
_minMeta, min.isAcceptableOrUnknown(data['min']!, _minMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_minMeta);
|
|
}
|
|
if (data.containsKey('max')) {
|
|
context.handle(
|
|
_maxMeta, max.isAcceptableOrUnknown(data['max']!, _maxMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_maxMeta);
|
|
}
|
|
if (data.containsKey('wolle')) {
|
|
context.handle(
|
|
_wolleMeta, wolle.isAcceptableOrUnknown(data['wolle']!, _wolleMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_wolleMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
TempRangeData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return TempRangeData(
|
|
id: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
|
min: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}min'])!,
|
|
max: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.double, data['${effectivePrefix}max'])!,
|
|
wolle: attachedDatabase.typeMapping
|
|
.read(DriftSqlType.int, data['${effectivePrefix}wolle'])!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$TempRangeTable createAlias(String alias) {
|
|
return $TempRangeTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class TempRangeData extends DataClass implements Insertable<TempRangeData> {
|
|
final int id;
|
|
final double min;
|
|
final double max;
|
|
final int wolle;
|
|
const TempRangeData(
|
|
{required this.id,
|
|
required this.min,
|
|
required this.max,
|
|
required this.wolle});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['min'] = Variable<double>(min);
|
|
map['max'] = Variable<double>(max);
|
|
map['wolle'] = Variable<int>(wolle);
|
|
return map;
|
|
}
|
|
|
|
TempRangeCompanion toCompanion(bool nullToAbsent) {
|
|
return TempRangeCompanion(
|
|
id: Value(id),
|
|
min: Value(min),
|
|
max: Value(max),
|
|
wolle: Value(wolle),
|
|
);
|
|
}
|
|
|
|
factory TempRangeData.fromJson(Map<String, dynamic> json,
|
|
{ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return TempRangeData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
min: serializer.fromJson<double>(json['min']),
|
|
max: serializer.fromJson<double>(json['max']),
|
|
wolle: serializer.fromJson<int>(json['wolle']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'min': serializer.toJson<double>(min),
|
|
'max': serializer.toJson<double>(max),
|
|
'wolle': serializer.toJson<int>(wolle),
|
|
};
|
|
}
|
|
|
|
TempRangeData copyWith({int? id, double? min, double? max, int? wolle}) =>
|
|
TempRangeData(
|
|
id: id ?? this.id,
|
|
min: min ?? this.min,
|
|
max: max ?? this.max,
|
|
wolle: wolle ?? this.wolle,
|
|
);
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TempRangeData(')
|
|
..write('id: $id, ')
|
|
..write('min: $min, ')
|
|
..write('max: $max, ')
|
|
..write('wolle: $wolle')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, min, max, wolle);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is TempRangeData &&
|
|
other.id == this.id &&
|
|
other.min == this.min &&
|
|
other.max == this.max &&
|
|
other.wolle == this.wolle);
|
|
}
|
|
|
|
class TempRangeCompanion extends UpdateCompanion<TempRangeData> {
|
|
final Value<int> id;
|
|
final Value<double> min;
|
|
final Value<double> max;
|
|
final Value<int> wolle;
|
|
const TempRangeCompanion({
|
|
this.id = const Value.absent(),
|
|
this.min = const Value.absent(),
|
|
this.max = const Value.absent(),
|
|
this.wolle = const Value.absent(),
|
|
});
|
|
TempRangeCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required double min,
|
|
required double max,
|
|
required int wolle,
|
|
}) : min = Value(min),
|
|
max = Value(max),
|
|
wolle = Value(wolle);
|
|
static Insertable<TempRangeData> custom({
|
|
Expression<int>? id,
|
|
Expression<double>? min,
|
|
Expression<double>? max,
|
|
Expression<int>? wolle,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (min != null) 'min': min,
|
|
if (max != null) 'max': max,
|
|
if (wolle != null) 'wolle': wolle,
|
|
});
|
|
}
|
|
|
|
TempRangeCompanion copyWith(
|
|
{Value<int>? id,
|
|
Value<double>? min,
|
|
Value<double>? max,
|
|
Value<int>? wolle}) {
|
|
return TempRangeCompanion(
|
|
id: id ?? this.id,
|
|
min: min ?? this.min,
|
|
max: max ?? this.max,
|
|
wolle: wolle ?? this.wolle,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (min.present) {
|
|
map['min'] = Variable<double>(min.value);
|
|
}
|
|
if (max.present) {
|
|
map['max'] = Variable<double>(max.value);
|
|
}
|
|
if (wolle.present) {
|
|
map['wolle'] = Variable<int>(wolle.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TempRangeCompanion(')
|
|
..write('id: $id, ')
|
|
..write('min: $min, ')
|
|
..write('max: $max, ')
|
|
..write('wolle: $wolle')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
late final $WolleTable wolle = $WolleTable(this);
|
|
late final $TempRangeTable tempRange = $TempRangeTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [wolle, tempRange];
|
|
}
|