// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ignore_for_file: type=lint class $CustomersTable extends Customers with TableInfo<$CustomersTable, Customer> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $CustomersTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _displayNameMeta = const VerificationMeta( 'displayName', ); @override late final GeneratedColumn displayName = GeneratedColumn( 'display_name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _formalNameMeta = const VerificationMeta( 'formalName', ); @override late final GeneratedColumn formalName = GeneratedColumn( 'formal_name', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _addressMeta = const VerificationMeta( 'address', ); @override late final GeneratedColumn address = GeneratedColumn( 'address', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _zipCodeMeta = const VerificationMeta( 'zipCode', ); @override late final GeneratedColumn zipCode = GeneratedColumn( 'zip_code', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _departmentMeta = const VerificationMeta( 'department', ); @override late final GeneratedColumn department = GeneratedColumn( 'department', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _latitudeMeta = const VerificationMeta( 'latitude', ); @override late final GeneratedColumn latitude = GeneratedColumn( 'latitude', aliasedName, true, type: DriftSqlType.double, requiredDuringInsert: false, ); static const VerificationMeta _longitudeMeta = const VerificationMeta( 'longitude', ); @override late final GeneratedColumn longitude = GeneratedColumn( 'longitude', aliasedName, true, type: DriftSqlType.double, requiredDuringInsert: false, ); static const VerificationMeta _lastUpdatedAtMeta = const VerificationMeta( 'lastUpdatedAt', ); @override late final GeneratedColumn lastUpdatedAt = GeneratedColumn( 'last_updated_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); @override List get $columns => [ id, displayName, formalName, address, zipCode, department, latitude, longitude, lastUpdatedAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'customers'; @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)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('display_name')) { context.handle( _displayNameMeta, displayName.isAcceptableOrUnknown( data['display_name']!, _displayNameMeta, ), ); } else if (isInserting) { context.missing(_displayNameMeta); } if (data.containsKey('formal_name')) { context.handle( _formalNameMeta, formalName.isAcceptableOrUnknown(data['formal_name']!, _formalNameMeta), ); } else if (isInserting) { context.missing(_formalNameMeta); } if (data.containsKey('address')) { context.handle( _addressMeta, address.isAcceptableOrUnknown(data['address']!, _addressMeta), ); } if (data.containsKey('zip_code')) { context.handle( _zipCodeMeta, zipCode.isAcceptableOrUnknown(data['zip_code']!, _zipCodeMeta), ); } if (data.containsKey('department')) { context.handle( _departmentMeta, department.isAcceptableOrUnknown(data['department']!, _departmentMeta), ); } if (data.containsKey('latitude')) { context.handle( _latitudeMeta, latitude.isAcceptableOrUnknown(data['latitude']!, _latitudeMeta), ); } if (data.containsKey('longitude')) { context.handle( _longitudeMeta, longitude.isAcceptableOrUnknown(data['longitude']!, _longitudeMeta), ); } if (data.containsKey('last_updated_at')) { context.handle( _lastUpdatedAtMeta, lastUpdatedAt.isAcceptableOrUnknown( data['last_updated_at']!, _lastUpdatedAtMeta, ), ); } return context; } @override Set get $primaryKey => {id}; @override Customer map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Customer( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, displayName: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}display_name'], )!, formalName: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}formal_name'], )!, address: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}address'], ), zipCode: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}zip_code'], ), department: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}department'], ), latitude: attachedDatabase.typeMapping.read( DriftSqlType.double, data['${effectivePrefix}latitude'], ), longitude: attachedDatabase.typeMapping.read( DriftSqlType.double, data['${effectivePrefix}longitude'], ), lastUpdatedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}last_updated_at'], ), ); } @override $CustomersTable createAlias(String alias) { return $CustomersTable(attachedDatabase, alias); } } class Customer extends DataClass implements Insertable { final String id; final String displayName; final String formalName; final String? address; final String? zipCode; final String? department; final double? latitude; final double? longitude; final DateTime? lastUpdatedAt; const Customer({ required this.id, required this.displayName, required this.formalName, this.address, this.zipCode, this.department, this.latitude, this.longitude, this.lastUpdatedAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['display_name'] = Variable(displayName); map['formal_name'] = Variable(formalName); if (!nullToAbsent || address != null) { map['address'] = Variable(address); } if (!nullToAbsent || zipCode != null) { map['zip_code'] = Variable(zipCode); } if (!nullToAbsent || department != null) { map['department'] = Variable(department); } if (!nullToAbsent || latitude != null) { map['latitude'] = Variable(latitude); } if (!nullToAbsent || longitude != null) { map['longitude'] = Variable(longitude); } if (!nullToAbsent || lastUpdatedAt != null) { map['last_updated_at'] = Variable(lastUpdatedAt); } return map; } CustomersCompanion toCompanion(bool nullToAbsent) { return CustomersCompanion( id: Value(id), displayName: Value(displayName), formalName: Value(formalName), address: address == null && nullToAbsent ? const Value.absent() : Value(address), zipCode: zipCode == null && nullToAbsent ? const Value.absent() : Value(zipCode), department: department == null && nullToAbsent ? const Value.absent() : Value(department), latitude: latitude == null && nullToAbsent ? const Value.absent() : Value(latitude), longitude: longitude == null && nullToAbsent ? const Value.absent() : Value(longitude), lastUpdatedAt: lastUpdatedAt == null && nullToAbsent ? const Value.absent() : Value(lastUpdatedAt), ); } factory Customer.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Customer( id: serializer.fromJson(json['id']), displayName: serializer.fromJson(json['displayName']), formalName: serializer.fromJson(json['formalName']), address: serializer.fromJson(json['address']), zipCode: serializer.fromJson(json['zipCode']), department: serializer.fromJson(json['department']), latitude: serializer.fromJson(json['latitude']), longitude: serializer.fromJson(json['longitude']), lastUpdatedAt: serializer.fromJson(json['lastUpdatedAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'displayName': serializer.toJson(displayName), 'formalName': serializer.toJson(formalName), 'address': serializer.toJson(address), 'zipCode': serializer.toJson(zipCode), 'department': serializer.toJson(department), 'latitude': serializer.toJson(latitude), 'longitude': serializer.toJson(longitude), 'lastUpdatedAt': serializer.toJson(lastUpdatedAt), }; } Customer copyWith({ String? id, String? displayName, String? formalName, Value address = const Value.absent(), Value zipCode = const Value.absent(), Value department = const Value.absent(), Value latitude = const Value.absent(), Value longitude = const Value.absent(), Value lastUpdatedAt = const Value.absent(), }) => Customer( id: id ?? this.id, displayName: displayName ?? this.displayName, formalName: formalName ?? this.formalName, address: address.present ? address.value : this.address, zipCode: zipCode.present ? zipCode.value : this.zipCode, department: department.present ? department.value : this.department, latitude: latitude.present ? latitude.value : this.latitude, longitude: longitude.present ? longitude.value : this.longitude, lastUpdatedAt: lastUpdatedAt.present ? lastUpdatedAt.value : this.lastUpdatedAt, ); Customer copyWithCompanion(CustomersCompanion data) { return Customer( id: data.id.present ? data.id.value : this.id, displayName: data.displayName.present ? data.displayName.value : this.displayName, formalName: data.formalName.present ? data.formalName.value : this.formalName, address: data.address.present ? data.address.value : this.address, zipCode: data.zipCode.present ? data.zipCode.value : this.zipCode, department: data.department.present ? data.department.value : this.department, latitude: data.latitude.present ? data.latitude.value : this.latitude, longitude: data.longitude.present ? data.longitude.value : this.longitude, lastUpdatedAt: data.lastUpdatedAt.present ? data.lastUpdatedAt.value : this.lastUpdatedAt, ); } @override String toString() { return (StringBuffer('Customer(') ..write('id: $id, ') ..write('displayName: $displayName, ') ..write('formalName: $formalName, ') ..write('address: $address, ') ..write('zipCode: $zipCode, ') ..write('department: $department, ') ..write('latitude: $latitude, ') ..write('longitude: $longitude, ') ..write('lastUpdatedAt: $lastUpdatedAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, displayName, formalName, address, zipCode, department, latitude, longitude, lastUpdatedAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is Customer && other.id == this.id && other.displayName == this.displayName && other.formalName == this.formalName && other.address == this.address && other.zipCode == this.zipCode && other.department == this.department && other.latitude == this.latitude && other.longitude == this.longitude && other.lastUpdatedAt == this.lastUpdatedAt); } class CustomersCompanion extends UpdateCompanion { final Value id; final Value displayName; final Value formalName; final Value address; final Value zipCode; final Value department; final Value latitude; final Value longitude; final Value lastUpdatedAt; final Value rowid; const CustomersCompanion({ this.id = const Value.absent(), this.displayName = const Value.absent(), this.formalName = const Value.absent(), this.address = const Value.absent(), this.zipCode = const Value.absent(), this.department = const Value.absent(), this.latitude = const Value.absent(), this.longitude = const Value.absent(), this.lastUpdatedAt = const Value.absent(), this.rowid = const Value.absent(), }); CustomersCompanion.insert({ required String id, required String displayName, required String formalName, this.address = const Value.absent(), this.zipCode = const Value.absent(), this.department = const Value.absent(), this.latitude = const Value.absent(), this.longitude = const Value.absent(), this.lastUpdatedAt = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), displayName = Value(displayName), formalName = Value(formalName); static Insertable custom({ Expression? id, Expression? displayName, Expression? formalName, Expression? address, Expression? zipCode, Expression? department, Expression? latitude, Expression? longitude, Expression? lastUpdatedAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (displayName != null) 'display_name': displayName, if (formalName != null) 'formal_name': formalName, if (address != null) 'address': address, if (zipCode != null) 'zip_code': zipCode, if (department != null) 'department': department, if (latitude != null) 'latitude': latitude, if (longitude != null) 'longitude': longitude, if (lastUpdatedAt != null) 'last_updated_at': lastUpdatedAt, if (rowid != null) 'rowid': rowid, }); } CustomersCompanion copyWith({ Value? id, Value? displayName, Value? formalName, Value? address, Value? zipCode, Value? department, Value? latitude, Value? longitude, Value? lastUpdatedAt, Value? rowid, }) { return CustomersCompanion( id: id ?? this.id, displayName: displayName ?? this.displayName, formalName: formalName ?? this.formalName, address: address ?? this.address, zipCode: zipCode ?? this.zipCode, department: department ?? this.department, latitude: latitude ?? this.latitude, longitude: longitude ?? this.longitude, lastUpdatedAt: lastUpdatedAt ?? this.lastUpdatedAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (displayName.present) { map['display_name'] = Variable(displayName.value); } if (formalName.present) { map['formal_name'] = Variable(formalName.value); } if (address.present) { map['address'] = Variable(address.value); } if (zipCode.present) { map['zip_code'] = Variable(zipCode.value); } if (department.present) { map['department'] = Variable(department.value); } if (latitude.present) { map['latitude'] = Variable(latitude.value); } if (longitude.present) { map['longitude'] = Variable(longitude.value); } if (lastUpdatedAt.present) { map['last_updated_at'] = Variable(lastUpdatedAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('CustomersCompanion(') ..write('id: $id, ') ..write('displayName: $displayName, ') ..write('formalName: $formalName, ') ..write('address: $address, ') ..write('zipCode: $zipCode, ') ..write('department: $department, ') ..write('latitude: $latitude, ') ..write('longitude: $longitude, ') ..write('lastUpdatedAt: $lastUpdatedAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $ProductsTable extends Products with TableInfo<$ProductsTable, Product> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ProductsTable(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 _defaultPriceMeta = const VerificationMeta( 'defaultPrice', ); @override late final GeneratedColumn defaultPrice = GeneratedColumn( 'default_price', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); static const VerificationMeta _categoryMeta = const VerificationMeta( 'category', ); @override late final GeneratedColumn category = GeneratedColumn( 'category', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); @override List get $columns => [id, name, defaultPrice, category]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'products'; @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('default_price')) { context.handle( _defaultPriceMeta, defaultPrice.isAcceptableOrUnknown( data['default_price']!, _defaultPriceMeta, ), ); } else if (isInserting) { context.missing(_defaultPriceMeta); } if (data.containsKey('category')) { context.handle( _categoryMeta, category.isAcceptableOrUnknown(data['category']!, _categoryMeta), ); } return context; } @override Set get $primaryKey => {id}; @override Product map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Product( id: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}id'], )!, name: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}name'], )!, defaultPrice: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}default_price'], )!, category: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}category'], ), ); } @override $ProductsTable createAlias(String alias) { return $ProductsTable(attachedDatabase, alias); } } class Product extends DataClass implements Insertable { final int id; final String name; final int defaultPrice; final String? category; const Product({ required this.id, required this.name, required this.defaultPrice, this.category, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); map['default_price'] = Variable(defaultPrice); if (!nullToAbsent || category != null) { map['category'] = Variable(category); } return map; } ProductsCompanion toCompanion(bool nullToAbsent) { return ProductsCompanion( id: Value(id), name: Value(name), defaultPrice: Value(defaultPrice), category: category == null && nullToAbsent ? const Value.absent() : Value(category), ); } factory Product.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Product( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), defaultPrice: serializer.fromJson(json['defaultPrice']), category: serializer.fromJson(json['category']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'defaultPrice': serializer.toJson(defaultPrice), 'category': serializer.toJson(category), }; } Product copyWith({ int? id, String? name, int? defaultPrice, Value category = const Value.absent(), }) => Product( id: id ?? this.id, name: name ?? this.name, defaultPrice: defaultPrice ?? this.defaultPrice, category: category.present ? category.value : this.category, ); Product copyWithCompanion(ProductsCompanion data) { return Product( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, defaultPrice: data.defaultPrice.present ? data.defaultPrice.value : this.defaultPrice, category: data.category.present ? data.category.value : this.category, ); } @override String toString() { return (StringBuffer('Product(') ..write('id: $id, ') ..write('name: $name, ') ..write('defaultPrice: $defaultPrice, ') ..write('category: $category') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, defaultPrice, category); @override bool operator ==(Object other) => identical(this, other) || (other is Product && other.id == this.id && other.name == this.name && other.defaultPrice == this.defaultPrice && other.category == this.category); } class ProductsCompanion extends UpdateCompanion { final Value id; final Value name; final Value defaultPrice; final Value category; const ProductsCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.defaultPrice = const Value.absent(), this.category = const Value.absent(), }); ProductsCompanion.insert({ this.id = const Value.absent(), required String name, required int defaultPrice, this.category = const Value.absent(), }) : name = Value(name), defaultPrice = Value(defaultPrice); static Insertable custom({ Expression? id, Expression? name, Expression? defaultPrice, Expression? category, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (defaultPrice != null) 'default_price': defaultPrice, if (category != null) 'category': category, }); } ProductsCompanion copyWith({ Value? id, Value? name, Value? defaultPrice, Value? category, }) { return ProductsCompanion( id: id ?? this.id, name: name ?? this.name, defaultPrice: defaultPrice ?? this.defaultPrice, category: category ?? this.category, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (defaultPrice.present) { map['default_price'] = Variable(defaultPrice.value); } if (category.present) { map['category'] = Variable(category.value); } return map; } @override String toString() { return (StringBuffer('ProductsCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('defaultPrice: $defaultPrice, ') ..write('category: $category') ..write(')')) .toString(); } } class $InvoicesTable extends Invoices with TableInfo<$InvoicesTable, Invoice> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $InvoicesTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _customerIdMeta = const VerificationMeta( 'customerId', ); @override late final GeneratedColumn customerId = GeneratedColumn( 'customer_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES customers (id)', ), ); static const VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( 'date', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); static const VerificationMeta _typeMeta = const VerificationMeta('type'); @override late final GeneratedColumn type = GeneratedColumn( 'type', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _filePathMeta = const VerificationMeta( 'filePath', ); @override late final GeneratedColumn filePath = GeneratedColumn( 'file_path', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _notesMeta = const VerificationMeta('notes'); @override late final GeneratedColumn notes = GeneratedColumn( 'notes', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _totalAmountMeta = const VerificationMeta( 'totalAmount', ); @override late final GeneratedColumn totalAmount = GeneratedColumn( 'total_amount', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); @override List get $columns => [ id, customerId, date, type, filePath, notes, totalAmount, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'invoices'; @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)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('customer_id')) { context.handle( _customerIdMeta, customerId.isAcceptableOrUnknown(data['customer_id']!, _customerIdMeta), ); } else if (isInserting) { context.missing(_customerIdMeta); } if (data.containsKey('date')) { context.handle( _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta), ); } else if (isInserting) { context.missing(_dateMeta); } if (data.containsKey('type')) { context.handle( _typeMeta, type.isAcceptableOrUnknown(data['type']!, _typeMeta), ); } else if (isInserting) { context.missing(_typeMeta); } if (data.containsKey('file_path')) { context.handle( _filePathMeta, filePath.isAcceptableOrUnknown(data['file_path']!, _filePathMeta), ); } if (data.containsKey('notes')) { context.handle( _notesMeta, notes.isAcceptableOrUnknown(data['notes']!, _notesMeta), ); } if (data.containsKey('total_amount')) { context.handle( _totalAmountMeta, totalAmount.isAcceptableOrUnknown( data['total_amount']!, _totalAmountMeta, ), ); } else if (isInserting) { context.missing(_totalAmountMeta); } return context; } @override Set get $primaryKey => {id}; @override Invoice map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Invoice( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, customerId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}customer_id'], )!, date: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}date'], )!, type: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}type'], )!, filePath: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}file_path'], ), notes: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}notes'], ), totalAmount: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}total_amount'], )!, ); } @override $InvoicesTable createAlias(String alias) { return $InvoicesTable(attachedDatabase, alias); } } class Invoice extends DataClass implements Insertable { final String id; final String customerId; final DateTime date; final String type; final String? filePath; final String? notes; final int totalAmount; const Invoice({ required this.id, required this.customerId, required this.date, required this.type, this.filePath, this.notes, required this.totalAmount, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['customer_id'] = Variable(customerId); map['date'] = Variable(date); map['type'] = Variable(type); if (!nullToAbsent || filePath != null) { map['file_path'] = Variable(filePath); } if (!nullToAbsent || notes != null) { map['notes'] = Variable(notes); } map['total_amount'] = Variable(totalAmount); return map; } InvoicesCompanion toCompanion(bool nullToAbsent) { return InvoicesCompanion( id: Value(id), customerId: Value(customerId), date: Value(date), type: Value(type), filePath: filePath == null && nullToAbsent ? const Value.absent() : Value(filePath), notes: notes == null && nullToAbsent ? const Value.absent() : Value(notes), totalAmount: Value(totalAmount), ); } factory Invoice.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Invoice( id: serializer.fromJson(json['id']), customerId: serializer.fromJson(json['customerId']), date: serializer.fromJson(json['date']), type: serializer.fromJson(json['type']), filePath: serializer.fromJson(json['filePath']), notes: serializer.fromJson(json['notes']), totalAmount: serializer.fromJson(json['totalAmount']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'customerId': serializer.toJson(customerId), 'date': serializer.toJson(date), 'type': serializer.toJson(type), 'filePath': serializer.toJson(filePath), 'notes': serializer.toJson(notes), 'totalAmount': serializer.toJson(totalAmount), }; } Invoice copyWith({ String? id, String? customerId, DateTime? date, String? type, Value filePath = const Value.absent(), Value notes = const Value.absent(), int? totalAmount, }) => Invoice( id: id ?? this.id, customerId: customerId ?? this.customerId, date: date ?? this.date, type: type ?? this.type, filePath: filePath.present ? filePath.value : this.filePath, notes: notes.present ? notes.value : this.notes, totalAmount: totalAmount ?? this.totalAmount, ); Invoice copyWithCompanion(InvoicesCompanion data) { return Invoice( id: data.id.present ? data.id.value : this.id, customerId: data.customerId.present ? data.customerId.value : this.customerId, date: data.date.present ? data.date.value : this.date, type: data.type.present ? data.type.value : this.type, filePath: data.filePath.present ? data.filePath.value : this.filePath, notes: data.notes.present ? data.notes.value : this.notes, totalAmount: data.totalAmount.present ? data.totalAmount.value : this.totalAmount, ); } @override String toString() { return (StringBuffer('Invoice(') ..write('id: $id, ') ..write('customerId: $customerId, ') ..write('date: $date, ') ..write('type: $type, ') ..write('filePath: $filePath, ') ..write('notes: $notes, ') ..write('totalAmount: $totalAmount') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, customerId, date, type, filePath, notes, totalAmount); @override bool operator ==(Object other) => identical(this, other) || (other is Invoice && other.id == this.id && other.customerId == this.customerId && other.date == this.date && other.type == this.type && other.filePath == this.filePath && other.notes == this.notes && other.totalAmount == this.totalAmount); } class InvoicesCompanion extends UpdateCompanion { final Value id; final Value customerId; final Value date; final Value type; final Value filePath; final Value notes; final Value totalAmount; final Value rowid; const InvoicesCompanion({ this.id = const Value.absent(), this.customerId = const Value.absent(), this.date = const Value.absent(), this.type = const Value.absent(), this.filePath = const Value.absent(), this.notes = const Value.absent(), this.totalAmount = const Value.absent(), this.rowid = const Value.absent(), }); InvoicesCompanion.insert({ required String id, required String customerId, required DateTime date, required String type, this.filePath = const Value.absent(), this.notes = const Value.absent(), required int totalAmount, this.rowid = const Value.absent(), }) : id = Value(id), customerId = Value(customerId), date = Value(date), type = Value(type), totalAmount = Value(totalAmount); static Insertable custom({ Expression? id, Expression? customerId, Expression? date, Expression? type, Expression? filePath, Expression? notes, Expression? totalAmount, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (customerId != null) 'customer_id': customerId, if (date != null) 'date': date, if (type != null) 'type': type, if (filePath != null) 'file_path': filePath, if (notes != null) 'notes': notes, if (totalAmount != null) 'total_amount': totalAmount, if (rowid != null) 'rowid': rowid, }); } InvoicesCompanion copyWith({ Value? id, Value? customerId, Value? date, Value? type, Value? filePath, Value? notes, Value? totalAmount, Value? rowid, }) { return InvoicesCompanion( id: id ?? this.id, customerId: customerId ?? this.customerId, date: date ?? this.date, type: type ?? this.type, filePath: filePath ?? this.filePath, notes: notes ?? this.notes, totalAmount: totalAmount ?? this.totalAmount, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (customerId.present) { map['customer_id'] = Variable(customerId.value); } if (date.present) { map['date'] = Variable(date.value); } if (type.present) { map['type'] = Variable(type.value); } if (filePath.present) { map['file_path'] = Variable(filePath.value); } if (notes.present) { map['notes'] = Variable(notes.value); } if (totalAmount.present) { map['total_amount'] = Variable(totalAmount.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('InvoicesCompanion(') ..write('id: $id, ') ..write('customerId: $customerId, ') ..write('date: $date, ') ..write('type: $type, ') ..write('filePath: $filePath, ') ..write('notes: $notes, ') ..write('totalAmount: $totalAmount, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class $InvoiceItemsTable extends InvoiceItems with TableInfo<$InvoiceItemsTable, InvoiceItem> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $InvoiceItemsTable(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 _invoiceIdMeta = const VerificationMeta( 'invoiceId', ); @override late final GeneratedColumn invoiceId = GeneratedColumn( 'invoice_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways( 'REFERENCES invoices (id)', ), ); static const VerificationMeta _descriptionMeta = const VerificationMeta( 'description', ); @override late final GeneratedColumn description = GeneratedColumn( 'description', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _quantityMeta = const VerificationMeta( 'quantity', ); @override late final GeneratedColumn quantity = GeneratedColumn( 'quantity', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); static const VerificationMeta _unitPriceMeta = const VerificationMeta( 'unitPrice', ); @override late final GeneratedColumn unitPrice = GeneratedColumn( 'unit_price', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); @override List get $columns => [ id, invoiceId, description, quantity, unitPrice, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'invoice_items'; @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('invoice_id')) { context.handle( _invoiceIdMeta, invoiceId.isAcceptableOrUnknown(data['invoice_id']!, _invoiceIdMeta), ); } else if (isInserting) { context.missing(_invoiceIdMeta); } if (data.containsKey('description')) { context.handle( _descriptionMeta, description.isAcceptableOrUnknown( data['description']!, _descriptionMeta, ), ); } else if (isInserting) { context.missing(_descriptionMeta); } if (data.containsKey('quantity')) { context.handle( _quantityMeta, quantity.isAcceptableOrUnknown(data['quantity']!, _quantityMeta), ); } else if (isInserting) { context.missing(_quantityMeta); } if (data.containsKey('unit_price')) { context.handle( _unitPriceMeta, unitPrice.isAcceptableOrUnknown(data['unit_price']!, _unitPriceMeta), ); } else if (isInserting) { context.missing(_unitPriceMeta); } return context; } @override Set get $primaryKey => {id}; @override InvoiceItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return InvoiceItem( id: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}id'], )!, invoiceId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}invoice_id'], )!, description: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}description'], )!, quantity: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}quantity'], )!, unitPrice: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}unit_price'], )!, ); } @override $InvoiceItemsTable createAlias(String alias) { return $InvoiceItemsTable(attachedDatabase, alias); } } class InvoiceItem extends DataClass implements Insertable { final int id; final String invoiceId; final String description; final int quantity; final int unitPrice; const InvoiceItem({ required this.id, required this.invoiceId, required this.description, required this.quantity, required this.unitPrice, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['invoice_id'] = Variable(invoiceId); map['description'] = Variable(description); map['quantity'] = Variable(quantity); map['unit_price'] = Variable(unitPrice); return map; } InvoiceItemsCompanion toCompanion(bool nullToAbsent) { return InvoiceItemsCompanion( id: Value(id), invoiceId: Value(invoiceId), description: Value(description), quantity: Value(quantity), unitPrice: Value(unitPrice), ); } factory InvoiceItem.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return InvoiceItem( id: serializer.fromJson(json['id']), invoiceId: serializer.fromJson(json['invoiceId']), description: serializer.fromJson(json['description']), quantity: serializer.fromJson(json['quantity']), unitPrice: serializer.fromJson(json['unitPrice']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'invoiceId': serializer.toJson(invoiceId), 'description': serializer.toJson(description), 'quantity': serializer.toJson(quantity), 'unitPrice': serializer.toJson(unitPrice), }; } InvoiceItem copyWith({ int? id, String? invoiceId, String? description, int? quantity, int? unitPrice, }) => InvoiceItem( id: id ?? this.id, invoiceId: invoiceId ?? this.invoiceId, description: description ?? this.description, quantity: quantity ?? this.quantity, unitPrice: unitPrice ?? this.unitPrice, ); InvoiceItem copyWithCompanion(InvoiceItemsCompanion data) { return InvoiceItem( id: data.id.present ? data.id.value : this.id, invoiceId: data.invoiceId.present ? data.invoiceId.value : this.invoiceId, description: data.description.present ? data.description.value : this.description, quantity: data.quantity.present ? data.quantity.value : this.quantity, unitPrice: data.unitPrice.present ? data.unitPrice.value : this.unitPrice, ); } @override String toString() { return (StringBuffer('InvoiceItem(') ..write('id: $id, ') ..write('invoiceId: $invoiceId, ') ..write('description: $description, ') ..write('quantity: $quantity, ') ..write('unitPrice: $unitPrice') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, invoiceId, description, quantity, unitPrice); @override bool operator ==(Object other) => identical(this, other) || (other is InvoiceItem && other.id == this.id && other.invoiceId == this.invoiceId && other.description == this.description && other.quantity == this.quantity && other.unitPrice == this.unitPrice); } class InvoiceItemsCompanion extends UpdateCompanion { final Value id; final Value invoiceId; final Value description; final Value quantity; final Value unitPrice; const InvoiceItemsCompanion({ this.id = const Value.absent(), this.invoiceId = const Value.absent(), this.description = const Value.absent(), this.quantity = const Value.absent(), this.unitPrice = const Value.absent(), }); InvoiceItemsCompanion.insert({ this.id = const Value.absent(), required String invoiceId, required String description, required int quantity, required int unitPrice, }) : invoiceId = Value(invoiceId), description = Value(description), quantity = Value(quantity), unitPrice = Value(unitPrice); static Insertable custom({ Expression? id, Expression? invoiceId, Expression? description, Expression? quantity, Expression? unitPrice, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (invoiceId != null) 'invoice_id': invoiceId, if (description != null) 'description': description, if (quantity != null) 'quantity': quantity, if (unitPrice != null) 'unit_price': unitPrice, }); } InvoiceItemsCompanion copyWith({ Value? id, Value? invoiceId, Value? description, Value? quantity, Value? unitPrice, }) { return InvoiceItemsCompanion( id: id ?? this.id, invoiceId: invoiceId ?? this.invoiceId, description: description ?? this.description, quantity: quantity ?? this.quantity, unitPrice: unitPrice ?? this.unitPrice, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (invoiceId.present) { map['invoice_id'] = Variable(invoiceId.value); } if (description.present) { map['description'] = Variable(description.value); } if (quantity.present) { map['quantity'] = Variable(quantity.value); } if (unitPrice.present) { map['unit_price'] = Variable(unitPrice.value); } return map; } @override String toString() { return (StringBuffer('InvoiceItemsCompanion(') ..write('id: $id, ') ..write('invoiceId: $invoiceId, ') ..write('description: $description, ') ..write('quantity: $quantity, ') ..write('unitPrice: $unitPrice') ..write(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $CustomersTable customers = $CustomersTable(this); late final $ProductsTable products = $ProductsTable(this); late final $InvoicesTable invoices = $InvoicesTable(this); late final $InvoiceItemsTable invoiceItems = $InvoiceItemsTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ customers, products, invoices, invoiceItems, ]; } typedef $$CustomersTableCreateCompanionBuilder = CustomersCompanion Function({ required String id, required String displayName, required String formalName, Value address, Value zipCode, Value department, Value latitude, Value longitude, Value lastUpdatedAt, Value rowid, }); typedef $$CustomersTableUpdateCompanionBuilder = CustomersCompanion Function({ Value id, Value displayName, Value formalName, Value address, Value zipCode, Value department, Value latitude, Value longitude, Value lastUpdatedAt, Value rowid, }); final class $$CustomersTableReferences extends BaseReferences<_$AppDatabase, $CustomersTable, Customer> { $$CustomersTableReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$InvoicesTable, List> _invoicesRefsTable( _$AppDatabase db, ) => MultiTypedResultKey.fromTable( db.invoices, aliasName: $_aliasNameGenerator(db.customers.id, db.invoices.customerId), ); $$InvoicesTableProcessedTableManager get invoicesRefs { final manager = $$InvoicesTableTableManager( $_db, $_db.invoices, ).filter((f) => f.customerId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_invoicesRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$CustomersTableFilterComposer extends Composer<_$AppDatabase, $CustomersTable> { $$CustomersTableFilterComposer({ 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 displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnFilters(column), ); ColumnFilters get formalName => $composableBuilder( column: $table.formalName, builder: (column) => ColumnFilters(column), ); ColumnFilters get address => $composableBuilder( column: $table.address, builder: (column) => ColumnFilters(column), ); ColumnFilters get zipCode => $composableBuilder( column: $table.zipCode, builder: (column) => ColumnFilters(column), ); ColumnFilters get department => $composableBuilder( column: $table.department, builder: (column) => ColumnFilters(column), ); ColumnFilters get latitude => $composableBuilder( column: $table.latitude, builder: (column) => ColumnFilters(column), ); ColumnFilters get longitude => $composableBuilder( column: $table.longitude, builder: (column) => ColumnFilters(column), ); ColumnFilters get lastUpdatedAt => $composableBuilder( column: $table.lastUpdatedAt, builder: (column) => ColumnFilters(column), ); Expression invoicesRefs( Expression Function($$InvoicesTableFilterComposer f) f, ) { final $$InvoicesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.invoices, getReferencedColumn: (t) => t.customerId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoicesTableFilterComposer( $db: $db, $table: $db.invoices, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$CustomersTableOrderingComposer extends Composer<_$AppDatabase, $CustomersTable> { $$CustomersTableOrderingComposer({ 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 displayName => $composableBuilder( column: $table.displayName, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get formalName => $composableBuilder( column: $table.formalName, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get address => $composableBuilder( column: $table.address, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get zipCode => $composableBuilder( column: $table.zipCode, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get department => $composableBuilder( column: $table.department, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get latitude => $composableBuilder( column: $table.latitude, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get longitude => $composableBuilder( column: $table.longitude, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get lastUpdatedAt => $composableBuilder( column: $table.lastUpdatedAt, builder: (column) => ColumnOrderings(column), ); } class $$CustomersTableAnnotationComposer extends Composer<_$AppDatabase, $CustomersTable> { $$CustomersTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get displayName => $composableBuilder( column: $table.displayName, builder: (column) => column, ); GeneratedColumn get formalName => $composableBuilder( column: $table.formalName, builder: (column) => column, ); GeneratedColumn get address => $composableBuilder(column: $table.address, builder: (column) => column); GeneratedColumn get zipCode => $composableBuilder(column: $table.zipCode, builder: (column) => column); GeneratedColumn get department => $composableBuilder( column: $table.department, builder: (column) => column, ); GeneratedColumn get latitude => $composableBuilder(column: $table.latitude, builder: (column) => column); GeneratedColumn get longitude => $composableBuilder(column: $table.longitude, builder: (column) => column); GeneratedColumn get lastUpdatedAt => $composableBuilder( column: $table.lastUpdatedAt, builder: (column) => column, ); Expression invoicesRefs( Expression Function($$InvoicesTableAnnotationComposer a) f, ) { final $$InvoicesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.invoices, getReferencedColumn: (t) => t.customerId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoicesTableAnnotationComposer( $db: $db, $table: $db.invoices, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$CustomersTableTableManager extends RootTableManager< _$AppDatabase, $CustomersTable, Customer, $$CustomersTableFilterComposer, $$CustomersTableOrderingComposer, $$CustomersTableAnnotationComposer, $$CustomersTableCreateCompanionBuilder, $$CustomersTableUpdateCompanionBuilder, (Customer, $$CustomersTableReferences), Customer, PrefetchHooks Function({bool invoicesRefs}) > { $$CustomersTableTableManager(_$AppDatabase db, $CustomersTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$CustomersTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$CustomersTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$CustomersTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value displayName = const Value.absent(), Value formalName = const Value.absent(), Value address = const Value.absent(), Value zipCode = const Value.absent(), Value department = const Value.absent(), Value latitude = const Value.absent(), Value longitude = const Value.absent(), Value lastUpdatedAt = const Value.absent(), Value rowid = const Value.absent(), }) => CustomersCompanion( id: id, displayName: displayName, formalName: formalName, address: address, zipCode: zipCode, department: department, latitude: latitude, longitude: longitude, lastUpdatedAt: lastUpdatedAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String displayName, required String formalName, Value address = const Value.absent(), Value zipCode = const Value.absent(), Value department = const Value.absent(), Value latitude = const Value.absent(), Value longitude = const Value.absent(), Value lastUpdatedAt = const Value.absent(), Value rowid = const Value.absent(), }) => CustomersCompanion.insert( id: id, displayName: displayName, formalName: formalName, address: address, zipCode: zipCode, department: department, latitude: latitude, longitude: longitude, lastUpdatedAt: lastUpdatedAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$CustomersTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({invoicesRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (invoicesRefs) db.invoices], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (invoicesRefs) await $_getPrefetchedData< Customer, $CustomersTable, Invoice >( currentTable: table, referencedTable: $$CustomersTableReferences ._invoicesRefsTable(db), managerFromTypedResult: (p0) => $$CustomersTableReferences( db, table, p0, ).invoicesRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where((e) => e.customerId == item.id), typedResults: items, ), ]; }, ); }, ), ); } typedef $$CustomersTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $CustomersTable, Customer, $$CustomersTableFilterComposer, $$CustomersTableOrderingComposer, $$CustomersTableAnnotationComposer, $$CustomersTableCreateCompanionBuilder, $$CustomersTableUpdateCompanionBuilder, (Customer, $$CustomersTableReferences), Customer, PrefetchHooks Function({bool invoicesRefs}) >; typedef $$ProductsTableCreateCompanionBuilder = ProductsCompanion Function({ Value id, required String name, required int defaultPrice, Value category, }); typedef $$ProductsTableUpdateCompanionBuilder = ProductsCompanion Function({ Value id, Value name, Value defaultPrice, Value category, }); class $$ProductsTableFilterComposer extends Composer<_$AppDatabase, $ProductsTable> { $$ProductsTableFilterComposer({ 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 defaultPrice => $composableBuilder( column: $table.defaultPrice, builder: (column) => ColumnFilters(column), ); ColumnFilters get category => $composableBuilder( column: $table.category, builder: (column) => ColumnFilters(column), ); } class $$ProductsTableOrderingComposer extends Composer<_$AppDatabase, $ProductsTable> { $$ProductsTableOrderingComposer({ 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 defaultPrice => $composableBuilder( column: $table.defaultPrice, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get category => $composableBuilder( column: $table.category, builder: (column) => ColumnOrderings(column), ); } class $$ProductsTableAnnotationComposer extends Composer<_$AppDatabase, $ProductsTable> { $$ProductsTableAnnotationComposer({ 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 defaultPrice => $composableBuilder( column: $table.defaultPrice, builder: (column) => column, ); GeneratedColumn get category => $composableBuilder(column: $table.category, builder: (column) => column); } class $$ProductsTableTableManager extends RootTableManager< _$AppDatabase, $ProductsTable, Product, $$ProductsTableFilterComposer, $$ProductsTableOrderingComposer, $$ProductsTableAnnotationComposer, $$ProductsTableCreateCompanionBuilder, $$ProductsTableUpdateCompanionBuilder, (Product, BaseReferences<_$AppDatabase, $ProductsTable, Product>), Product, PrefetchHooks Function() > { $$ProductsTableTableManager(_$AppDatabase db, $ProductsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$ProductsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$ProductsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ProductsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value defaultPrice = const Value.absent(), Value category = const Value.absent(), }) => ProductsCompanion( id: id, name: name, defaultPrice: defaultPrice, category: category, ), createCompanionCallback: ({ Value id = const Value.absent(), required String name, required int defaultPrice, Value category = const Value.absent(), }) => ProductsCompanion.insert( id: id, name: name, defaultPrice: defaultPrice, category: category, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, ), ); } typedef $$ProductsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $ProductsTable, Product, $$ProductsTableFilterComposer, $$ProductsTableOrderingComposer, $$ProductsTableAnnotationComposer, $$ProductsTableCreateCompanionBuilder, $$ProductsTableUpdateCompanionBuilder, (Product, BaseReferences<_$AppDatabase, $ProductsTable, Product>), Product, PrefetchHooks Function() >; typedef $$InvoicesTableCreateCompanionBuilder = InvoicesCompanion Function({ required String id, required String customerId, required DateTime date, required String type, Value filePath, Value notes, required int totalAmount, Value rowid, }); typedef $$InvoicesTableUpdateCompanionBuilder = InvoicesCompanion Function({ Value id, Value customerId, Value date, Value type, Value filePath, Value notes, Value totalAmount, Value rowid, }); final class $$InvoicesTableReferences extends BaseReferences<_$AppDatabase, $InvoicesTable, Invoice> { $$InvoicesTableReferences(super.$_db, super.$_table, super.$_typedResult); static $CustomersTable _customerIdTable(_$AppDatabase db) => db.customers.createAlias( $_aliasNameGenerator(db.invoices.customerId, db.customers.id), ); $$CustomersTableProcessedTableManager get customerId { final $_column = $_itemColumn('customer_id')!; final manager = $$CustomersTableTableManager( $_db, $_db.customers, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_customerIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } static MultiTypedResultKey<$InvoiceItemsTable, List> _invoiceItemsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( db.invoiceItems, aliasName: $_aliasNameGenerator(db.invoices.id, db.invoiceItems.invoiceId), ); $$InvoiceItemsTableProcessedTableManager get invoiceItemsRefs { final manager = $$InvoiceItemsTableTableManager( $_db, $_db.invoiceItems, ).filter((f) => f.invoiceId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_invoiceItemsRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache), ); } } class $$InvoicesTableFilterComposer extends Composer<_$AppDatabase, $InvoicesTable> { $$InvoicesTableFilterComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnFilters(column), ); ColumnFilters get type => $composableBuilder( column: $table.type, builder: (column) => ColumnFilters(column), ); ColumnFilters get filePath => $composableBuilder( column: $table.filePath, builder: (column) => ColumnFilters(column), ); ColumnFilters get notes => $composableBuilder( column: $table.notes, builder: (column) => ColumnFilters(column), ); ColumnFilters get totalAmount => $composableBuilder( column: $table.totalAmount, builder: (column) => ColumnFilters(column), ); $$CustomersTableFilterComposer get customerId { final $$CustomersTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.customerId, referencedTable: $db.customers, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$CustomersTableFilterComposer( $db: $db, $table: $db.customers, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression invoiceItemsRefs( Expression Function($$InvoiceItemsTableFilterComposer f) f, ) { final $$InvoiceItemsTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.invoiceItems, getReferencedColumn: (t) => t.invoiceId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoiceItemsTableFilterComposer( $db: $db, $table: $db.invoiceItems, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$InvoicesTableOrderingComposer extends Composer<_$AppDatabase, $InvoicesTable> { $$InvoicesTableOrderingComposer({ 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 date => $composableBuilder( column: $table.date, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get type => $composableBuilder( column: $table.type, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get filePath => $composableBuilder( column: $table.filePath, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get notes => $composableBuilder( column: $table.notes, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get totalAmount => $composableBuilder( column: $table.totalAmount, builder: (column) => ColumnOrderings(column), ); $$CustomersTableOrderingComposer get customerId { final $$CustomersTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.customerId, referencedTable: $db.customers, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$CustomersTableOrderingComposer( $db: $db, $table: $db.customers, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$InvoicesTableAnnotationComposer extends Composer<_$AppDatabase, $InvoicesTable> { $$InvoicesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get date => $composableBuilder(column: $table.date, builder: (column) => column); GeneratedColumn get type => $composableBuilder(column: $table.type, builder: (column) => column); GeneratedColumn get filePath => $composableBuilder(column: $table.filePath, builder: (column) => column); GeneratedColumn get notes => $composableBuilder(column: $table.notes, builder: (column) => column); GeneratedColumn get totalAmount => $composableBuilder( column: $table.totalAmount, builder: (column) => column, ); $$CustomersTableAnnotationComposer get customerId { final $$CustomersTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.customerId, referencedTable: $db.customers, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$CustomersTableAnnotationComposer( $db: $db, $table: $db.customers, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } Expression invoiceItemsRefs( Expression Function($$InvoiceItemsTableAnnotationComposer a) f, ) { final $$InvoiceItemsTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.invoiceItems, getReferencedColumn: (t) => t.invoiceId, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoiceItemsTableAnnotationComposer( $db: $db, $table: $db.invoiceItems, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return f(composer); } } class $$InvoicesTableTableManager extends RootTableManager< _$AppDatabase, $InvoicesTable, Invoice, $$InvoicesTableFilterComposer, $$InvoicesTableOrderingComposer, $$InvoicesTableAnnotationComposer, $$InvoicesTableCreateCompanionBuilder, $$InvoicesTableUpdateCompanionBuilder, (Invoice, $$InvoicesTableReferences), Invoice, PrefetchHooks Function({bool customerId, bool invoiceItemsRefs}) > { $$InvoicesTableTableManager(_$AppDatabase db, $InvoicesTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$InvoicesTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$InvoicesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$InvoicesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value customerId = const Value.absent(), Value date = const Value.absent(), Value type = const Value.absent(), Value filePath = const Value.absent(), Value notes = const Value.absent(), Value totalAmount = const Value.absent(), Value rowid = const Value.absent(), }) => InvoicesCompanion( id: id, customerId: customerId, date: date, type: type, filePath: filePath, notes: notes, totalAmount: totalAmount, rowid: rowid, ), createCompanionCallback: ({ required String id, required String customerId, required DateTime date, required String type, Value filePath = const Value.absent(), Value notes = const Value.absent(), required int totalAmount, Value rowid = const Value.absent(), }) => InvoicesCompanion.insert( id: id, customerId: customerId, date: date, type: type, filePath: filePath, notes: notes, totalAmount: totalAmount, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$InvoicesTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({customerId = false, invoiceItemsRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (invoiceItemsRefs) db.invoiceItems, ], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (customerId) { state = state.withJoin( currentTable: table, currentColumn: table.customerId, referencedTable: $$InvoicesTableReferences ._customerIdTable(db), referencedColumn: $$InvoicesTableReferences ._customerIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return [ if (invoiceItemsRefs) await $_getPrefetchedData< Invoice, $InvoicesTable, InvoiceItem >( currentTable: table, referencedTable: $$InvoicesTableReferences ._invoiceItemsRefsTable(db), managerFromTypedResult: (p0) => $$InvoicesTableReferences( db, table, p0, ).invoiceItemsRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems.where( (e) => e.invoiceId == item.id, ), typedResults: items, ), ]; }, ); }, ), ); } typedef $$InvoicesTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $InvoicesTable, Invoice, $$InvoicesTableFilterComposer, $$InvoicesTableOrderingComposer, $$InvoicesTableAnnotationComposer, $$InvoicesTableCreateCompanionBuilder, $$InvoicesTableUpdateCompanionBuilder, (Invoice, $$InvoicesTableReferences), Invoice, PrefetchHooks Function({bool customerId, bool invoiceItemsRefs}) >; typedef $$InvoiceItemsTableCreateCompanionBuilder = InvoiceItemsCompanion Function({ Value id, required String invoiceId, required String description, required int quantity, required int unitPrice, }); typedef $$InvoiceItemsTableUpdateCompanionBuilder = InvoiceItemsCompanion Function({ Value id, Value invoiceId, Value description, Value quantity, Value unitPrice, }); final class $$InvoiceItemsTableReferences extends BaseReferences<_$AppDatabase, $InvoiceItemsTable, InvoiceItem> { $$InvoiceItemsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $InvoicesTable _invoiceIdTable(_$AppDatabase db) => db.invoices.createAlias( $_aliasNameGenerator(db.invoiceItems.invoiceId, db.invoices.id), ); $$InvoicesTableProcessedTableManager get invoiceId { final $_column = $_itemColumn('invoice_id')!; final manager = $$InvoicesTableTableManager( $_db, $_db.invoices, ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_invoiceIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item]), ); } } class $$InvoiceItemsTableFilterComposer extends Composer<_$AppDatabase, $InvoiceItemsTable> { $$InvoiceItemsTableFilterComposer({ 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 description => $composableBuilder( column: $table.description, builder: (column) => ColumnFilters(column), ); ColumnFilters get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnFilters(column), ); ColumnFilters get unitPrice => $composableBuilder( column: $table.unitPrice, builder: (column) => ColumnFilters(column), ); $$InvoicesTableFilterComposer get invoiceId { final $$InvoicesTableFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.invoiceId, referencedTable: $db.invoices, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoicesTableFilterComposer( $db: $db, $table: $db.invoices, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$InvoiceItemsTableOrderingComposer extends Composer<_$AppDatabase, $InvoiceItemsTable> { $$InvoiceItemsTableOrderingComposer({ 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 description => $composableBuilder( column: $table.description, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get quantity => $composableBuilder( column: $table.quantity, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get unitPrice => $composableBuilder( column: $table.unitPrice, builder: (column) => ColumnOrderings(column), ); $$InvoicesTableOrderingComposer get invoiceId { final $$InvoicesTableOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.invoiceId, referencedTable: $db.invoices, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoicesTableOrderingComposer( $db: $db, $table: $db.invoices, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$InvoiceItemsTableAnnotationComposer extends Composer<_$AppDatabase, $InvoiceItemsTable> { $$InvoiceItemsTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get description => $composableBuilder( column: $table.description, builder: (column) => column, ); GeneratedColumn get quantity => $composableBuilder(column: $table.quantity, builder: (column) => column); GeneratedColumn get unitPrice => $composableBuilder(column: $table.unitPrice, builder: (column) => column); $$InvoicesTableAnnotationComposer get invoiceId { final $$InvoicesTableAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.invoiceId, referencedTable: $db.invoices, getReferencedColumn: (t) => t.id, builder: ( joinBuilder, { $addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer, }) => $$InvoicesTableAnnotationComposer( $db: $db, $table: $db.invoices, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, ), ); return composer; } } class $$InvoiceItemsTableTableManager extends RootTableManager< _$AppDatabase, $InvoiceItemsTable, InvoiceItem, $$InvoiceItemsTableFilterComposer, $$InvoiceItemsTableOrderingComposer, $$InvoiceItemsTableAnnotationComposer, $$InvoiceItemsTableCreateCompanionBuilder, $$InvoiceItemsTableUpdateCompanionBuilder, (InvoiceItem, $$InvoiceItemsTableReferences), InvoiceItem, PrefetchHooks Function({bool invoiceId}) > { $$InvoiceItemsTableTableManager(_$AppDatabase db, $InvoiceItemsTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$InvoiceItemsTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$InvoiceItemsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$InvoiceItemsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value invoiceId = const Value.absent(), Value description = const Value.absent(), Value quantity = const Value.absent(), Value unitPrice = const Value.absent(), }) => InvoiceItemsCompanion( id: id, invoiceId: invoiceId, description: description, quantity: quantity, unitPrice: unitPrice, ), createCompanionCallback: ({ Value id = const Value.absent(), required String invoiceId, required String description, required int quantity, required int unitPrice, }) => InvoiceItemsCompanion.insert( id: id, invoiceId: invoiceId, description: description, quantity: quantity, unitPrice: unitPrice, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable(table), $$InvoiceItemsTableReferences(db, table, e), ), ) .toList(), prefetchHooksCallback: ({invoiceId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic > >(state) { if (invoiceId) { state = state.withJoin( currentTable: table, currentColumn: table.invoiceId, referencedTable: $$InvoiceItemsTableReferences ._invoiceIdTable(db), referencedColumn: $$InvoiceItemsTableReferences ._invoiceIdTable(db) .id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, ), ); } typedef $$InvoiceItemsTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $InvoiceItemsTable, InvoiceItem, $$InvoiceItemsTableFilterComposer, $$InvoiceItemsTableOrderingComposer, $$InvoiceItemsTableAnnotationComposer, $$InvoiceItemsTableCreateCompanionBuilder, $$InvoiceItemsTableUpdateCompanionBuilder, (InvoiceItem, $$InvoiceItemsTableReferences), InvoiceItem, PrefetchHooks Function({bool invoiceId}) >; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$CustomersTableTableManager get customers => $$CustomersTableTableManager(_db, _db.customers); $$ProductsTableTableManager get products => $$ProductsTableTableManager(_db, _db.products); $$InvoicesTableTableManager get invoices => $$InvoicesTableTableManager(_db, _db.invoices); $$InvoiceItemsTableTableManager get invoiceItems => $$InvoiceItemsTableTableManager(_db, _db.invoiceItems); }