// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ignore_for_file: type=lint class $ProductCategoryTable extends ProductCategory with TableInfo<$ProductCategoryTable, ProductCategoryData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ProductCategoryTable(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 _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _iconMeta = const VerificationMeta('icon'); @override late final GeneratedColumn icon = GeneratedColumn( 'icon', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); @override List get $columns => [id, name, icon]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'product_category'; @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('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('icon')) { context.handle( _iconMeta, icon.isAcceptableOrUnknown(data['icon']!, _iconMeta)); } else if (isInserting) { context.missing(_iconMeta); } return context; } @override Set get $primaryKey => {id}; @override ProductCategoryData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ProductCategoryData( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, icon: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}icon'])!, ); } @override $ProductCategoryTable createAlias(String alias) { return $ProductCategoryTable(attachedDatabase, alias); } } class ProductCategoryData extends DataClass implements Insertable { final int id; final String name; final String icon; const ProductCategoryData( {required this.id, required this.name, required this.icon}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['icon'] = Variable(icon); return map; } ProductCategoryCompanion toCompanion(bool nullToAbsent) { return ProductCategoryCompanion( id: Value(id), name: Value(name), icon: Value(icon), ); } factory ProductCategoryData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return ProductCategoryData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), icon: serializer.fromJson(json['icon']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'icon': serializer.toJson(icon), }; } ProductCategoryData copyWith({int? id, String? name, String? icon}) => ProductCategoryData( id: id ?? this.id, name: name ?? this.name, icon: icon ?? this.icon, ); ProductCategoryData copyWithCompanion(ProductCategoryCompanion data) { return ProductCategoryData( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, icon: data.icon.present ? data.icon.value : this.icon, ); } @override String toString() { return (StringBuffer('ProductCategoryData(') ..write('id: $id, ') ..write('name: $name, ') ..write('icon: $icon') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, icon); @override bool operator ==(Object other) => identical(this, other) || (other is ProductCategoryData && other.id == this.id && other.name == this.name && other.icon == this.icon); } class ProductCategoryCompanion extends UpdateCompanion { final Value id; final Value name; final Value icon; const ProductCategoryCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.icon = const Value.absent(), }); ProductCategoryCompanion.insert({ this.id = const Value.absent(), required String name, required String icon, }) : name = Value(name), icon = Value(icon); static Insertable custom({ Expression? id, Expression? name, Expression? icon, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (icon != null) 'icon': icon, }); } ProductCategoryCompanion copyWith( {Value? id, Value? name, Value? icon}) { return ProductCategoryCompanion( id: id ?? this.id, name: name ?? this.name, icon: icon ?? this.icon, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (icon.present) { map['icon'] = Variable(icon.value); } return map; } @override String toString() { return (StringBuffer('ProductCategoryCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('icon: $icon') ..write(')')) .toString(); } } class $StorageLocationTable extends StorageLocation with TableInfo<$StorageLocationTable, StorageLocationData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $StorageLocationTable(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 _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _descriptionMeta = const VerificationMeta('description'); @override late final GeneratedColumn description = GeneratedColumn( 'description', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _temperatureModeMeta = const VerificationMeta('temperatureMode'); @override late final GeneratedColumn temperatureMode = GeneratedColumn( 'temperature_mode', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _iconMeta = const VerificationMeta('icon'); @override late final GeneratedColumn icon = GeneratedColumn( 'icon', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _isDefaultMeta = const VerificationMeta('isDefault'); @override late final GeneratedColumn isDefault = GeneratedColumn( 'is_default', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("is_default" IN (0, 1))'), defaultValue: const Constant(false)); @override List get $columns => [id, name, description, temperatureMode, icon, isDefault]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'storage_location'; @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('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('description')) { context.handle( _descriptionMeta, description.isAcceptableOrUnknown( data['description']!, _descriptionMeta)); } else if (isInserting) { context.missing(_descriptionMeta); } if (data.containsKey('temperature_mode')) { context.handle( _temperatureModeMeta, temperatureMode.isAcceptableOrUnknown( data['temperature_mode']!, _temperatureModeMeta)); } else if (isInserting) { context.missing(_temperatureModeMeta); } if (data.containsKey('icon')) { context.handle( _iconMeta, icon.isAcceptableOrUnknown(data['icon']!, _iconMeta)); } else if (isInserting) { context.missing(_iconMeta); } if (data.containsKey('is_default')) { context.handle(_isDefaultMeta, isDefault.isAcceptableOrUnknown(data['is_default']!, _isDefaultMeta)); } return context; } @override Set get $primaryKey => {id}; @override StorageLocationData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return StorageLocationData( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, description: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}description'])!, temperatureMode: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}temperature_mode'])!, icon: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}icon'])!, isDefault: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}is_default'])!, ); } @override $StorageLocationTable createAlias(String alias) { return $StorageLocationTable(attachedDatabase, alias); } } class StorageLocationData extends DataClass implements Insertable { final int id; final String name; final String description; final String temperatureMode; final String icon; final bool isDefault; const StorageLocationData( {required this.id, required this.name, required this.description, required this.temperatureMode, required this.icon, required this.isDefault}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['description'] = Variable(description); map['temperature_mode'] = Variable(temperatureMode); map['icon'] = Variable(icon); map['is_default'] = Variable(isDefault); return map; } StorageLocationCompanion toCompanion(bool nullToAbsent) { return StorageLocationCompanion( id: Value(id), name: Value(name), description: Value(description), temperatureMode: Value(temperatureMode), icon: Value(icon), isDefault: Value(isDefault), ); } factory StorageLocationData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return StorageLocationData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), description: serializer.fromJson(json['description']), temperatureMode: serializer.fromJson(json['temperatureMode']), icon: serializer.fromJson(json['icon']), isDefault: serializer.fromJson(json['isDefault']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'description': serializer.toJson(description), 'temperatureMode': serializer.toJson(temperatureMode), 'icon': serializer.toJson(icon), 'isDefault': serializer.toJson(isDefault), }; } StorageLocationData copyWith( {int? id, String? name, String? description, String? temperatureMode, String? icon, bool? isDefault}) => StorageLocationData( id: id ?? this.id, name: name ?? this.name, description: description ?? this.description, temperatureMode: temperatureMode ?? this.temperatureMode, icon: icon ?? this.icon, isDefault: isDefault ?? this.isDefault, ); StorageLocationData copyWithCompanion(StorageLocationCompanion data) { return StorageLocationData( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, description: data.description.present ? data.description.value : this.description, temperatureMode: data.temperatureMode.present ? data.temperatureMode.value : this.temperatureMode, icon: data.icon.present ? data.icon.value : this.icon, isDefault: data.isDefault.present ? data.isDefault.value : this.isDefault, ); } @override String toString() { return (StringBuffer('StorageLocationData(') ..write('id: $id, ') ..write('name: $name, ') ..write('description: $description, ') ..write('temperatureMode: $temperatureMode, ') ..write('icon: $icon, ') ..write('isDefault: $isDefault') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, description, temperatureMode, icon, isDefault); @override bool operator ==(Object other) => identical(this, other) || (other is StorageLocationData && other.id == this.id && other.name == this.name && other.description == this.description && other.temperatureMode == this.temperatureMode && other.icon == this.icon && other.isDefault == this.isDefault); } class StorageLocationCompanion extends UpdateCompanion { final Value id; final Value name; final Value description; final Value temperatureMode; final Value icon; final Value isDefault; const StorageLocationCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.description = const Value.absent(), this.temperatureMode = const Value.absent(), this.icon = const Value.absent(), this.isDefault = const Value.absent(), }); StorageLocationCompanion.insert({ this.id = const Value.absent(), required String name, required String description, required String temperatureMode, required String icon, this.isDefault = const Value.absent(), }) : name = Value(name), description = Value(description), temperatureMode = Value(temperatureMode), icon = Value(icon); static Insertable custom({ Expression? id, Expression? name, Expression? description, Expression? temperatureMode, Expression? icon, Expression? isDefault, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (description != null) 'description': description, if (temperatureMode != null) 'temperature_mode': temperatureMode, if (icon != null) 'icon': icon, if (isDefault != null) 'is_default': isDefault, }); } StorageLocationCompanion copyWith( {Value? id, Value? name, Value? description, Value? temperatureMode, Value? icon, Value? isDefault}) { return StorageLocationCompanion( id: id ?? this.id, name: name ?? this.name, description: description ?? this.description, temperatureMode: temperatureMode ?? this.temperatureMode, icon: icon ?? this.icon, isDefault: isDefault ?? this.isDefault, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (description.present) { map['description'] = Variable(description.value); } if (temperatureMode.present) { map['temperature_mode'] = Variable(temperatureMode.value); } if (icon.present) { map['icon'] = Variable(icon.value); } if (isDefault.present) { map['is_default'] = Variable(isDefault.value); } return map; } @override String toString() { return (StringBuffer('StorageLocationCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('description: $description, ') ..write('temperatureMode: $temperatureMode, ') ..write('icon: $icon, ') ..write('isDefault: $isDefault') ..write(')')) .toString(); } } class $ProductTable extends Product with TableInfo<$ProductTable, ProductData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ProductTable(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 _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _categoryMeta = const VerificationMeta('category'); @override late final GeneratedColumn category = GeneratedColumn( 'category', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES product_category (id)')); static const VerificationMeta _storageMeta = const VerificationMeta('storage'); @override late final GeneratedColumn storage = GeneratedColumn( 'storage', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES storage_location (id)')); static const VerificationMeta _quantityMeta = const VerificationMeta('quantity'); @override late final GeneratedColumn quantity = GeneratedColumn( 'quantity', aliasedName, false, type: DriftSqlType.double, requiredDuringInsert: true); static const VerificationMeta _unitMeta = const VerificationMeta('unit'); @override late final GeneratedColumn unit = GeneratedColumn( 'unit', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _purchaseDateMeta = const VerificationMeta('purchaseDate'); @override late final GeneratedColumn purchaseDate = GeneratedColumn( 'purchase_date', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _expiryDateMeta = const VerificationMeta('expiryDate'); @override late final GeneratedColumn expiryDate = GeneratedColumn( 'expiry_date', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false); static const VerificationMeta _barcodeMeta = const VerificationMeta('barcode'); @override late final GeneratedColumn barcode = GeneratedColumn( 'barcode', aliasedName, false, additionalChecks: GeneratedColumn.checkTextLength(maxTextLength: 20), type: DriftSqlType.string, requiredDuringInsert: true); @override List get $columns => [ id, name, category, storage, quantity, unit, purchaseDate, expiryDate, barcode ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'product'; @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('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('category')) { context.handle(_categoryMeta, category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); } else if (isInserting) { context.missing(_categoryMeta); } if (data.containsKey('storage')) { context.handle(_storageMeta, storage.isAcceptableOrUnknown(data['storage']!, _storageMeta)); } else if (isInserting) { context.missing(_storageMeta); } if (data.containsKey('quantity')) { context.handle(_quantityMeta, quantity.isAcceptableOrUnknown(data['quantity']!, _quantityMeta)); } else if (isInserting) { context.missing(_quantityMeta); } if (data.containsKey('unit')) { context.handle( _unitMeta, unit.isAcceptableOrUnknown(data['unit']!, _unitMeta)); } else if (isInserting) { context.missing(_unitMeta); } if (data.containsKey('purchase_date')) { context.handle( _purchaseDateMeta, purchaseDate.isAcceptableOrUnknown( data['purchase_date']!, _purchaseDateMeta)); } if (data.containsKey('expiry_date')) { context.handle( _expiryDateMeta, expiryDate.isAcceptableOrUnknown( data['expiry_date']!, _expiryDateMeta)); } if (data.containsKey('barcode')) { context.handle(_barcodeMeta, barcode.isAcceptableOrUnknown(data['barcode']!, _barcodeMeta)); } else if (isInserting) { context.missing(_barcodeMeta); } return context; } @override Set get $primaryKey => {id}; @override ProductData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ProductData( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, category: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}category'])!, storage: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}storage'])!, quantity: attachedDatabase.typeMapping .read(DriftSqlType.double, data['${effectivePrefix}quantity'])!, unit: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}unit'])!, purchaseDate: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}purchase_date']), expiryDate: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}expiry_date']), barcode: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}barcode'])!, ); } @override $ProductTable createAlias(String alias) { return $ProductTable(attachedDatabase, alias); } } class ProductData extends DataClass implements Insertable { final int id; final String name; final int category; final int storage; final double quantity; final String unit; final DateTime? purchaseDate; final DateTime? expiryDate; final String barcode; const ProductData( {required this.id, required this.name, required this.category, required this.storage, required this.quantity, required this.unit, this.purchaseDate, this.expiryDate, required this.barcode}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['category'] = Variable(category); map['storage'] = Variable(storage); map['quantity'] = Variable(quantity); map['unit'] = Variable(unit); if (!nullToAbsent || purchaseDate != null) { map['purchase_date'] = Variable(purchaseDate); } if (!nullToAbsent || expiryDate != null) { map['expiry_date'] = Variable(expiryDate); } map['barcode'] = Variable(barcode); return map; } ProductCompanion toCompanion(bool nullToAbsent) { return ProductCompanion( id: Value(id), name: Value(name), category: Value(category), storage: Value(storage), quantity: Value(quantity), unit: Value(unit), purchaseDate: purchaseDate == null && nullToAbsent ? const Value.absent() : Value(purchaseDate), expiryDate: expiryDate == null && nullToAbsent ? const Value.absent() : Value(expiryDate), barcode: Value(barcode), ); } factory ProductData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return ProductData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), category: serializer.fromJson(json['category']), storage: serializer.fromJson(json['storage']), quantity: serializer.fromJson(json['quantity']), unit: serializer.fromJson(json['unit']), purchaseDate: serializer.fromJson(json['purchaseDate']), expiryDate: serializer.fromJson(json['expiryDate']), barcode: serializer.fromJson(json['barcode']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'category': serializer.toJson(category), 'storage': serializer.toJson(storage), 'quantity': serializer.toJson(quantity), 'unit': serializer.toJson(unit), 'purchaseDate': serializer.toJson(purchaseDate), 'expiryDate': serializer.toJson(expiryDate), 'barcode': serializer.toJson(barcode), }; } ProductData copyWith( {int? id, String? name, int? category, int? storage, double? quantity, String? unit, Value purchaseDate = const Value.absent(), Value expiryDate = const Value.absent(), String? barcode}) => ProductData( id: id ?? this.id, name: name ?? this.name, category: category ?? this.category, storage: storage ?? this.storage, quantity: quantity ?? this.quantity, unit: unit ?? this.unit, purchaseDate: purchaseDate.present ? purchaseDate.value : this.purchaseDate, expiryDate: expiryDate.present ? expiryDate.value : this.expiryDate, barcode: barcode ?? this.barcode, ); ProductData copyWithCompanion(ProductCompanion data) { return ProductData( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, category: data.category.present ? data.category.value : this.category, storage: data.storage.present ? data.storage.value : this.storage, quantity: data.quantity.present ? data.quantity.value : this.quantity, unit: data.unit.present ? data.unit.value : this.unit, purchaseDate: data.purchaseDate.present ? data.purchaseDate.value : this.purchaseDate, expiryDate: data.expiryDate.present ? data.expiryDate.value : this.expiryDate, barcode: data.barcode.present ? data.barcode.value : this.barcode, ); } @override String toString() { return (StringBuffer('ProductData(') ..write('id: $id, ') ..write('name: $name, ') ..write('category: $category, ') ..write('storage: $storage, ') ..write('quantity: $quantity, ') ..write('unit: $unit, ') ..write('purchaseDate: $purchaseDate, ') ..write('expiryDate: $expiryDate, ') ..write('barcode: $barcode') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, category, storage, quantity, unit, purchaseDate, expiryDate, barcode); @override bool operator ==(Object other) => identical(this, other) || (other is ProductData && other.id == this.id && other.name == this.name && other.category == this.category && other.storage == this.storage && other.quantity == this.quantity && other.unit == this.unit && other.purchaseDate == this.purchaseDate && other.expiryDate == this.expiryDate && other.barcode == this.barcode); } class ProductCompanion extends UpdateCompanion { final Value id; final Value name; final Value category; final Value storage; final Value quantity; final Value unit; final Value purchaseDate; final Value expiryDate; final Value barcode; const ProductCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.category = const Value.absent(), this.storage = const Value.absent(), this.quantity = const Value.absent(), this.unit = const Value.absent(), this.purchaseDate = const Value.absent(), this.expiryDate = const Value.absent(), this.barcode = const Value.absent(), }); ProductCompanion.insert({ this.id = const Value.absent(), required String name, required int category, required int storage, required double quantity, required String unit, this.purchaseDate = const Value.absent(), this.expiryDate = const Value.absent(), required String barcode, }) : name = Value(name), category = Value(category), storage = Value(storage), quantity = Value(quantity), unit = Value(unit), barcode = Value(barcode); static Insertable custom({ Expression? id, Expression? name, Expression? category, Expression? storage, Expression? quantity, Expression? unit, Expression? purchaseDate, Expression? expiryDate, Expression? barcode, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (category != null) 'category': category, if (storage != null) 'storage': storage, if (quantity != null) 'quantity': quantity, if (unit != null) 'unit': unit, if (purchaseDate != null) 'purchase_date': purchaseDate, if (expiryDate != null) 'expiry_date': expiryDate, if (barcode != null) 'barcode': barcode, }); } ProductCompanion copyWith( {Value? id, Value? name, Value? category, Value? storage, Value? quantity, Value? unit, Value? purchaseDate, Value? expiryDate, Value? barcode}) { return ProductCompanion( id: id ?? this.id, name: name ?? this.name, category: category ?? this.category, storage: storage ?? this.storage, quantity: quantity ?? this.quantity, unit: unit ?? this.unit, purchaseDate: purchaseDate ?? this.purchaseDate, expiryDate: expiryDate ?? this.expiryDate, barcode: barcode ?? this.barcode, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (category.present) { map['category'] = Variable(category.value); } if (storage.present) { map['storage'] = Variable(storage.value); } if (quantity.present) { map['quantity'] = Variable(quantity.value); } if (unit.present) { map['unit'] = Variable(unit.value); } if (purchaseDate.present) { map['purchase_date'] = Variable(purchaseDate.value); } if (expiryDate.present) { map['expiry_date'] = Variable(expiryDate.value); } if (barcode.present) { map['barcode'] = Variable(barcode.value); } return map; } @override String toString() { return (StringBuffer('ProductCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('category: $category, ') ..write('storage: $storage, ') ..write('quantity: $quantity, ') ..write('unit: $unit, ') ..write('purchaseDate: $purchaseDate, ') ..write('expiryDate: $expiryDate, ') ..write('barcode: $barcode') ..write(')')) .toString(); } } class $ShoppingListItemTable extends ShoppingListItem with TableInfo<$ShoppingListItemTable, ShoppingListItemData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ShoppingListItemTable(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 _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _categoryMeta = const VerificationMeta('category'); @override late final GeneratedColumn category = GeneratedColumn( 'category', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES product_category (id)')); static const VerificationMeta _storageMeta = const VerificationMeta('storage'); @override late final GeneratedColumn storage = GeneratedColumn( 'storage', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES storage_location (id)')); static const VerificationMeta _quantityMeta = const VerificationMeta('quantity'); @override late final GeneratedColumn quantity = GeneratedColumn( 'quantity', aliasedName, false, type: DriftSqlType.double, requiredDuringInsert: true); static const VerificationMeta _unitMeta = const VerificationMeta('unit'); @override late final GeneratedColumn unit = GeneratedColumn( 'unit', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); static const VerificationMeta _isPurchasedMeta = const VerificationMeta('isPurchased'); @override late final GeneratedColumn isPurchased = GeneratedColumn( 'is_purchased', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("is_purchased" IN (0, 1))'), defaultValue: const Constant(false)); static const VerificationMeta _dateAddedMeta = const VerificationMeta('dateAdded'); @override late final GeneratedColumn dateAdded = GeneratedColumn( 'date_added', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime); @override List get $columns => [id, name, category, storage, quantity, unit, isPurchased, dateAdded]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'shopping_list_item'; @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('name')) { context.handle( _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('category')) { context.handle(_categoryMeta, category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); } else if (isInserting) { context.missing(_categoryMeta); } if (data.containsKey('storage')) { context.handle(_storageMeta, storage.isAcceptableOrUnknown(data['storage']!, _storageMeta)); } else if (isInserting) { context.missing(_storageMeta); } if (data.containsKey('quantity')) { context.handle(_quantityMeta, quantity.isAcceptableOrUnknown(data['quantity']!, _quantityMeta)); } else if (isInserting) { context.missing(_quantityMeta); } if (data.containsKey('unit')) { context.handle( _unitMeta, unit.isAcceptableOrUnknown(data['unit']!, _unitMeta)); } else if (isInserting) { context.missing(_unitMeta); } if (data.containsKey('is_purchased')) { context.handle( _isPurchasedMeta, isPurchased.isAcceptableOrUnknown( data['is_purchased']!, _isPurchasedMeta)); } if (data.containsKey('date_added')) { context.handle(_dateAddedMeta, dateAdded.isAcceptableOrUnknown(data['date_added']!, _dateAddedMeta)); } return context; } @override Set get $primaryKey => {id}; @override ShoppingListItemData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ShoppingListItemData( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, name: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}name'])!, category: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}category'])!, storage: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}storage'])!, quantity: attachedDatabase.typeMapping .read(DriftSqlType.double, data['${effectivePrefix}quantity'])!, unit: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}unit'])!, isPurchased: attachedDatabase.typeMapping .read(DriftSqlType.bool, data['${effectivePrefix}is_purchased'])!, dateAdded: attachedDatabase.typeMapping .read(DriftSqlType.dateTime, data['${effectivePrefix}date_added']), ); } @override $ShoppingListItemTable createAlias(String alias) { return $ShoppingListItemTable(attachedDatabase, alias); } } class ShoppingListItemData extends DataClass implements Insertable { final int id; final String name; final int category; final int storage; final double quantity; final String unit; final bool isPurchased; final DateTime? dateAdded; const ShoppingListItemData( {required this.id, required this.name, required this.category, required this.storage, required this.quantity, required this.unit, required this.isPurchased, this.dateAdded}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['category'] = Variable(category); map['storage'] = Variable(storage); map['quantity'] = Variable(quantity); map['unit'] = Variable(unit); map['is_purchased'] = Variable(isPurchased); if (!nullToAbsent || dateAdded != null) { map['date_added'] = Variable(dateAdded); } return map; } ShoppingListItemCompanion toCompanion(bool nullToAbsent) { return ShoppingListItemCompanion( id: Value(id), name: Value(name), category: Value(category), storage: Value(storage), quantity: Value(quantity), unit: Value(unit), isPurchased: Value(isPurchased), dateAdded: dateAdded == null && nullToAbsent ? const Value.absent() : Value(dateAdded), ); } factory ShoppingListItemData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return ShoppingListItemData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), category: serializer.fromJson(json['category']), storage: serializer.fromJson(json['storage']), quantity: serializer.fromJson(json['quantity']), unit: serializer.fromJson(json['unit']), isPurchased: serializer.fromJson(json['isPurchased']), dateAdded: serializer.fromJson(json['dateAdded']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'category': serializer.toJson(category), 'storage': serializer.toJson(storage), 'quantity': serializer.toJson(quantity), 'unit': serializer.toJson(unit), 'isPurchased': serializer.toJson(isPurchased), 'dateAdded': serializer.toJson(dateAdded), }; } ShoppingListItemData copyWith( {int? id, String? name, int? category, int? storage, double? quantity, String? unit, bool? isPurchased, Value dateAdded = const Value.absent()}) => ShoppingListItemData( id: id ?? this.id, name: name ?? this.name, category: category ?? this.category, storage: storage ?? this.storage, quantity: quantity ?? this.quantity, unit: unit ?? this.unit, isPurchased: isPurchased ?? this.isPurchased, dateAdded: dateAdded.present ? dateAdded.value : this.dateAdded, ); ShoppingListItemData copyWithCompanion(ShoppingListItemCompanion data) { return ShoppingListItemData( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, category: data.category.present ? data.category.value : this.category, storage: data.storage.present ? data.storage.value : this.storage, quantity: data.quantity.present ? data.quantity.value : this.quantity, unit: data.unit.present ? data.unit.value : this.unit, isPurchased: data.isPurchased.present ? data.isPurchased.value : this.isPurchased, dateAdded: data.dateAdded.present ? data.dateAdded.value : this.dateAdded, ); } @override String toString() { return (StringBuffer('ShoppingListItemData(') ..write('id: $id, ') ..write('name: $name, ') ..write('category: $category, ') ..write('storage: $storage, ') ..write('quantity: $quantity, ') ..write('unit: $unit, ') ..write('isPurchased: $isPurchased, ') ..write('dateAdded: $dateAdded') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, name, category, storage, quantity, unit, isPurchased, dateAdded); @override bool operator ==(Object other) => identical(this, other) || (other is ShoppingListItemData && other.id == this.id && other.name == this.name && other.category == this.category && other.storage == this.storage && other.quantity == this.quantity && other.unit == this.unit && other.isPurchased == this.isPurchased && other.dateAdded == this.dateAdded); } class ShoppingListItemCompanion extends UpdateCompanion { final Value id; final Value name; final Value category; final Value storage; final Value quantity; final Value unit; final Value isPurchased; final Value dateAdded; const ShoppingListItemCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.category = const Value.absent(), this.storage = const Value.absent(), this.quantity = const Value.absent(), this.unit = const Value.absent(), this.isPurchased = const Value.absent(), this.dateAdded = const Value.absent(), }); ShoppingListItemCompanion.insert({ this.id = const Value.absent(), required String name, required int category, required int storage, required double quantity, required String unit, this.isPurchased = const Value.absent(), this.dateAdded = const Value.absent(), }) : name = Value(name), category = Value(category), storage = Value(storage), quantity = Value(quantity), unit = Value(unit); static Insertable custom({ Expression? id, Expression? name, Expression? category, Expression? storage, Expression? quantity, Expression? unit, Expression? isPurchased, Expression? dateAdded, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (category != null) 'category': category, if (storage != null) 'storage': storage, if (quantity != null) 'quantity': quantity, if (unit != null) 'unit': unit, if (isPurchased != null) 'is_purchased': isPurchased, if (dateAdded != null) 'date_added': dateAdded, }); } ShoppingListItemCompanion copyWith( {Value? id, Value? name, Value? category, Value? storage, Value? quantity, Value? unit, Value? isPurchased, Value? dateAdded}) { return ShoppingListItemCompanion( id: id ?? this.id, name: name ?? this.name, category: category ?? this.category, storage: storage ?? this.storage, quantity: quantity ?? this.quantity, unit: unit ?? this.unit, isPurchased: isPurchased ?? this.isPurchased, dateAdded: dateAdded ?? this.dateAdded, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (category.present) { map['category'] = Variable(category.value); } if (storage.present) { map['storage'] = Variable(storage.value); } if (quantity.present) { map['quantity'] = Variable(quantity.value); } if (unit.present) { map['unit'] = Variable(unit.value); } if (isPurchased.present) { map['is_purchased'] = Variable(isPurchased.value); } if (dateAdded.present) { map['date_added'] = Variable(dateAdded.value); } return map; } @override String toString() { return (StringBuffer('ShoppingListItemCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('category: $category, ') ..write('storage: $storage, ') ..write('quantity: $quantity, ') ..write('unit: $unit, ') ..write('isPurchased: $isPurchased, ') ..write('dateAdded: $dateAdded') ..write(')')) .toString(); } } class $UserTable extends User with TableInfo<$UserTable, UserData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $UserTable(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 _loginMeta = const VerificationMeta('login'); @override late final GeneratedColumn login = GeneratedColumn( 'login', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE')); static const VerificationMeta _passwordMeta = const VerificationMeta('password'); @override late final GeneratedColumn password = GeneratedColumn( 'password', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true); @override List get $columns => [id, login, password]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'user'; @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('login')) { context.handle( _loginMeta, login.isAcceptableOrUnknown(data['login']!, _loginMeta)); } else if (isInserting) { context.missing(_loginMeta); } if (data.containsKey('password')) { context.handle(_passwordMeta, password.isAcceptableOrUnknown(data['password']!, _passwordMeta)); } else if (isInserting) { context.missing(_passwordMeta); } return context; } @override Set get $primaryKey => {id}; @override UserData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return UserData( id: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}id'])!, login: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}login'])!, password: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}password'])!, ); } @override $UserTable createAlias(String alias) { return $UserTable(attachedDatabase, alias); } } class UserData extends DataClass implements Insertable { final int id; final String login; final String password; const UserData( {required this.id, required this.login, required this.password}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['login'] = Variable(login); map['password'] = Variable(password); return map; } UserCompanion toCompanion(bool nullToAbsent) { return UserCompanion( id: Value(id), login: Value(login), password: Value(password), ); } factory UserData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return UserData( id: serializer.fromJson(json['id']), login: serializer.fromJson(json['login']), password: serializer.fromJson(json['password']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'login': serializer.toJson(login), 'password': serializer.toJson(password), }; } UserData copyWith({int? id, String? login, String? password}) => UserData( id: id ?? this.id, login: login ?? this.login, password: password ?? this.password, ); UserData copyWithCompanion(UserCompanion data) { return UserData( id: data.id.present ? data.id.value : this.id, login: data.login.present ? data.login.value : this.login, password: data.password.present ? data.password.value : this.password, ); } @override String toString() { return (StringBuffer('UserData(') ..write('id: $id, ') ..write('login: $login, ') ..write('password: $password') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, login, password); @override bool operator ==(Object other) => identical(this, other) || (other is UserData && other.id == this.id && other.login == this.login && other.password == this.password); } class UserCompanion extends UpdateCompanion { final Value id; final Value login; final Value password; const UserCompanion({ this.id = const Value.absent(), this.login = const Value.absent(), this.password = const Value.absent(), }); UserCompanion.insert({ this.id = const Value.absent(), required String login, required String password, }) : login = Value(login), password = Value(password); static Insertable custom({ Expression? id, Expression? login, Expression? password, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (login != null) 'login': login, if (password != null) 'password': password, }); } UserCompanion copyWith( {Value? id, Value? login, Value? password}) { return UserCompanion( id: id ?? this.id, login: login ?? this.login, password: password ?? this.password, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (login.present) { map['login'] = Variable(login.value); } if (password.present) { map['password'] = Variable(password.value); } return map; } @override String toString() { return (StringBuffer('UserCompanion(') ..write('id: $id, ') ..write('login: $login, ') ..write('password: $password') ..write(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $ProductCategoryTable productCategory = $ProductCategoryTable(this); late final $StorageLocationTable storageLocation = $StorageLocationTable(this); late final $ProductTable product = $ProductTable(this); late final $ShoppingListItemTable shoppingListItem = $ShoppingListItemTable(this); late final $UserTable user = $UserTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [productCategory, storageLocation, product, shoppingListItem, user]; } typedef $$ProductCategoryTableCreateCompanionBuilder = ProductCategoryCompanion Function({ Value id, required String name, required String icon, }); typedef $$ProductCategoryTableUpdateCompanionBuilder = ProductCategoryCompanion Function({ Value id, Value name, Value icon, }); final class $$ProductCategoryTableReferences extends BaseReferences< _$AppDatabase, $ProductCategoryTable, ProductCategoryData> { $$ProductCategoryTableReferences( super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$ProductTable, List> _productRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.product, aliasName: $_aliasNameGenerator(db.productCategory.id, db.product.category)); $$ProductTableProcessedTableManager get productRefs { final manager = $$ProductTableTableManager($_db, $_db.product) .filter((f) => f.category.id($_item.id)); final cache = $_typedResult.readTableOrNull(_productRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } static MultiTypedResultKey<$ShoppingListItemTable, List> _shoppingListItemRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(db.shoppingListItem, aliasName: $_aliasNameGenerator( db.productCategory.id, db.shoppingListItem.category)); $$ShoppingListItemTableProcessedTableManager get shoppingListItemRefs { final manager = $$ShoppingListItemTableTableManager($_db, $_db.shoppingListItem) .filter((f) => f.category.id($_item.id)); final cache = $_typedResult.readTableOrNull(_shoppingListItemRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } } class $$ProductCategoryTableFilterComposer extends Composer<_$AppDatabase, $ProductCategoryTable> { $$ProductCategoryTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnFilters(column)); Expression productRefs( Expression Function($$ProductTableFilterComposer f) f) { final $$ProductTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.product, getReferencedColumn: (t) => t.category, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductTableFilterComposer( $db: $db, $table: $db.product, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } Expression shoppingListItemRefs( Expression Function($$ShoppingListItemTableFilterComposer f) f) { final $$ShoppingListItemTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.shoppingListItem, getReferencedColumn: (t) => t.category, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ShoppingListItemTableFilterComposer( $db: $db, $table: $db.shoppingListItem, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$ProductCategoryTableOrderingComposer extends Composer<_$AppDatabase, $ProductCategoryTable> { $$ProductCategoryTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnOrderings(column)); } class $$ProductCategoryTableAnnotationComposer extends Composer<_$AppDatabase, $ProductCategoryTable> { $$ProductCategoryTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get icon => $composableBuilder(column: $table.icon, builder: (column) => column); Expression productRefs( Expression Function($$ProductTableAnnotationComposer a) f) { final $$ProductTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.product, getReferencedColumn: (t) => t.category, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductTableAnnotationComposer( $db: $db, $table: $db.product, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } Expression shoppingListItemRefs( Expression Function($$ShoppingListItemTableAnnotationComposer a) f) { final $$ShoppingListItemTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.shoppingListItem, getReferencedColumn: (t) => t.category, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ShoppingListItemTableAnnotationComposer( $db: $db, $table: $db.shoppingListItem, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$ProductCategoryTableTableManager extends RootTableManager< _$AppDatabase, $ProductCategoryTable, ProductCategoryData, $$ProductCategoryTableFilterComposer, $$ProductCategoryTableOrderingComposer, $$ProductCategoryTableAnnotationComposer, $$ProductCategoryTableCreateCompanionBuilder, $$ProductCategoryTableUpdateCompanionBuilder, (ProductCategoryData, $$ProductCategoryTableReferences), ProductCategoryData, PrefetchHooks Function({bool productRefs, bool shoppingListItemRefs})> { $$ProductCategoryTableTableManager( _$AppDatabase db, $ProductCategoryTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$ProductCategoryTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ProductCategoryTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ProductCategoryTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value icon = const Value.absent(), }) => ProductCategoryCompanion( id: id, name: name, icon: icon, ), createCompanionCallback: ({ Value id = const Value.absent(), required String name, required String icon, }) => ProductCategoryCompanion.insert( id: id, name: name, icon: icon, ), withReferenceMapper: (p0) => p0 .map((e) => ( e.readTable(table), $$ProductCategoryTableReferences(db, table, e) )) .toList(), prefetchHooksCallback: ( {productRefs = false, shoppingListItemRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (productRefs) db.product, if (shoppingListItemRefs) db.shoppingListItem ], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (productRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$ProductCategoryTableReferences ._productRefsTable(db), managerFromTypedResult: (p0) => $$ProductCategoryTableReferences(db, table, p0) .productRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.category == item.id), typedResults: items), if (shoppingListItemRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$ProductCategoryTableReferences ._shoppingListItemRefsTable(db), managerFromTypedResult: (p0) => $$ProductCategoryTableReferences(db, table, p0) .shoppingListItemRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.category == item.id), typedResults: items) ]; }, ); }, )); } typedef $$ProductCategoryTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ProductCategoryTable, ProductCategoryData, $$ProductCategoryTableFilterComposer, $$ProductCategoryTableOrderingComposer, $$ProductCategoryTableAnnotationComposer, $$ProductCategoryTableCreateCompanionBuilder, $$ProductCategoryTableUpdateCompanionBuilder, (ProductCategoryData, $$ProductCategoryTableReferences), ProductCategoryData, PrefetchHooks Function({bool productRefs, bool shoppingListItemRefs})>; typedef $$StorageLocationTableCreateCompanionBuilder = StorageLocationCompanion Function({ Value id, required String name, required String description, required String temperatureMode, required String icon, Value isDefault, }); typedef $$StorageLocationTableUpdateCompanionBuilder = StorageLocationCompanion Function({ Value id, Value name, Value description, Value temperatureMode, Value icon, Value isDefault, }); final class $$StorageLocationTableReferences extends BaseReferences< _$AppDatabase, $StorageLocationTable, StorageLocationData> { $$StorageLocationTableReferences( super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$ProductTable, List> _productRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.product, aliasName: $_aliasNameGenerator(db.storageLocation.id, db.product.storage)); $$ProductTableProcessedTableManager get productRefs { final manager = $$ProductTableTableManager($_db, $_db.product) .filter((f) => f.storage.id($_item.id)); final cache = $_typedResult.readTableOrNull(_productRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } static MultiTypedResultKey<$ShoppingListItemTable, List> _shoppingListItemRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(db.shoppingListItem, aliasName: $_aliasNameGenerator( db.storageLocation.id, db.shoppingListItem.storage)); $$ShoppingListItemTableProcessedTableManager get shoppingListItemRefs { final manager = $$ShoppingListItemTableTableManager($_db, $_db.shoppingListItem) .filter((f) => f.storage.id($_item.id)); final cache = $_typedResult.readTableOrNull(_shoppingListItemRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } } class $$StorageLocationTableFilterComposer extends Composer<_$AppDatabase, $StorageLocationTable> { $$StorageLocationTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get description => $composableBuilder( column: $table.description, builder: (column) => ColumnFilters(column)); ColumnFilters get temperatureMode => $composableBuilder( column: $table.temperatureMode, builder: (column) => ColumnFilters(column)); ColumnFilters get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnFilters(column)); ColumnFilters get isDefault => $composableBuilder( column: $table.isDefault, builder: (column) => ColumnFilters(column)); Expression productRefs( Expression Function($$ProductTableFilterComposer f) f) { final $$ProductTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.product, getReferencedColumn: (t) => t.storage, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductTableFilterComposer( $db: $db, $table: $db.product, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } Expression shoppingListItemRefs( Expression Function($$ShoppingListItemTableFilterComposer f) f) { final $$ShoppingListItemTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.shoppingListItem, getReferencedColumn: (t) => t.storage, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ShoppingListItemTableFilterComposer( $db: $db, $table: $db.shoppingListItem, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$StorageLocationTableOrderingComposer extends Composer<_$AppDatabase, $StorageLocationTable> { $$StorageLocationTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get description => $composableBuilder( column: $table.description, builder: (column) => ColumnOrderings(column)); ColumnOrderings get temperatureMode => $composableBuilder( column: $table.temperatureMode, builder: (column) => ColumnOrderings(column)); ColumnOrderings get icon => $composableBuilder( column: $table.icon, builder: (column) => ColumnOrderings(column)); ColumnOrderings get isDefault => $composableBuilder( column: $table.isDefault, builder: (column) => ColumnOrderings(column)); } class $$StorageLocationTableAnnotationComposer extends Composer<_$AppDatabase, $StorageLocationTable> { $$StorageLocationTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get description => $composableBuilder( column: $table.description, builder: (column) => column); GeneratedColumn get temperatureMode => $composableBuilder( column: $table.temperatureMode, builder: (column) => column); GeneratedColumn get icon => $composableBuilder(column: $table.icon, builder: (column) => column); GeneratedColumn get isDefault => $composableBuilder(column: $table.isDefault, builder: (column) => column); Expression productRefs( Expression Function($$ProductTableAnnotationComposer a) f) { final $$ProductTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.product, getReferencedColumn: (t) => t.storage, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductTableAnnotationComposer( $db: $db, $table: $db.product, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } Expression shoppingListItemRefs( Expression Function($$ShoppingListItemTableAnnotationComposer a) f) { final $$ShoppingListItemTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.shoppingListItem, getReferencedColumn: (t) => t.storage, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ShoppingListItemTableAnnotationComposer( $db: $db, $table: $db.shoppingListItem, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $$StorageLocationTableTableManager extends RootTableManager< _$AppDatabase, $StorageLocationTable, StorageLocationData, $$StorageLocationTableFilterComposer, $$StorageLocationTableOrderingComposer, $$StorageLocationTableAnnotationComposer, $$StorageLocationTableCreateCompanionBuilder, $$StorageLocationTableUpdateCompanionBuilder, (StorageLocationData, $$StorageLocationTableReferences), StorageLocationData, PrefetchHooks Function({bool productRefs, bool shoppingListItemRefs})> { $$StorageLocationTableTableManager( _$AppDatabase db, $StorageLocationTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$StorageLocationTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$StorageLocationTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$StorageLocationTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value description = const Value.absent(), Value temperatureMode = const Value.absent(), Value icon = const Value.absent(), Value isDefault = const Value.absent(), }) => StorageLocationCompanion( id: id, name: name, description: description, temperatureMode: temperatureMode, icon: icon, isDefault: isDefault, ), createCompanionCallback: ({ Value id = const Value.absent(), required String name, required String description, required String temperatureMode, required String icon, Value isDefault = const Value.absent(), }) => StorageLocationCompanion.insert( id: id, name: name, description: description, temperatureMode: temperatureMode, icon: icon, isDefault: isDefault, ), withReferenceMapper: (p0) => p0 .map((e) => ( e.readTable(table), $$StorageLocationTableReferences(db, table, e) )) .toList(), prefetchHooksCallback: ( {productRefs = false, shoppingListItemRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (productRefs) db.product, if (shoppingListItemRefs) db.shoppingListItem ], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (productRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$StorageLocationTableReferences ._productRefsTable(db), managerFromTypedResult: (p0) => $$StorageLocationTableReferences(db, table, p0) .productRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.storage == item.id), typedResults: items), if (shoppingListItemRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $$StorageLocationTableReferences ._shoppingListItemRefsTable(db), managerFromTypedResult: (p0) => $$StorageLocationTableReferences(db, table, p0) .shoppingListItemRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.storage == item.id), typedResults: items) ]; }, ); }, )); } typedef $$StorageLocationTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $StorageLocationTable, StorageLocationData, $$StorageLocationTableFilterComposer, $$StorageLocationTableOrderingComposer, $$StorageLocationTableAnnotationComposer, $$StorageLocationTableCreateCompanionBuilder, $$StorageLocationTableUpdateCompanionBuilder, (StorageLocationData, $$StorageLocationTableReferences), StorageLocationData, PrefetchHooks Function({bool productRefs, bool shoppingListItemRefs})>; typedef $$ProductTableCreateCompanionBuilder = ProductCompanion Function({ Value id, required String name, required int category, required int storage, required double quantity, required String unit, Value purchaseDate, Value expiryDate, required String barcode, }); typedef $$ProductTableUpdateCompanionBuilder = ProductCompanion Function({ Value id, Value name, Value category, Value storage, Value quantity, Value unit, Value purchaseDate, Value expiryDate, Value barcode, }); final class $$ProductTableReferences extends BaseReferences<_$AppDatabase, $ProductTable, ProductData> { $$ProductTableReferences(super.$_db, super.$_table, super.$_typedResult); static $ProductCategoryTable _categoryTable(_$AppDatabase db) => db.productCategory.createAlias( $_aliasNameGenerator(db.product.category, db.productCategory.id)); $$ProductCategoryTableProcessedTableManager get category { final manager = $$ProductCategoryTableTableManager($_db, $_db.productCategory) .filter((f) => f.id($_item.category!)); final item = $_typedResult.readTableOrNull(_categoryTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } static $StorageLocationTable _storageTable(_$AppDatabase db) => db.storageLocation.createAlias( $_aliasNameGenerator(db.product.storage, db.storageLocation.id)); $$StorageLocationTableProcessedTableManager get storage { final manager = $$StorageLocationTableTableManager($_db, $_db.storageLocation) .filter((f) => f.id($_item.storage!)); final item = $_typedResult.readTableOrNull(_storageTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } } class $$ProductTableFilterComposer extends Composer<_$AppDatabase, $ProductTable> { $$ProductTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnFilters(column)); ColumnFilters get unit => $composableBuilder( column: $table.unit, builder: (column) => ColumnFilters(column)); ColumnFilters get purchaseDate => $composableBuilder( column: $table.purchaseDate, builder: (column) => ColumnFilters(column)); ColumnFilters get expiryDate => $composableBuilder( column: $table.expiryDate, builder: (column) => ColumnFilters(column)); ColumnFilters get barcode => $composableBuilder( column: $table.barcode, builder: (column) => ColumnFilters(column)); $$ProductCategoryTableFilterComposer get category { final $$ProductCategoryTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableFilterComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableFilterComposer get storage { final $$StorageLocationTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableFilterComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ProductTableOrderingComposer extends Composer<_$AppDatabase, $ProductTable> { $$ProductTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnOrderings(column)); ColumnOrderings get unit => $composableBuilder( column: $table.unit, builder: (column) => ColumnOrderings(column)); ColumnOrderings get purchaseDate => $composableBuilder( column: $table.purchaseDate, builder: (column) => ColumnOrderings(column)); ColumnOrderings get expiryDate => $composableBuilder( column: $table.expiryDate, builder: (column) => ColumnOrderings(column)); ColumnOrderings get barcode => $composableBuilder( column: $table.barcode, builder: (column) => ColumnOrderings(column)); $$ProductCategoryTableOrderingComposer get category { final $$ProductCategoryTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableOrderingComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableOrderingComposer get storage { final $$StorageLocationTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableOrderingComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ProductTableAnnotationComposer extends Composer<_$AppDatabase, $ProductTable> { $$ProductTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get quantity => $composableBuilder(column: $table.quantity, builder: (column) => column); GeneratedColumn get unit => $composableBuilder(column: $table.unit, builder: (column) => column); GeneratedColumn get purchaseDate => $composableBuilder( column: $table.purchaseDate, builder: (column) => column); GeneratedColumn get expiryDate => $composableBuilder( column: $table.expiryDate, builder: (column) => column); GeneratedColumn get barcode => $composableBuilder(column: $table.barcode, builder: (column) => column); $$ProductCategoryTableAnnotationComposer get category { final $$ProductCategoryTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableAnnotationComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableAnnotationComposer get storage { final $$StorageLocationTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableAnnotationComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ProductTableTableManager extends RootTableManager< _$AppDatabase, $ProductTable, ProductData, $$ProductTableFilterComposer, $$ProductTableOrderingComposer, $$ProductTableAnnotationComposer, $$ProductTableCreateCompanionBuilder, $$ProductTableUpdateCompanionBuilder, (ProductData, $$ProductTableReferences), ProductData, PrefetchHooks Function({bool category, bool storage})> { $$ProductTableTableManager(_$AppDatabase db, $ProductTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$ProductTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ProductTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ProductTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value category = const Value.absent(), Value storage = const Value.absent(), Value quantity = const Value.absent(), Value unit = const Value.absent(), Value purchaseDate = const Value.absent(), Value expiryDate = const Value.absent(), Value barcode = const Value.absent(), }) => ProductCompanion( id: id, name: name, category: category, storage: storage, quantity: quantity, unit: unit, purchaseDate: purchaseDate, expiryDate: expiryDate, barcode: barcode, ), createCompanionCallback: ({ Value id = const Value.absent(), required String name, required int category, required int storage, required double quantity, required String unit, Value purchaseDate = const Value.absent(), Value expiryDate = const Value.absent(), required String barcode, }) => ProductCompanion.insert( id: id, name: name, category: category, storage: storage, quantity: quantity, unit: unit, purchaseDate: purchaseDate, expiryDate: expiryDate, barcode: barcode, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $$ProductTableReferences(db, table, e))) .toList(), prefetchHooksCallback: ({category = false, storage = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic>>(state) { if (category) { state = state.withJoin( currentTable: table, currentColumn: table.category, referencedTable: $$ProductTableReferences._categoryTable(db), referencedColumn: $$ProductTableReferences._categoryTable(db).id, ) as T; } if (storage) { state = state.withJoin( currentTable: table, currentColumn: table.storage, referencedTable: $$ProductTableReferences._storageTable(db), referencedColumn: $$ProductTableReferences._storageTable(db).id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, )); } typedef $$ProductTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ProductTable, ProductData, $$ProductTableFilterComposer, $$ProductTableOrderingComposer, $$ProductTableAnnotationComposer, $$ProductTableCreateCompanionBuilder, $$ProductTableUpdateCompanionBuilder, (ProductData, $$ProductTableReferences), ProductData, PrefetchHooks Function({bool category, bool storage})>; typedef $$ShoppingListItemTableCreateCompanionBuilder = ShoppingListItemCompanion Function({ Value id, required String name, required int category, required int storage, required double quantity, required String unit, Value isPurchased, Value dateAdded, }); typedef $$ShoppingListItemTableUpdateCompanionBuilder = ShoppingListItemCompanion Function({ Value id, Value name, Value category, Value storage, Value quantity, Value unit, Value isPurchased, Value dateAdded, }); final class $$ShoppingListItemTableReferences extends BaseReferences< _$AppDatabase, $ShoppingListItemTable, ShoppingListItemData> { $$ShoppingListItemTableReferences( super.$_db, super.$_table, super.$_typedResult); static $ProductCategoryTable _categoryTable(_$AppDatabase db) => db.productCategory.createAlias($_aliasNameGenerator( db.shoppingListItem.category, db.productCategory.id)); $$ProductCategoryTableProcessedTableManager get category { final manager = $$ProductCategoryTableTableManager($_db, $_db.productCategory) .filter((f) => f.id($_item.category!)); final item = $_typedResult.readTableOrNull(_categoryTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } static $StorageLocationTable _storageTable(_$AppDatabase db) => db.storageLocation.createAlias($_aliasNameGenerator( db.shoppingListItem.storage, db.storageLocation.id)); $$StorageLocationTableProcessedTableManager get storage { final manager = $$StorageLocationTableTableManager($_db, $_db.storageLocation) .filter((f) => f.id($_item.storage!)); final item = $_typedResult.readTableOrNull(_storageTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } } class $$ShoppingListItemTableFilterComposer extends Composer<_$AppDatabase, $ShoppingListItemTable> { $$ShoppingListItemTableFilterComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnFilters get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnFilters(column)); ColumnFilters get unit => $composableBuilder( column: $table.unit, builder: (column) => ColumnFilters(column)); ColumnFilters get isPurchased => $composableBuilder( column: $table.isPurchased, builder: (column) => ColumnFilters(column)); ColumnFilters get dateAdded => $composableBuilder( column: $table.dateAdded, builder: (column) => ColumnFilters(column)); $$ProductCategoryTableFilterComposer get category { final $$ProductCategoryTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableFilterComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableFilterComposer get storage { final $$StorageLocationTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableFilterComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ShoppingListItemTableOrderingComposer extends Composer<_$AppDatabase, $ShoppingListItemTable> { $$ShoppingListItemTableOrderingComposer({ 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 name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnOrderings(column)); ColumnOrderings get unit => $composableBuilder( column: $table.unit, builder: (column) => ColumnOrderings(column)); ColumnOrderings get isPurchased => $composableBuilder( column: $table.isPurchased, builder: (column) => ColumnOrderings(column)); ColumnOrderings get dateAdded => $composableBuilder( column: $table.dateAdded, builder: (column) => ColumnOrderings(column)); $$ProductCategoryTableOrderingComposer get category { final $$ProductCategoryTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableOrderingComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableOrderingComposer get storage { final $$StorageLocationTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableOrderingComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ShoppingListItemTableAnnotationComposer extends Composer<_$AppDatabase, $ShoppingListItemTable> { $$ShoppingListItemTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumn get quantity => $composableBuilder(column: $table.quantity, builder: (column) => column); GeneratedColumn get unit => $composableBuilder(column: $table.unit, builder: (column) => column); GeneratedColumn get isPurchased => $composableBuilder( column: $table.isPurchased, builder: (column) => column); GeneratedColumn get dateAdded => $composableBuilder(column: $table.dateAdded, builder: (column) => column); $$ProductCategoryTableAnnotationComposer get category { final $$ProductCategoryTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.category, referencedTable: $db.productCategory, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$ProductCategoryTableAnnotationComposer( $db: $db, $table: $db.productCategory, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } $$StorageLocationTableAnnotationComposer get storage { final $$StorageLocationTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.storage, referencedTable: $db.storageLocation, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $$StorageLocationTableAnnotationComposer( $db: $db, $table: $db.storageLocation, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $$ShoppingListItemTableTableManager extends RootTableManager< _$AppDatabase, $ShoppingListItemTable, ShoppingListItemData, $$ShoppingListItemTableFilterComposer, $$ShoppingListItemTableOrderingComposer, $$ShoppingListItemTableAnnotationComposer, $$ShoppingListItemTableCreateCompanionBuilder, $$ShoppingListItemTableUpdateCompanionBuilder, (ShoppingListItemData, $$ShoppingListItemTableReferences), ShoppingListItemData, PrefetchHooks Function({bool category, bool storage})> { $$ShoppingListItemTableTableManager( _$AppDatabase db, $ShoppingListItemTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$ShoppingListItemTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ShoppingListItemTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ShoppingListItemTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value category = const Value.absent(), Value storage = const Value.absent(), Value quantity = const Value.absent(), Value unit = const Value.absent(), Value isPurchased = const Value.absent(), Value dateAdded = const Value.absent(), }) => ShoppingListItemCompanion( id: id, name: name, category: category, storage: storage, quantity: quantity, unit: unit, isPurchased: isPurchased, dateAdded: dateAdded, ), createCompanionCallback: ({ Value id = const Value.absent(), required String name, required int category, required int storage, required double quantity, required String unit, Value isPurchased = const Value.absent(), Value dateAdded = const Value.absent(), }) => ShoppingListItemCompanion.insert( id: id, name: name, category: category, storage: storage, quantity: quantity, unit: unit, isPurchased: isPurchased, dateAdded: dateAdded, ), withReferenceMapper: (p0) => p0 .map((e) => ( e.readTable(table), $$ShoppingListItemTableReferences(db, table, e) )) .toList(), prefetchHooksCallback: ({category = false, storage = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic>>(state) { if (category) { state = state.withJoin( currentTable: table, currentColumn: table.category, referencedTable: $$ShoppingListItemTableReferences._categoryTable(db), referencedColumn: $$ShoppingListItemTableReferences._categoryTable(db).id, ) as T; } if (storage) { state = state.withJoin( currentTable: table, currentColumn: table.storage, referencedTable: $$ShoppingListItemTableReferences._storageTable(db), referencedColumn: $$ShoppingListItemTableReferences._storageTable(db).id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, )); } typedef $$ShoppingListItemTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ShoppingListItemTable, ShoppingListItemData, $$ShoppingListItemTableFilterComposer, $$ShoppingListItemTableOrderingComposer, $$ShoppingListItemTableAnnotationComposer, $$ShoppingListItemTableCreateCompanionBuilder, $$ShoppingListItemTableUpdateCompanionBuilder, (ShoppingListItemData, $$ShoppingListItemTableReferences), ShoppingListItemData, PrefetchHooks Function({bool category, bool storage})>; typedef $$UserTableCreateCompanionBuilder = UserCompanion Function({ Value id, required String login, required String password, }); typedef $$UserTableUpdateCompanionBuilder = UserCompanion Function({ Value id, Value login, Value password, }); class $$UserTableFilterComposer extends Composer<_$AppDatabase, $UserTable> { $$UserTableFilterComposer({ 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 login => $composableBuilder( column: $table.login, builder: (column) => ColumnFilters(column)); ColumnFilters get password => $composableBuilder( column: $table.password, builder: (column) => ColumnFilters(column)); } class $$UserTableOrderingComposer extends Composer<_$AppDatabase, $UserTable> { $$UserTableOrderingComposer({ 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 login => $composableBuilder( column: $table.login, builder: (column) => ColumnOrderings(column)); ColumnOrderings get password => $composableBuilder( column: $table.password, builder: (column) => ColumnOrderings(column)); } class $$UserTableAnnotationComposer extends Composer<_$AppDatabase, $UserTable> { $$UserTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get login => $composableBuilder(column: $table.login, builder: (column) => column); GeneratedColumn get password => $composableBuilder(column: $table.password, builder: (column) => column); } class $$UserTableTableManager extends RootTableManager< _$AppDatabase, $UserTable, UserData, $$UserTableFilterComposer, $$UserTableOrderingComposer, $$UserTableAnnotationComposer, $$UserTableCreateCompanionBuilder, $$UserTableUpdateCompanionBuilder, (UserData, BaseReferences<_$AppDatabase, $UserTable, UserData>), UserData, PrefetchHooks Function()> { $$UserTableTableManager(_$AppDatabase db, $UserTable table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $$UserTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$UserTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$UserTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value login = const Value.absent(), Value password = const Value.absent(), }) => UserCompanion( id: id, login: login, password: password, ), createCompanionCallback: ({ Value id = const Value.absent(), required String login, required String password, }) => UserCompanion.insert( id: id, login: login, password: password, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $$UserTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $UserTable, UserData, $$UserTableFilterComposer, $$UserTableOrderingComposer, $$UserTableAnnotationComposer, $$UserTableCreateCompanionBuilder, $$UserTableUpdateCompanionBuilder, (UserData, BaseReferences<_$AppDatabase, $UserTable, UserData>), UserData, PrefetchHooks Function()>; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$ProductCategoryTableTableManager get productCategory => $$ProductCategoryTableTableManager(_db, _db.productCategory); $$StorageLocationTableTableManager get storageLocation => $$StorageLocationTableTableManager(_db, _db.storageLocation); $$ProductTableTableManager get product => $$ProductTableTableManager(_db, _db.product); $$ShoppingListItemTableTableManager get shoppingListItem => $$ShoppingListItemTableTableManager(_db, _db.shoppingListItem); $$UserTableTableManager get user => $$UserTableTableManager(_db, _db.user); }