Files
Casha/lib/data/database/app_database.g.dart
T
2026-03-22 18:00:44 +03:00

2841 lines
87 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'app_database.dart';
// ignore_for_file: type=lint
class $TransactionsTable extends Transactions
with TableInfo<$TransactionsTable, Transaction> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$TransactionsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _amountMeta = const VerificationMeta('amount');
@override
late final GeneratedColumn<double> amount = GeneratedColumn<double>(
'amount',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: true,
);
static const VerificationMeta _categoryMeta = const VerificationMeta(
'category',
);
@override
late final GeneratedColumn<String> category = GeneratedColumn<String>(
'category',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _typeMeta = const VerificationMeta('type');
@override
late final GeneratedColumn<String> type = GeneratedColumn<String>(
'type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _dateMeta = const VerificationMeta('date');
@override
late final GeneratedColumn<DateTime> date = GeneratedColumn<DateTime>(
'date',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: true,
);
static const VerificationMeta _noteMeta = const VerificationMeta('note');
@override
late final GeneratedColumn<String> note = GeneratedColumn<String>(
'note',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _recurrenceMeta = const VerificationMeta(
'recurrence',
);
@override
late final GeneratedColumn<String> recurrence = GeneratedColumn<String>(
'recurrence',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const Constant('none'),
);
static const VerificationMeta _lastOccurrenceMeta = const VerificationMeta(
'lastOccurrence',
);
@override
late final GeneratedColumn<DateTime> lastOccurrence =
GeneratedColumn<DateTime>(
'last_occurrence',
aliasedName,
true,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
);
static const VerificationMeta _currencyMeta = const VerificationMeta(
'currency',
);
@override
late final GeneratedColumn<String> currency = GeneratedColumn<String>(
'currency',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const Constant('\$'),
);
static const VerificationMeta _currencyCodeMeta = const VerificationMeta(
'currencyCode',
);
@override
late final GeneratedColumn<String> currencyCode = GeneratedColumn<String>(
'currency_code',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const Constant('USD'),
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
'created_at',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
defaultValue: currentDateAndTime,
);
@override
List<GeneratedColumn> get $columns => [
id,
amount,
category,
type,
date,
note,
recurrence,
lastOccurrence,
currency,
currencyCode,
createdAt,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'transactions';
@override
VerificationContext validateIntegrity(
Insertable<Transaction> 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('amount')) {
context.handle(
_amountMeta,
amount.isAcceptableOrUnknown(data['amount']!, _amountMeta),
);
} else if (isInserting) {
context.missing(_amountMeta);
}
if (data.containsKey('category')) {
context.handle(
_categoryMeta,
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
);
} else if (isInserting) {
context.missing(_categoryMeta);
}
if (data.containsKey('type')) {
context.handle(
_typeMeta,
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
);
} else if (isInserting) {
context.missing(_typeMeta);
}
if (data.containsKey('date')) {
context.handle(
_dateMeta,
date.isAcceptableOrUnknown(data['date']!, _dateMeta),
);
} else if (isInserting) {
context.missing(_dateMeta);
}
if (data.containsKey('note')) {
context.handle(
_noteMeta,
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
);
}
if (data.containsKey('recurrence')) {
context.handle(
_recurrenceMeta,
recurrence.isAcceptableOrUnknown(data['recurrence']!, _recurrenceMeta),
);
}
if (data.containsKey('last_occurrence')) {
context.handle(
_lastOccurrenceMeta,
lastOccurrence.isAcceptableOrUnknown(
data['last_occurrence']!,
_lastOccurrenceMeta,
),
);
}
if (data.containsKey('currency')) {
context.handle(
_currencyMeta,
currency.isAcceptableOrUnknown(data['currency']!, _currencyMeta),
);
}
if (data.containsKey('currency_code')) {
context.handle(
_currencyCodeMeta,
currencyCode.isAcceptableOrUnknown(
data['currency_code']!,
_currencyCodeMeta,
),
);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Transaction map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Transaction(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
amount: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}amount'],
)!,
category: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}category'],
)!,
type: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}type'],
)!,
date: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}date'],
)!,
note: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}note'],
),
recurrence: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}recurrence'],
)!,
lastOccurrence: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}last_occurrence'],
),
currency: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}currency'],
)!,
currencyCode: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}currency_code'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}created_at'],
)!,
);
}
@override
$TransactionsTable createAlias(String alias) {
return $TransactionsTable(attachedDatabase, alias);
}
}
class Transaction extends DataClass implements Insertable<Transaction> {
final String id;
final double amount;
final String category;
final String type;
final DateTime date;
final String? note;
final String recurrence;
final DateTime? lastOccurrence;
final String currency;
final String currencyCode;
final DateTime createdAt;
const Transaction({
required this.id,
required this.amount,
required this.category,
required this.type,
required this.date,
this.note,
required this.recurrence,
this.lastOccurrence,
required this.currency,
required this.currencyCode,
required this.createdAt,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['amount'] = Variable<double>(amount);
map['category'] = Variable<String>(category);
map['type'] = Variable<String>(type);
map['date'] = Variable<DateTime>(date);
if (!nullToAbsent || note != null) {
map['note'] = Variable<String>(note);
}
map['recurrence'] = Variable<String>(recurrence);
if (!nullToAbsent || lastOccurrence != null) {
map['last_occurrence'] = Variable<DateTime>(lastOccurrence);
}
map['currency'] = Variable<String>(currency);
map['currency_code'] = Variable<String>(currencyCode);
map['created_at'] = Variable<DateTime>(createdAt);
return map;
}
TransactionsCompanion toCompanion(bool nullToAbsent) {
return TransactionsCompanion(
id: Value(id),
amount: Value(amount),
category: Value(category),
type: Value(type),
date: Value(date),
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
recurrence: Value(recurrence),
lastOccurrence: lastOccurrence == null && nullToAbsent
? const Value.absent()
: Value(lastOccurrence),
currency: Value(currency),
currencyCode: Value(currencyCode),
createdAt: Value(createdAt),
);
}
factory Transaction.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Transaction(
id: serializer.fromJson<String>(json['id']),
amount: serializer.fromJson<double>(json['amount']),
category: serializer.fromJson<String>(json['category']),
type: serializer.fromJson<String>(json['type']),
date: serializer.fromJson<DateTime>(json['date']),
note: serializer.fromJson<String?>(json['note']),
recurrence: serializer.fromJson<String>(json['recurrence']),
lastOccurrence: serializer.fromJson<DateTime?>(json['lastOccurrence']),
currency: serializer.fromJson<String>(json['currency']),
currencyCode: serializer.fromJson<String>(json['currencyCode']),
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'amount': serializer.toJson<double>(amount),
'category': serializer.toJson<String>(category),
'type': serializer.toJson<String>(type),
'date': serializer.toJson<DateTime>(date),
'note': serializer.toJson<String?>(note),
'recurrence': serializer.toJson<String>(recurrence),
'lastOccurrence': serializer.toJson<DateTime?>(lastOccurrence),
'currency': serializer.toJson<String>(currency),
'currencyCode': serializer.toJson<String>(currencyCode),
'createdAt': serializer.toJson<DateTime>(createdAt),
};
}
Transaction copyWith({
String? id,
double? amount,
String? category,
String? type,
DateTime? date,
Value<String?> note = const Value.absent(),
String? recurrence,
Value<DateTime?> lastOccurrence = const Value.absent(),
String? currency,
String? currencyCode,
DateTime? createdAt,
}) => Transaction(
id: id ?? this.id,
amount: amount ?? this.amount,
category: category ?? this.category,
type: type ?? this.type,
date: date ?? this.date,
note: note.present ? note.value : this.note,
recurrence: recurrence ?? this.recurrence,
lastOccurrence: lastOccurrence.present
? lastOccurrence.value
: this.lastOccurrence,
currency: currency ?? this.currency,
currencyCode: currencyCode ?? this.currencyCode,
createdAt: createdAt ?? this.createdAt,
);
Transaction copyWithCompanion(TransactionsCompanion data) {
return Transaction(
id: data.id.present ? data.id.value : this.id,
amount: data.amount.present ? data.amount.value : this.amount,
category: data.category.present ? data.category.value : this.category,
type: data.type.present ? data.type.value : this.type,
date: data.date.present ? data.date.value : this.date,
note: data.note.present ? data.note.value : this.note,
recurrence: data.recurrence.present
? data.recurrence.value
: this.recurrence,
lastOccurrence: data.lastOccurrence.present
? data.lastOccurrence.value
: this.lastOccurrence,
currency: data.currency.present ? data.currency.value : this.currency,
currencyCode: data.currencyCode.present
? data.currencyCode.value
: this.currencyCode,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
);
}
@override
String toString() {
return (StringBuffer('Transaction(')
..write('id: $id, ')
..write('amount: $amount, ')
..write('category: $category, ')
..write('type: $type, ')
..write('date: $date, ')
..write('note: $note, ')
..write('recurrence: $recurrence, ')
..write('lastOccurrence: $lastOccurrence, ')
..write('currency: $currency, ')
..write('currencyCode: $currencyCode, ')
..write('createdAt: $createdAt')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
amount,
category,
type,
date,
note,
recurrence,
lastOccurrence,
currency,
currencyCode,
createdAt,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Transaction &&
other.id == this.id &&
other.amount == this.amount &&
other.category == this.category &&
other.type == this.type &&
other.date == this.date &&
other.note == this.note &&
other.recurrence == this.recurrence &&
other.lastOccurrence == this.lastOccurrence &&
other.currency == this.currency &&
other.currencyCode == this.currencyCode &&
other.createdAt == this.createdAt);
}
class TransactionsCompanion extends UpdateCompanion<Transaction> {
final Value<String> id;
final Value<double> amount;
final Value<String> category;
final Value<String> type;
final Value<DateTime> date;
final Value<String?> note;
final Value<String> recurrence;
final Value<DateTime?> lastOccurrence;
final Value<String> currency;
final Value<String> currencyCode;
final Value<DateTime> createdAt;
final Value<int> rowid;
const TransactionsCompanion({
this.id = const Value.absent(),
this.amount = const Value.absent(),
this.category = const Value.absent(),
this.type = const Value.absent(),
this.date = const Value.absent(),
this.note = const Value.absent(),
this.recurrence = const Value.absent(),
this.lastOccurrence = const Value.absent(),
this.currency = const Value.absent(),
this.currencyCode = const Value.absent(),
this.createdAt = const Value.absent(),
this.rowid = const Value.absent(),
});
TransactionsCompanion.insert({
required String id,
required double amount,
required String category,
required String type,
required DateTime date,
this.note = const Value.absent(),
this.recurrence = const Value.absent(),
this.lastOccurrence = const Value.absent(),
this.currency = const Value.absent(),
this.currencyCode = const Value.absent(),
this.createdAt = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
amount = Value(amount),
category = Value(category),
type = Value(type),
date = Value(date);
static Insertable<Transaction> custom({
Expression<String>? id,
Expression<double>? amount,
Expression<String>? category,
Expression<String>? type,
Expression<DateTime>? date,
Expression<String>? note,
Expression<String>? recurrence,
Expression<DateTime>? lastOccurrence,
Expression<String>? currency,
Expression<String>? currencyCode,
Expression<DateTime>? createdAt,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (amount != null) 'amount': amount,
if (category != null) 'category': category,
if (type != null) 'type': type,
if (date != null) 'date': date,
if (note != null) 'note': note,
if (recurrence != null) 'recurrence': recurrence,
if (lastOccurrence != null) 'last_occurrence': lastOccurrence,
if (currency != null) 'currency': currency,
if (currencyCode != null) 'currency_code': currencyCode,
if (createdAt != null) 'created_at': createdAt,
if (rowid != null) 'rowid': rowid,
});
}
TransactionsCompanion copyWith({
Value<String>? id,
Value<double>? amount,
Value<String>? category,
Value<String>? type,
Value<DateTime>? date,
Value<String?>? note,
Value<String>? recurrence,
Value<DateTime?>? lastOccurrence,
Value<String>? currency,
Value<String>? currencyCode,
Value<DateTime>? createdAt,
Value<int>? rowid,
}) {
return TransactionsCompanion(
id: id ?? this.id,
amount: amount ?? this.amount,
category: category ?? this.category,
type: type ?? this.type,
date: date ?? this.date,
note: note ?? this.note,
recurrence: recurrence ?? this.recurrence,
lastOccurrence: lastOccurrence ?? this.lastOccurrence,
currency: currency ?? this.currency,
currencyCode: currencyCode ?? this.currencyCode,
createdAt: createdAt ?? this.createdAt,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (amount.present) {
map['amount'] = Variable<double>(amount.value);
}
if (category.present) {
map['category'] = Variable<String>(category.value);
}
if (type.present) {
map['type'] = Variable<String>(type.value);
}
if (date.present) {
map['date'] = Variable<DateTime>(date.value);
}
if (note.present) {
map['note'] = Variable<String>(note.value);
}
if (recurrence.present) {
map['recurrence'] = Variable<String>(recurrence.value);
}
if (lastOccurrence.present) {
map['last_occurrence'] = Variable<DateTime>(lastOccurrence.value);
}
if (currency.present) {
map['currency'] = Variable<String>(currency.value);
}
if (currencyCode.present) {
map['currency_code'] = Variable<String>(currencyCode.value);
}
if (createdAt.present) {
map['created_at'] = Variable<DateTime>(createdAt.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('TransactionsCompanion(')
..write('id: $id, ')
..write('amount: $amount, ')
..write('category: $category, ')
..write('type: $type, ')
..write('date: $date, ')
..write('note: $note, ')
..write('recurrence: $recurrence, ')
..write('lastOccurrence: $lastOccurrence, ')
..write('currency: $currency, ')
..write('currencyCode: $currencyCode, ')
..write('createdAt: $createdAt, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $CategoriesTable extends Categories
with TableInfo<$CategoriesTable, Category> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$CategoriesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
hasAutoIncrement: true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'PRIMARY KEY AUTOINCREMENT',
),
);
static const VerificationMeta _nameMeta = const VerificationMeta('name');
@override
late final GeneratedColumn<String> name = GeneratedColumn<String>(
'name',
aliasedName,
false,
additionalChecks: GeneratedColumn.checkTextLength(
minTextLength: 1,
maxTextLength: 50,
),
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _typeMeta = const VerificationMeta('type');
@override
late final GeneratedColumn<String> type = GeneratedColumn<String>(
'type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _iconMeta = const VerificationMeta('icon');
@override
late final GeneratedColumn<String> icon = GeneratedColumn<String>(
'icon',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _colorMeta = const VerificationMeta('color');
@override
late final GeneratedColumn<String> color = GeneratedColumn<String>(
'color',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _isDefaultMeta = const VerificationMeta(
'isDefault',
);
@override
late final GeneratedColumn<bool> isDefault = GeneratedColumn<bool>(
'is_default',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_default" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
'created_at',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
defaultValue: currentDateAndTime,
);
@override
List<GeneratedColumn> get $columns => [
id,
name,
type,
icon,
color,
isDefault,
createdAt,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'categories';
@override
VerificationContext validateIntegrity(
Insertable<Category> 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('type')) {
context.handle(
_typeMeta,
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
);
} else if (isInserting) {
context.missing(_typeMeta);
}
if (data.containsKey('icon')) {
context.handle(
_iconMeta,
icon.isAcceptableOrUnknown(data['icon']!, _iconMeta),
);
}
if (data.containsKey('color')) {
context.handle(
_colorMeta,
color.isAcceptableOrUnknown(data['color']!, _colorMeta),
);
}
if (data.containsKey('is_default')) {
context.handle(
_isDefaultMeta,
isDefault.isAcceptableOrUnknown(data['is_default']!, _isDefaultMeta),
);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Category map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Category(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
name: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name'],
)!,
type: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}type'],
)!,
icon: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}icon'],
),
color: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}color'],
),
isDefault: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_default'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}created_at'],
)!,
);
}
@override
$CategoriesTable createAlias(String alias) {
return $CategoriesTable(attachedDatabase, alias);
}
}
class Category extends DataClass implements Insertable<Category> {
final int id;
final String name;
final String type;
final String? icon;
final String? color;
final bool isDefault;
final DateTime createdAt;
const Category({
required this.id,
required this.name,
required this.type,
this.icon,
this.color,
required this.isDefault,
required this.createdAt,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<int>(id);
map['name'] = Variable<String>(name);
map['type'] = Variable<String>(type);
if (!nullToAbsent || icon != null) {
map['icon'] = Variable<String>(icon);
}
if (!nullToAbsent || color != null) {
map['color'] = Variable<String>(color);
}
map['is_default'] = Variable<bool>(isDefault);
map['created_at'] = Variable<DateTime>(createdAt);
return map;
}
CategoriesCompanion toCompanion(bool nullToAbsent) {
return CategoriesCompanion(
id: Value(id),
name: Value(name),
type: Value(type),
icon: icon == null && nullToAbsent ? const Value.absent() : Value(icon),
color: color == null && nullToAbsent
? const Value.absent()
: Value(color),
isDefault: Value(isDefault),
createdAt: Value(createdAt),
);
}
factory Category.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Category(
id: serializer.fromJson<int>(json['id']),
name: serializer.fromJson<String>(json['name']),
type: serializer.fromJson<String>(json['type']),
icon: serializer.fromJson<String?>(json['icon']),
color: serializer.fromJson<String?>(json['color']),
isDefault: serializer.fromJson<bool>(json['isDefault']),
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<int>(id),
'name': serializer.toJson<String>(name),
'type': serializer.toJson<String>(type),
'icon': serializer.toJson<String?>(icon),
'color': serializer.toJson<String?>(color),
'isDefault': serializer.toJson<bool>(isDefault),
'createdAt': serializer.toJson<DateTime>(createdAt),
};
}
Category copyWith({
int? id,
String? name,
String? type,
Value<String?> icon = const Value.absent(),
Value<String?> color = const Value.absent(),
bool? isDefault,
DateTime? createdAt,
}) => Category(
id: id ?? this.id,
name: name ?? this.name,
type: type ?? this.type,
icon: icon.present ? icon.value : this.icon,
color: color.present ? color.value : this.color,
isDefault: isDefault ?? this.isDefault,
createdAt: createdAt ?? this.createdAt,
);
Category copyWithCompanion(CategoriesCompanion data) {
return Category(
id: data.id.present ? data.id.value : this.id,
name: data.name.present ? data.name.value : this.name,
type: data.type.present ? data.type.value : this.type,
icon: data.icon.present ? data.icon.value : this.icon,
color: data.color.present ? data.color.value : this.color,
isDefault: data.isDefault.present ? data.isDefault.value : this.isDefault,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
);
}
@override
String toString() {
return (StringBuffer('Category(')
..write('id: $id, ')
..write('name: $name, ')
..write('type: $type, ')
..write('icon: $icon, ')
..write('color: $color, ')
..write('isDefault: $isDefault, ')
..write('createdAt: $createdAt')
..write(')'))
.toString();
}
@override
int get hashCode =>
Object.hash(id, name, type, icon, color, isDefault, createdAt);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Category &&
other.id == this.id &&
other.name == this.name &&
other.type == this.type &&
other.icon == this.icon &&
other.color == this.color &&
other.isDefault == this.isDefault &&
other.createdAt == this.createdAt);
}
class CategoriesCompanion extends UpdateCompanion<Category> {
final Value<int> id;
final Value<String> name;
final Value<String> type;
final Value<String?> icon;
final Value<String?> color;
final Value<bool> isDefault;
final Value<DateTime> createdAt;
const CategoriesCompanion({
this.id = const Value.absent(),
this.name = const Value.absent(),
this.type = const Value.absent(),
this.icon = const Value.absent(),
this.color = const Value.absent(),
this.isDefault = const Value.absent(),
this.createdAt = const Value.absent(),
});
CategoriesCompanion.insert({
this.id = const Value.absent(),
required String name,
required String type,
this.icon = const Value.absent(),
this.color = const Value.absent(),
this.isDefault = const Value.absent(),
this.createdAt = const Value.absent(),
}) : name = Value(name),
type = Value(type);
static Insertable<Category> custom({
Expression<int>? id,
Expression<String>? name,
Expression<String>? type,
Expression<String>? icon,
Expression<String>? color,
Expression<bool>? isDefault,
Expression<DateTime>? createdAt,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (name != null) 'name': name,
if (type != null) 'type': type,
if (icon != null) 'icon': icon,
if (color != null) 'color': color,
if (isDefault != null) 'is_default': isDefault,
if (createdAt != null) 'created_at': createdAt,
});
}
CategoriesCompanion copyWith({
Value<int>? id,
Value<String>? name,
Value<String>? type,
Value<String?>? icon,
Value<String?>? color,
Value<bool>? isDefault,
Value<DateTime>? createdAt,
}) {
return CategoriesCompanion(
id: id ?? this.id,
name: name ?? this.name,
type: type ?? this.type,
icon: icon ?? this.icon,
color: color ?? this.color,
isDefault: isDefault ?? this.isDefault,
createdAt: createdAt ?? this.createdAt,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<int>(id.value);
}
if (name.present) {
map['name'] = Variable<String>(name.value);
}
if (type.present) {
map['type'] = Variable<String>(type.value);
}
if (icon.present) {
map['icon'] = Variable<String>(icon.value);
}
if (color.present) {
map['color'] = Variable<String>(color.value);
}
if (isDefault.present) {
map['is_default'] = Variable<bool>(isDefault.value);
}
if (createdAt.present) {
map['created_at'] = Variable<DateTime>(createdAt.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('CategoriesCompanion(')
..write('id: $id, ')
..write('name: $name, ')
..write('type: $type, ')
..write('icon: $icon, ')
..write('color: $color, ')
..write('isDefault: $isDefault, ')
..write('createdAt: $createdAt')
..write(')'))
.toString();
}
}
class $BudgetsTable extends Budgets with TableInfo<$BudgetsTable, Budget> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$BudgetsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
hasAutoIncrement: true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'PRIMARY KEY AUTOINCREMENT',
),
);
static const VerificationMeta _amountMeta = const VerificationMeta('amount');
@override
late final GeneratedColumn<double> amount = GeneratedColumn<double>(
'amount',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: true,
);
static const VerificationMeta _categoryIdMeta = const VerificationMeta(
'categoryId',
);
@override
late final GeneratedColumn<String> categoryId = GeneratedColumn<String>(
'category_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _monthMeta = const VerificationMeta('month');
@override
late final GeneratedColumn<int> month = GeneratedColumn<int>(
'month',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _yearMeta = const VerificationMeta('year');
@override
late final GeneratedColumn<int> year = GeneratedColumn<int>(
'year',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
'created_at',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
defaultValue: currentDateAndTime,
);
@override
List<GeneratedColumn> get $columns => [
id,
amount,
categoryId,
month,
year,
createdAt,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'budgets';
@override
VerificationContext validateIntegrity(
Insertable<Budget> 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('amount')) {
context.handle(
_amountMeta,
amount.isAcceptableOrUnknown(data['amount']!, _amountMeta),
);
} else if (isInserting) {
context.missing(_amountMeta);
}
if (data.containsKey('category_id')) {
context.handle(
_categoryIdMeta,
categoryId.isAcceptableOrUnknown(data['category_id']!, _categoryIdMeta),
);
}
if (data.containsKey('month')) {
context.handle(
_monthMeta,
month.isAcceptableOrUnknown(data['month']!, _monthMeta),
);
} else if (isInserting) {
context.missing(_monthMeta);
}
if (data.containsKey('year')) {
context.handle(
_yearMeta,
year.isAcceptableOrUnknown(data['year']!, _yearMeta),
);
} else if (isInserting) {
context.missing(_yearMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Budget map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Budget(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
amount: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}amount'],
)!,
categoryId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}category_id'],
),
month: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}month'],
)!,
year: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}year'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}created_at'],
)!,
);
}
@override
$BudgetsTable createAlias(String alias) {
return $BudgetsTable(attachedDatabase, alias);
}
}
class Budget extends DataClass implements Insertable<Budget> {
final int id;
final double amount;
final String? categoryId;
final int month;
final int year;
final DateTime createdAt;
const Budget({
required this.id,
required this.amount,
this.categoryId,
required this.month,
required this.year,
required this.createdAt,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<int>(id);
map['amount'] = Variable<double>(amount);
if (!nullToAbsent || categoryId != null) {
map['category_id'] = Variable<String>(categoryId);
}
map['month'] = Variable<int>(month);
map['year'] = Variable<int>(year);
map['created_at'] = Variable<DateTime>(createdAt);
return map;
}
BudgetsCompanion toCompanion(bool nullToAbsent) {
return BudgetsCompanion(
id: Value(id),
amount: Value(amount),
categoryId: categoryId == null && nullToAbsent
? const Value.absent()
: Value(categoryId),
month: Value(month),
year: Value(year),
createdAt: Value(createdAt),
);
}
factory Budget.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Budget(
id: serializer.fromJson<int>(json['id']),
amount: serializer.fromJson<double>(json['amount']),
categoryId: serializer.fromJson<String?>(json['categoryId']),
month: serializer.fromJson<int>(json['month']),
year: serializer.fromJson<int>(json['year']),
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<int>(id),
'amount': serializer.toJson<double>(amount),
'categoryId': serializer.toJson<String?>(categoryId),
'month': serializer.toJson<int>(month),
'year': serializer.toJson<int>(year),
'createdAt': serializer.toJson<DateTime>(createdAt),
};
}
Budget copyWith({
int? id,
double? amount,
Value<String?> categoryId = const Value.absent(),
int? month,
int? year,
DateTime? createdAt,
}) => Budget(
id: id ?? this.id,
amount: amount ?? this.amount,
categoryId: categoryId.present ? categoryId.value : this.categoryId,
month: month ?? this.month,
year: year ?? this.year,
createdAt: createdAt ?? this.createdAt,
);
Budget copyWithCompanion(BudgetsCompanion data) {
return Budget(
id: data.id.present ? data.id.value : this.id,
amount: data.amount.present ? data.amount.value : this.amount,
categoryId: data.categoryId.present
? data.categoryId.value
: this.categoryId,
month: data.month.present ? data.month.value : this.month,
year: data.year.present ? data.year.value : this.year,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
);
}
@override
String toString() {
return (StringBuffer('Budget(')
..write('id: $id, ')
..write('amount: $amount, ')
..write('categoryId: $categoryId, ')
..write('month: $month, ')
..write('year: $year, ')
..write('createdAt: $createdAt')
..write(')'))
.toString();
}
@override
int get hashCode =>
Object.hash(id, amount, categoryId, month, year, createdAt);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Budget &&
other.id == this.id &&
other.amount == this.amount &&
other.categoryId == this.categoryId &&
other.month == this.month &&
other.year == this.year &&
other.createdAt == this.createdAt);
}
class BudgetsCompanion extends UpdateCompanion<Budget> {
final Value<int> id;
final Value<double> amount;
final Value<String?> categoryId;
final Value<int> month;
final Value<int> year;
final Value<DateTime> createdAt;
const BudgetsCompanion({
this.id = const Value.absent(),
this.amount = const Value.absent(),
this.categoryId = const Value.absent(),
this.month = const Value.absent(),
this.year = const Value.absent(),
this.createdAt = const Value.absent(),
});
BudgetsCompanion.insert({
this.id = const Value.absent(),
required double amount,
this.categoryId = const Value.absent(),
required int month,
required int year,
this.createdAt = const Value.absent(),
}) : amount = Value(amount),
month = Value(month),
year = Value(year);
static Insertable<Budget> custom({
Expression<int>? id,
Expression<double>? amount,
Expression<String>? categoryId,
Expression<int>? month,
Expression<int>? year,
Expression<DateTime>? createdAt,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (amount != null) 'amount': amount,
if (categoryId != null) 'category_id': categoryId,
if (month != null) 'month': month,
if (year != null) 'year': year,
if (createdAt != null) 'created_at': createdAt,
});
}
BudgetsCompanion copyWith({
Value<int>? id,
Value<double>? amount,
Value<String?>? categoryId,
Value<int>? month,
Value<int>? year,
Value<DateTime>? createdAt,
}) {
return BudgetsCompanion(
id: id ?? this.id,
amount: amount ?? this.amount,
categoryId: categoryId ?? this.categoryId,
month: month ?? this.month,
year: year ?? this.year,
createdAt: createdAt ?? this.createdAt,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<int>(id.value);
}
if (amount.present) {
map['amount'] = Variable<double>(amount.value);
}
if (categoryId.present) {
map['category_id'] = Variable<String>(categoryId.value);
}
if (month.present) {
map['month'] = Variable<int>(month.value);
}
if (year.present) {
map['year'] = Variable<int>(year.value);
}
if (createdAt.present) {
map['created_at'] = Variable<DateTime>(createdAt.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('BudgetsCompanion(')
..write('id: $id, ')
..write('amount: $amount, ')
..write('categoryId: $categoryId, ')
..write('month: $month, ')
..write('year: $year, ')
..write('createdAt: $createdAt')
..write(')'))
.toString();
}
}
class $ExchangeRatesTable extends ExchangeRates
with TableInfo<$ExchangeRatesTable, ExchangeRate> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$ExchangeRatesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
hasAutoIncrement: true,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'PRIMARY KEY AUTOINCREMENT',
),
);
static const VerificationMeta _fromCurrencyMeta = const VerificationMeta(
'fromCurrency',
);
@override
late final GeneratedColumn<String> fromCurrency = GeneratedColumn<String>(
'from_currency',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _toCurrencyMeta = const VerificationMeta(
'toCurrency',
);
@override
late final GeneratedColumn<String> toCurrency = GeneratedColumn<String>(
'to_currency',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _rateMeta = const VerificationMeta('rate');
@override
late final GeneratedColumn<double> rate = GeneratedColumn<double>(
'rate',
aliasedName,
false,
type: DriftSqlType.double,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: false,
defaultValue: currentDateAndTime,
);
@override
List<GeneratedColumn> get $columns => [
id,
fromCurrency,
toCurrency,
rate,
updatedAt,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'exchange_rates';
@override
VerificationContext validateIntegrity(
Insertable<ExchangeRate> 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('from_currency')) {
context.handle(
_fromCurrencyMeta,
fromCurrency.isAcceptableOrUnknown(
data['from_currency']!,
_fromCurrencyMeta,
),
);
} else if (isInserting) {
context.missing(_fromCurrencyMeta);
}
if (data.containsKey('to_currency')) {
context.handle(
_toCurrencyMeta,
toCurrency.isAcceptableOrUnknown(data['to_currency']!, _toCurrencyMeta),
);
} else if (isInserting) {
context.missing(_toCurrencyMeta);
}
if (data.containsKey('rate')) {
context.handle(
_rateMeta,
rate.isAcceptableOrUnknown(data['rate']!, _rateMeta),
);
} else if (isInserting) {
context.missing(_rateMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
ExchangeRate map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return ExchangeRate(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
fromCurrency: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}from_currency'],
)!,
toCurrency: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}to_currency'],
)!,
rate: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}rate'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}updated_at'],
)!,
);
}
@override
$ExchangeRatesTable createAlias(String alias) {
return $ExchangeRatesTable(attachedDatabase, alias);
}
}
class ExchangeRate extends DataClass implements Insertable<ExchangeRate> {
final int id;
final String fromCurrency;
final String toCurrency;
final double rate;
final DateTime updatedAt;
const ExchangeRate({
required this.id,
required this.fromCurrency,
required this.toCurrency,
required this.rate,
required this.updatedAt,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<int>(id);
map['from_currency'] = Variable<String>(fromCurrency);
map['to_currency'] = Variable<String>(toCurrency);
map['rate'] = Variable<double>(rate);
map['updated_at'] = Variable<DateTime>(updatedAt);
return map;
}
ExchangeRatesCompanion toCompanion(bool nullToAbsent) {
return ExchangeRatesCompanion(
id: Value(id),
fromCurrency: Value(fromCurrency),
toCurrency: Value(toCurrency),
rate: Value(rate),
updatedAt: Value(updatedAt),
);
}
factory ExchangeRate.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return ExchangeRate(
id: serializer.fromJson<int>(json['id']),
fromCurrency: serializer.fromJson<String>(json['fromCurrency']),
toCurrency: serializer.fromJson<String>(json['toCurrency']),
rate: serializer.fromJson<double>(json['rate']),
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<int>(id),
'fromCurrency': serializer.toJson<String>(fromCurrency),
'toCurrency': serializer.toJson<String>(toCurrency),
'rate': serializer.toJson<double>(rate),
'updatedAt': serializer.toJson<DateTime>(updatedAt),
};
}
ExchangeRate copyWith({
int? id,
String? fromCurrency,
String? toCurrency,
double? rate,
DateTime? updatedAt,
}) => ExchangeRate(
id: id ?? this.id,
fromCurrency: fromCurrency ?? this.fromCurrency,
toCurrency: toCurrency ?? this.toCurrency,
rate: rate ?? this.rate,
updatedAt: updatedAt ?? this.updatedAt,
);
ExchangeRate copyWithCompanion(ExchangeRatesCompanion data) {
return ExchangeRate(
id: data.id.present ? data.id.value : this.id,
fromCurrency: data.fromCurrency.present
? data.fromCurrency.value
: this.fromCurrency,
toCurrency: data.toCurrency.present
? data.toCurrency.value
: this.toCurrency,
rate: data.rate.present ? data.rate.value : this.rate,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
);
}
@override
String toString() {
return (StringBuffer('ExchangeRate(')
..write('id: $id, ')
..write('fromCurrency: $fromCurrency, ')
..write('toCurrency: $toCurrency, ')
..write('rate: $rate, ')
..write('updatedAt: $updatedAt')
..write(')'))
.toString();
}
@override
int get hashCode =>
Object.hash(id, fromCurrency, toCurrency, rate, updatedAt);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is ExchangeRate &&
other.id == this.id &&
other.fromCurrency == this.fromCurrency &&
other.toCurrency == this.toCurrency &&
other.rate == this.rate &&
other.updatedAt == this.updatedAt);
}
class ExchangeRatesCompanion extends UpdateCompanion<ExchangeRate> {
final Value<int> id;
final Value<String> fromCurrency;
final Value<String> toCurrency;
final Value<double> rate;
final Value<DateTime> updatedAt;
const ExchangeRatesCompanion({
this.id = const Value.absent(),
this.fromCurrency = const Value.absent(),
this.toCurrency = const Value.absent(),
this.rate = const Value.absent(),
this.updatedAt = const Value.absent(),
});
ExchangeRatesCompanion.insert({
this.id = const Value.absent(),
required String fromCurrency,
required String toCurrency,
required double rate,
this.updatedAt = const Value.absent(),
}) : fromCurrency = Value(fromCurrency),
toCurrency = Value(toCurrency),
rate = Value(rate);
static Insertable<ExchangeRate> custom({
Expression<int>? id,
Expression<String>? fromCurrency,
Expression<String>? toCurrency,
Expression<double>? rate,
Expression<DateTime>? updatedAt,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (fromCurrency != null) 'from_currency': fromCurrency,
if (toCurrency != null) 'to_currency': toCurrency,
if (rate != null) 'rate': rate,
if (updatedAt != null) 'updated_at': updatedAt,
});
}
ExchangeRatesCompanion copyWith({
Value<int>? id,
Value<String>? fromCurrency,
Value<String>? toCurrency,
Value<double>? rate,
Value<DateTime>? updatedAt,
}) {
return ExchangeRatesCompanion(
id: id ?? this.id,
fromCurrency: fromCurrency ?? this.fromCurrency,
toCurrency: toCurrency ?? this.toCurrency,
rate: rate ?? this.rate,
updatedAt: updatedAt ?? this.updatedAt,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<int>(id.value);
}
if (fromCurrency.present) {
map['from_currency'] = Variable<String>(fromCurrency.value);
}
if (toCurrency.present) {
map['to_currency'] = Variable<String>(toCurrency.value);
}
if (rate.present) {
map['rate'] = Variable<double>(rate.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<DateTime>(updatedAt.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('ExchangeRatesCompanion(')
..write('id: $id, ')
..write('fromCurrency: $fromCurrency, ')
..write('toCurrency: $toCurrency, ')
..write('rate: $rate, ')
..write('updatedAt: $updatedAt')
..write(')'))
.toString();
}
}
abstract class _$AppDatabase extends GeneratedDatabase {
_$AppDatabase(QueryExecutor e) : super(e);
$AppDatabaseManager get managers => $AppDatabaseManager(this);
late final $TransactionsTable transactions = $TransactionsTable(this);
late final $CategoriesTable categories = $CategoriesTable(this);
late final $BudgetsTable budgets = $BudgetsTable(this);
late final $ExchangeRatesTable exchangeRates = $ExchangeRatesTable(this);
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [
transactions,
categories,
budgets,
exchangeRates,
];
@override
DriftDatabaseOptions get options =>
const DriftDatabaseOptions(storeDateTimeAsText: true);
}
typedef $$TransactionsTableCreateCompanionBuilder =
TransactionsCompanion Function({
required String id,
required double amount,
required String category,
required String type,
required DateTime date,
Value<String?> note,
Value<String> recurrence,
Value<DateTime?> lastOccurrence,
Value<String> currency,
Value<String> currencyCode,
Value<DateTime> createdAt,
Value<int> rowid,
});
typedef $$TransactionsTableUpdateCompanionBuilder =
TransactionsCompanion Function({
Value<String> id,
Value<double> amount,
Value<String> category,
Value<String> type,
Value<DateTime> date,
Value<String?> note,
Value<String> recurrence,
Value<DateTime?> lastOccurrence,
Value<String> currency,
Value<String> currencyCode,
Value<DateTime> createdAt,
Value<int> rowid,
});
class $$TransactionsTableFilterComposer
extends Composer<_$AppDatabase, $TransactionsTable> {
$$TransactionsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get amount => $composableBuilder(
column: $table.amount,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get category => $composableBuilder(
column: $table.category,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get date => $composableBuilder(
column: $table.date,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get note => $composableBuilder(
column: $table.note,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get recurrence => $composableBuilder(
column: $table.recurrence,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get lastOccurrence => $composableBuilder(
column: $table.lastOccurrence,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get currency => $composableBuilder(
column: $table.currency,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get currencyCode => $composableBuilder(
column: $table.currencyCode,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
}
class $$TransactionsTableOrderingComposer
extends Composer<_$AppDatabase, $TransactionsTable> {
$$TransactionsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get amount => $composableBuilder(
column: $table.amount,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get category => $composableBuilder(
column: $table.category,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get date => $composableBuilder(
column: $table.date,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get note => $composableBuilder(
column: $table.note,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get recurrence => $composableBuilder(
column: $table.recurrence,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get lastOccurrence => $composableBuilder(
column: $table.lastOccurrence,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get currency => $composableBuilder(
column: $table.currency,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get currencyCode => $composableBuilder(
column: $table.currencyCode,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
}
class $$TransactionsTableAnnotationComposer
extends Composer<_$AppDatabase, $TransactionsTable> {
$$TransactionsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<double> get amount =>
$composableBuilder(column: $table.amount, builder: (column) => column);
GeneratedColumn<String> get category =>
$composableBuilder(column: $table.category, builder: (column) => column);
GeneratedColumn<String> get type =>
$composableBuilder(column: $table.type, builder: (column) => column);
GeneratedColumn<DateTime> get date =>
$composableBuilder(column: $table.date, builder: (column) => column);
GeneratedColumn<String> get note =>
$composableBuilder(column: $table.note, builder: (column) => column);
GeneratedColumn<String> get recurrence => $composableBuilder(
column: $table.recurrence,
builder: (column) => column,
);
GeneratedColumn<DateTime> get lastOccurrence => $composableBuilder(
column: $table.lastOccurrence,
builder: (column) => column,
);
GeneratedColumn<String> get currency =>
$composableBuilder(column: $table.currency, builder: (column) => column);
GeneratedColumn<String> get currencyCode => $composableBuilder(
column: $table.currencyCode,
builder: (column) => column,
);
GeneratedColumn<DateTime> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
}
class $$TransactionsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$TransactionsTable,
Transaction,
$$TransactionsTableFilterComposer,
$$TransactionsTableOrderingComposer,
$$TransactionsTableAnnotationComposer,
$$TransactionsTableCreateCompanionBuilder,
$$TransactionsTableUpdateCompanionBuilder,
(
Transaction,
BaseReferences<_$AppDatabase, $TransactionsTable, Transaction>,
),
Transaction,
PrefetchHooks Function()
> {
$$TransactionsTableTableManager(_$AppDatabase db, $TransactionsTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$TransactionsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$TransactionsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$TransactionsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<double> amount = const Value.absent(),
Value<String> category = const Value.absent(),
Value<String> type = const Value.absent(),
Value<DateTime> date = const Value.absent(),
Value<String?> note = const Value.absent(),
Value<String> recurrence = const Value.absent(),
Value<DateTime?> lastOccurrence = const Value.absent(),
Value<String> currency = const Value.absent(),
Value<String> currencyCode = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => TransactionsCompanion(
id: id,
amount: amount,
category: category,
type: type,
date: date,
note: note,
recurrence: recurrence,
lastOccurrence: lastOccurrence,
currency: currency,
currencyCode: currencyCode,
createdAt: createdAt,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required double amount,
required String category,
required String type,
required DateTime date,
Value<String?> note = const Value.absent(),
Value<String> recurrence = const Value.absent(),
Value<DateTime?> lastOccurrence = const Value.absent(),
Value<String> currency = const Value.absent(),
Value<String> currencyCode = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => TransactionsCompanion.insert(
id: id,
amount: amount,
category: category,
type: type,
date: date,
note: note,
recurrence: recurrence,
lastOccurrence: lastOccurrence,
currency: currency,
currencyCode: currencyCode,
createdAt: createdAt,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$TransactionsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$TransactionsTable,
Transaction,
$$TransactionsTableFilterComposer,
$$TransactionsTableOrderingComposer,
$$TransactionsTableAnnotationComposer,
$$TransactionsTableCreateCompanionBuilder,
$$TransactionsTableUpdateCompanionBuilder,
(
Transaction,
BaseReferences<_$AppDatabase, $TransactionsTable, Transaction>,
),
Transaction,
PrefetchHooks Function()
>;
typedef $$CategoriesTableCreateCompanionBuilder =
CategoriesCompanion Function({
Value<int> id,
required String name,
required String type,
Value<String?> icon,
Value<String?> color,
Value<bool> isDefault,
Value<DateTime> createdAt,
});
typedef $$CategoriesTableUpdateCompanionBuilder =
CategoriesCompanion Function({
Value<int> id,
Value<String> name,
Value<String> type,
Value<String?> icon,
Value<String?> color,
Value<bool> isDefault,
Value<DateTime> createdAt,
});
class $$CategoriesTableFilterComposer
extends Composer<_$AppDatabase, $CategoriesTable> {
$$CategoriesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get icon => $composableBuilder(
column: $table.icon,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get color => $composableBuilder(
column: $table.color,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDefault => $composableBuilder(
column: $table.isDefault,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
}
class $$CategoriesTableOrderingComposer
extends Composer<_$AppDatabase, $CategoriesTable> {
$$CategoriesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get icon => $composableBuilder(
column: $table.icon,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get color => $composableBuilder(
column: $table.color,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDefault => $composableBuilder(
column: $table.isDefault,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
}
class $$CategoriesTableAnnotationComposer
extends Composer<_$AppDatabase, $CategoriesTable> {
$$CategoriesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get name =>
$composableBuilder(column: $table.name, builder: (column) => column);
GeneratedColumn<String> get type =>
$composableBuilder(column: $table.type, builder: (column) => column);
GeneratedColumn<String> get icon =>
$composableBuilder(column: $table.icon, builder: (column) => column);
GeneratedColumn<String> get color =>
$composableBuilder(column: $table.color, builder: (column) => column);
GeneratedColumn<bool> get isDefault =>
$composableBuilder(column: $table.isDefault, builder: (column) => column);
GeneratedColumn<DateTime> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
}
class $$CategoriesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$CategoriesTable,
Category,
$$CategoriesTableFilterComposer,
$$CategoriesTableOrderingComposer,
$$CategoriesTableAnnotationComposer,
$$CategoriesTableCreateCompanionBuilder,
$$CategoriesTableUpdateCompanionBuilder,
(Category, BaseReferences<_$AppDatabase, $CategoriesTable, Category>),
Category,
PrefetchHooks Function()
> {
$$CategoriesTableTableManager(_$AppDatabase db, $CategoriesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$CategoriesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$CategoriesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$CategoriesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> name = const Value.absent(),
Value<String> type = const Value.absent(),
Value<String?> icon = const Value.absent(),
Value<String?> color = const Value.absent(),
Value<bool> isDefault = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(),
}) => CategoriesCompanion(
id: id,
name: name,
type: type,
icon: icon,
color: color,
isDefault: isDefault,
createdAt: createdAt,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required String name,
required String type,
Value<String?> icon = const Value.absent(),
Value<String?> color = const Value.absent(),
Value<bool> isDefault = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(),
}) => CategoriesCompanion.insert(
id: id,
name: name,
type: type,
icon: icon,
color: color,
isDefault: isDefault,
createdAt: createdAt,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$CategoriesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$CategoriesTable,
Category,
$$CategoriesTableFilterComposer,
$$CategoriesTableOrderingComposer,
$$CategoriesTableAnnotationComposer,
$$CategoriesTableCreateCompanionBuilder,
$$CategoriesTableUpdateCompanionBuilder,
(Category, BaseReferences<_$AppDatabase, $CategoriesTable, Category>),
Category,
PrefetchHooks Function()
>;
typedef $$BudgetsTableCreateCompanionBuilder =
BudgetsCompanion Function({
Value<int> id,
required double amount,
Value<String?> categoryId,
required int month,
required int year,
Value<DateTime> createdAt,
});
typedef $$BudgetsTableUpdateCompanionBuilder =
BudgetsCompanion Function({
Value<int> id,
Value<double> amount,
Value<String?> categoryId,
Value<int> month,
Value<int> year,
Value<DateTime> createdAt,
});
class $$BudgetsTableFilterComposer
extends Composer<_$AppDatabase, $BudgetsTable> {
$$BudgetsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get amount => $composableBuilder(
column: $table.amount,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get categoryId => $composableBuilder(
column: $table.categoryId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get month => $composableBuilder(
column: $table.month,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get year => $composableBuilder(
column: $table.year,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
}
class $$BudgetsTableOrderingComposer
extends Composer<_$AppDatabase, $BudgetsTable> {
$$BudgetsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get amount => $composableBuilder(
column: $table.amount,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get categoryId => $composableBuilder(
column: $table.categoryId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get month => $composableBuilder(
column: $table.month,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get year => $composableBuilder(
column: $table.year,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
}
class $$BudgetsTableAnnotationComposer
extends Composer<_$AppDatabase, $BudgetsTable> {
$$BudgetsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<double> get amount =>
$composableBuilder(column: $table.amount, builder: (column) => column);
GeneratedColumn<String> get categoryId => $composableBuilder(
column: $table.categoryId,
builder: (column) => column,
);
GeneratedColumn<int> get month =>
$composableBuilder(column: $table.month, builder: (column) => column);
GeneratedColumn<int> get year =>
$composableBuilder(column: $table.year, builder: (column) => column);
GeneratedColumn<DateTime> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
}
class $$BudgetsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$BudgetsTable,
Budget,
$$BudgetsTableFilterComposer,
$$BudgetsTableOrderingComposer,
$$BudgetsTableAnnotationComposer,
$$BudgetsTableCreateCompanionBuilder,
$$BudgetsTableUpdateCompanionBuilder,
(Budget, BaseReferences<_$AppDatabase, $BudgetsTable, Budget>),
Budget,
PrefetchHooks Function()
> {
$$BudgetsTableTableManager(_$AppDatabase db, $BudgetsTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$BudgetsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$BudgetsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$BudgetsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<double> amount = const Value.absent(),
Value<String?> categoryId = const Value.absent(),
Value<int> month = const Value.absent(),
Value<int> year = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(),
}) => BudgetsCompanion(
id: id,
amount: amount,
categoryId: categoryId,
month: month,
year: year,
createdAt: createdAt,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required double amount,
Value<String?> categoryId = const Value.absent(),
required int month,
required int year,
Value<DateTime> createdAt = const Value.absent(),
}) => BudgetsCompanion.insert(
id: id,
amount: amount,
categoryId: categoryId,
month: month,
year: year,
createdAt: createdAt,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$BudgetsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$BudgetsTable,
Budget,
$$BudgetsTableFilterComposer,
$$BudgetsTableOrderingComposer,
$$BudgetsTableAnnotationComposer,
$$BudgetsTableCreateCompanionBuilder,
$$BudgetsTableUpdateCompanionBuilder,
(Budget, BaseReferences<_$AppDatabase, $BudgetsTable, Budget>),
Budget,
PrefetchHooks Function()
>;
typedef $$ExchangeRatesTableCreateCompanionBuilder =
ExchangeRatesCompanion Function({
Value<int> id,
required String fromCurrency,
required String toCurrency,
required double rate,
Value<DateTime> updatedAt,
});
typedef $$ExchangeRatesTableUpdateCompanionBuilder =
ExchangeRatesCompanion Function({
Value<int> id,
Value<String> fromCurrency,
Value<String> toCurrency,
Value<double> rate,
Value<DateTime> updatedAt,
});
class $$ExchangeRatesTableFilterComposer
extends Composer<_$AppDatabase, $ExchangeRatesTable> {
$$ExchangeRatesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get fromCurrency => $composableBuilder(
column: $table.fromCurrency,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get toCurrency => $composableBuilder(
column: $table.toCurrency,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get rate => $composableBuilder(
column: $table.rate,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
}
class $$ExchangeRatesTableOrderingComposer
extends Composer<_$AppDatabase, $ExchangeRatesTable> {
$$ExchangeRatesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get fromCurrency => $composableBuilder(
column: $table.fromCurrency,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get toCurrency => $composableBuilder(
column: $table.toCurrency,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get rate => $composableBuilder(
column: $table.rate,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
}
class $$ExchangeRatesTableAnnotationComposer
extends Composer<_$AppDatabase, $ExchangeRatesTable> {
$$ExchangeRatesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get fromCurrency => $composableBuilder(
column: $table.fromCurrency,
builder: (column) => column,
);
GeneratedColumn<String> get toCurrency => $composableBuilder(
column: $table.toCurrency,
builder: (column) => column,
);
GeneratedColumn<double> get rate =>
$composableBuilder(column: $table.rate, builder: (column) => column);
GeneratedColumn<DateTime> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
}
class $$ExchangeRatesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$ExchangeRatesTable,
ExchangeRate,
$$ExchangeRatesTableFilterComposer,
$$ExchangeRatesTableOrderingComposer,
$$ExchangeRatesTableAnnotationComposer,
$$ExchangeRatesTableCreateCompanionBuilder,
$$ExchangeRatesTableUpdateCompanionBuilder,
(
ExchangeRate,
BaseReferences<_$AppDatabase, $ExchangeRatesTable, ExchangeRate>,
),
ExchangeRate,
PrefetchHooks Function()
> {
$$ExchangeRatesTableTableManager(_$AppDatabase db, $ExchangeRatesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$ExchangeRatesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$ExchangeRatesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$ExchangeRatesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> fromCurrency = const Value.absent(),
Value<String> toCurrency = const Value.absent(),
Value<double> rate = const Value.absent(),
Value<DateTime> updatedAt = const Value.absent(),
}) => ExchangeRatesCompanion(
id: id,
fromCurrency: fromCurrency,
toCurrency: toCurrency,
rate: rate,
updatedAt: updatedAt,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required String fromCurrency,
required String toCurrency,
required double rate,
Value<DateTime> updatedAt = const Value.absent(),
}) => ExchangeRatesCompanion.insert(
id: id,
fromCurrency: fromCurrency,
toCurrency: toCurrency,
rate: rate,
updatedAt: updatedAt,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$ExchangeRatesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$ExchangeRatesTable,
ExchangeRate,
$$ExchangeRatesTableFilterComposer,
$$ExchangeRatesTableOrderingComposer,
$$ExchangeRatesTableAnnotationComposer,
$$ExchangeRatesTableCreateCompanionBuilder,
$$ExchangeRatesTableUpdateCompanionBuilder,
(
ExchangeRate,
BaseReferences<_$AppDatabase, $ExchangeRatesTable, ExchangeRate>,
),
ExchangeRate,
PrefetchHooks Function()
>;
class $AppDatabaseManager {
final _$AppDatabase _db;
$AppDatabaseManager(this._db);
$$TransactionsTableTableManager get transactions =>
$$TransactionsTableTableManager(_db, _db.transactions);
$$CategoriesTableTableManager get categories =>
$$CategoriesTableTableManager(_db, _db.categories);
$$BudgetsTableTableManager get budgets =>
$$BudgetsTableTableManager(_db, _db.budgets);
$$ExchangeRatesTableTableManager get exchangeRates =>
$$ExchangeRatesTableTableManager(_db, _db.exchangeRates);
}