1742 lines
51 KiB
Dart
1742 lines
51 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $CategoriesTable extends Categories
|
|
with TableInfo<$CategoriesTable, CategoryDb> {
|
|
@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,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
|
|
);
|
|
static const VerificationMeta _iconMeta = const VerificationMeta('icon');
|
|
@override
|
|
late final GeneratedColumn<String> icon = GeneratedColumn<String>(
|
|
'icon',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _userIdMeta = const VerificationMeta('userId');
|
|
@override
|
|
late final GeneratedColumn<int> userId = GeneratedColumn<int>(
|
|
'user_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _colorMeta = const VerificationMeta('color');
|
|
@override
|
|
late final GeneratedColumn<int> color = GeneratedColumn<int>(
|
|
'color',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, name, icon, userId, color];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'categories';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<CategoryDb> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('icon')) {
|
|
context.handle(
|
|
_iconMeta,
|
|
icon.isAcceptableOrUnknown(data['icon']!, _iconMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_iconMeta);
|
|
}
|
|
if (data.containsKey('user_id')) {
|
|
context.handle(
|
|
_userIdMeta,
|
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('color')) {
|
|
context.handle(
|
|
_colorMeta,
|
|
color.isAcceptableOrUnknown(data['color']!, _colorMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_colorMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
CategoryDb map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return CategoryDb(
|
|
id:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
icon:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}icon'],
|
|
)!,
|
|
userId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}user_id'],
|
|
),
|
|
color:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}color'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$CategoriesTable createAlias(String alias) {
|
|
return $CategoriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class CategoryDb extends DataClass implements Insertable<CategoryDb> {
|
|
final int id;
|
|
final String name;
|
|
final String icon;
|
|
final int? userId;
|
|
final int color;
|
|
const CategoryDb({
|
|
required this.id,
|
|
required this.name,
|
|
required this.icon,
|
|
this.userId,
|
|
required this.color,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['icon'] = Variable<String>(icon);
|
|
if (!nullToAbsent || userId != null) {
|
|
map['user_id'] = Variable<int>(userId);
|
|
}
|
|
map['color'] = Variable<int>(color);
|
|
return map;
|
|
}
|
|
|
|
CategoriesCompanion toCompanion(bool nullToAbsent) {
|
|
return CategoriesCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
icon: Value(icon),
|
|
userId:
|
|
userId == null && nullToAbsent ? const Value.absent() : Value(userId),
|
|
color: Value(color),
|
|
);
|
|
}
|
|
|
|
factory CategoryDb.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return CategoryDb(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
icon: serializer.fromJson<String>(json['icon']),
|
|
userId: serializer.fromJson<int?>(json['userId']),
|
|
color: serializer.fromJson<int>(json['color']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'icon': serializer.toJson<String>(icon),
|
|
'userId': serializer.toJson<int?>(userId),
|
|
'color': serializer.toJson<int>(color),
|
|
};
|
|
}
|
|
|
|
CategoryDb copyWith({
|
|
int? id,
|
|
String? name,
|
|
String? icon,
|
|
Value<int?> userId = const Value.absent(),
|
|
int? color,
|
|
}) => CategoryDb(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
icon: icon ?? this.icon,
|
|
userId: userId.present ? userId.value : this.userId,
|
|
color: color ?? this.color,
|
|
);
|
|
CategoryDb copyWithCompanion(CategoriesCompanion data) {
|
|
return CategoryDb(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
icon: data.icon.present ? data.icon.value : this.icon,
|
|
userId: data.userId.present ? data.userId.value : this.userId,
|
|
color: data.color.present ? data.color.value : this.color,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('CategoryDb(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('icon: $icon, ')
|
|
..write('userId: $userId, ')
|
|
..write('color: $color')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, icon, userId, color);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is CategoryDb &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.icon == this.icon &&
|
|
other.userId == this.userId &&
|
|
other.color == this.color);
|
|
}
|
|
|
|
class CategoriesCompanion extends UpdateCompanion<CategoryDb> {
|
|
final Value<int> id;
|
|
final Value<String> name;
|
|
final Value<String> icon;
|
|
final Value<int?> userId;
|
|
final Value<int> color;
|
|
const CategoriesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.icon = const Value.absent(),
|
|
this.userId = const Value.absent(),
|
|
this.color = const Value.absent(),
|
|
});
|
|
CategoriesCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String name,
|
|
required String icon,
|
|
this.userId = const Value.absent(),
|
|
required int color,
|
|
}) : name = Value(name),
|
|
icon = Value(icon),
|
|
color = Value(color);
|
|
static Insertable<CategoryDb> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? icon,
|
|
Expression<int>? userId,
|
|
Expression<int>? color,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (icon != null) 'icon': icon,
|
|
if (userId != null) 'user_id': userId,
|
|
if (color != null) 'color': color,
|
|
});
|
|
}
|
|
|
|
CategoriesCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<String>? name,
|
|
Value<String>? icon,
|
|
Value<int?>? userId,
|
|
Value<int>? color,
|
|
}) {
|
|
return CategoriesCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
icon: icon ?? this.icon,
|
|
userId: userId ?? this.userId,
|
|
color: color ?? this.color,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (icon.present) {
|
|
map['icon'] = Variable<String>(icon.value);
|
|
}
|
|
if (userId.present) {
|
|
map['user_id'] = Variable<int>(userId.value);
|
|
}
|
|
if (color.present) {
|
|
map['color'] = Variable<int>(color.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('CategoriesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('icon: $icon, ')
|
|
..write('userId: $userId, ')
|
|
..write('color: $color')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
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<int> id = GeneratedColumn<int>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'PRIMARY KEY AUTOINCREMENT',
|
|
),
|
|
);
|
|
static const VerificationMeta _categoryNameMeta = const VerificationMeta(
|
|
'categoryName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> categoryName = GeneratedColumn<String>(
|
|
'category_name',
|
|
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 _dateMeta = const VerificationMeta('date');
|
|
@override
|
|
late final GeneratedColumn<DateTime> date = GeneratedColumn<DateTime>(
|
|
'date',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _merchantMeta = const VerificationMeta(
|
|
'merchant',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> merchant = GeneratedColumn<String>(
|
|
'merchant',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _userIdMeta = const VerificationMeta('userId');
|
|
@override
|
|
late final GeneratedColumn<int> userId = GeneratedColumn<int>(
|
|
'user_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _typeMeta = const VerificationMeta('type');
|
|
@override
|
|
late final GeneratedColumn<String> type = GeneratedColumn<String>(
|
|
'type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('expense'),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
categoryName,
|
|
amount,
|
|
date,
|
|
merchant,
|
|
userId,
|
|
type,
|
|
];
|
|
@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));
|
|
}
|
|
if (data.containsKey('category_name')) {
|
|
context.handle(
|
|
_categoryNameMeta,
|
|
categoryName.isAcceptableOrUnknown(
|
|
data['category_name']!,
|
|
_categoryNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_categoryNameMeta);
|
|
}
|
|
if (data.containsKey('amount')) {
|
|
context.handle(
|
|
_amountMeta,
|
|
amount.isAcceptableOrUnknown(data['amount']!, _amountMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_amountMeta);
|
|
}
|
|
if (data.containsKey('date')) {
|
|
context.handle(
|
|
_dateMeta,
|
|
date.isAcceptableOrUnknown(data['date']!, _dateMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dateMeta);
|
|
}
|
|
if (data.containsKey('merchant')) {
|
|
context.handle(
|
|
_merchantMeta,
|
|
merchant.isAcceptableOrUnknown(data['merchant']!, _merchantMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_merchantMeta);
|
|
}
|
|
if (data.containsKey('user_id')) {
|
|
context.handle(
|
|
_userIdMeta,
|
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('type')) {
|
|
context.handle(
|
|
_typeMeta,
|
|
type.isAcceptableOrUnknown(data['type']!, _typeMeta),
|
|
);
|
|
}
|
|
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.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
categoryName:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category_name'],
|
|
)!,
|
|
amount:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}amount'],
|
|
)!,
|
|
date:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}date'],
|
|
)!,
|
|
merchant:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}merchant'],
|
|
)!,
|
|
userId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}user_id'],
|
|
),
|
|
type:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}type'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$TransactionsTable createAlias(String alias) {
|
|
return $TransactionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Transaction extends DataClass implements Insertable<Transaction> {
|
|
final int id;
|
|
final String categoryName;
|
|
final double amount;
|
|
final DateTime date;
|
|
final String merchant;
|
|
final int? userId;
|
|
final String type;
|
|
const Transaction({
|
|
required this.id,
|
|
required this.categoryName,
|
|
required this.amount,
|
|
required this.date,
|
|
required this.merchant,
|
|
this.userId,
|
|
required this.type,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['category_name'] = Variable<String>(categoryName);
|
|
map['amount'] = Variable<double>(amount);
|
|
map['date'] = Variable<DateTime>(date);
|
|
map['merchant'] = Variable<String>(merchant);
|
|
if (!nullToAbsent || userId != null) {
|
|
map['user_id'] = Variable<int>(userId);
|
|
}
|
|
map['type'] = Variable<String>(type);
|
|
return map;
|
|
}
|
|
|
|
TransactionsCompanion toCompanion(bool nullToAbsent) {
|
|
return TransactionsCompanion(
|
|
id: Value(id),
|
|
categoryName: Value(categoryName),
|
|
amount: Value(amount),
|
|
date: Value(date),
|
|
merchant: Value(merchant),
|
|
userId:
|
|
userId == null && nullToAbsent ? const Value.absent() : Value(userId),
|
|
type: Value(type),
|
|
);
|
|
}
|
|
|
|
factory Transaction.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Transaction(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
categoryName: serializer.fromJson<String>(json['categoryName']),
|
|
amount: serializer.fromJson<double>(json['amount']),
|
|
date: serializer.fromJson<DateTime>(json['date']),
|
|
merchant: serializer.fromJson<String>(json['merchant']),
|
|
userId: serializer.fromJson<int?>(json['userId']),
|
|
type: serializer.fromJson<String>(json['type']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'categoryName': serializer.toJson<String>(categoryName),
|
|
'amount': serializer.toJson<double>(amount),
|
|
'date': serializer.toJson<DateTime>(date),
|
|
'merchant': serializer.toJson<String>(merchant),
|
|
'userId': serializer.toJson<int?>(userId),
|
|
'type': serializer.toJson<String>(type),
|
|
};
|
|
}
|
|
|
|
Transaction copyWith({
|
|
int? id,
|
|
String? categoryName,
|
|
double? amount,
|
|
DateTime? date,
|
|
String? merchant,
|
|
Value<int?> userId = const Value.absent(),
|
|
String? type,
|
|
}) => Transaction(
|
|
id: id ?? this.id,
|
|
categoryName: categoryName ?? this.categoryName,
|
|
amount: amount ?? this.amount,
|
|
date: date ?? this.date,
|
|
merchant: merchant ?? this.merchant,
|
|
userId: userId.present ? userId.value : this.userId,
|
|
type: type ?? this.type,
|
|
);
|
|
Transaction copyWithCompanion(TransactionsCompanion data) {
|
|
return Transaction(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
categoryName:
|
|
data.categoryName.present
|
|
? data.categoryName.value
|
|
: this.categoryName,
|
|
amount: data.amount.present ? data.amount.value : this.amount,
|
|
date: data.date.present ? data.date.value : this.date,
|
|
merchant: data.merchant.present ? data.merchant.value : this.merchant,
|
|
userId: data.userId.present ? data.userId.value : this.userId,
|
|
type: data.type.present ? data.type.value : this.type,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Transaction(')
|
|
..write('id: $id, ')
|
|
..write('categoryName: $categoryName, ')
|
|
..write('amount: $amount, ')
|
|
..write('date: $date, ')
|
|
..write('merchant: $merchant, ')
|
|
..write('userId: $userId, ')
|
|
..write('type: $type')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, categoryName, amount, date, merchant, userId, type);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Transaction &&
|
|
other.id == this.id &&
|
|
other.categoryName == this.categoryName &&
|
|
other.amount == this.amount &&
|
|
other.date == this.date &&
|
|
other.merchant == this.merchant &&
|
|
other.userId == this.userId &&
|
|
other.type == this.type);
|
|
}
|
|
|
|
class TransactionsCompanion extends UpdateCompanion<Transaction> {
|
|
final Value<int> id;
|
|
final Value<String> categoryName;
|
|
final Value<double> amount;
|
|
final Value<DateTime> date;
|
|
final Value<String> merchant;
|
|
final Value<int?> userId;
|
|
final Value<String> type;
|
|
const TransactionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.categoryName = const Value.absent(),
|
|
this.amount = const Value.absent(),
|
|
this.date = const Value.absent(),
|
|
this.merchant = const Value.absent(),
|
|
this.userId = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
});
|
|
TransactionsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String categoryName,
|
|
required double amount,
|
|
required DateTime date,
|
|
required String merchant,
|
|
this.userId = const Value.absent(),
|
|
this.type = const Value.absent(),
|
|
}) : categoryName = Value(categoryName),
|
|
amount = Value(amount),
|
|
date = Value(date),
|
|
merchant = Value(merchant);
|
|
static Insertable<Transaction> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? categoryName,
|
|
Expression<double>? amount,
|
|
Expression<DateTime>? date,
|
|
Expression<String>? merchant,
|
|
Expression<int>? userId,
|
|
Expression<String>? type,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (categoryName != null) 'category_name': categoryName,
|
|
if (amount != null) 'amount': amount,
|
|
if (date != null) 'date': date,
|
|
if (merchant != null) 'merchant': merchant,
|
|
if (userId != null) 'user_id': userId,
|
|
if (type != null) 'type': type,
|
|
});
|
|
}
|
|
|
|
TransactionsCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<String>? categoryName,
|
|
Value<double>? amount,
|
|
Value<DateTime>? date,
|
|
Value<String>? merchant,
|
|
Value<int?>? userId,
|
|
Value<String>? type,
|
|
}) {
|
|
return TransactionsCompanion(
|
|
id: id ?? this.id,
|
|
categoryName: categoryName ?? this.categoryName,
|
|
amount: amount ?? this.amount,
|
|
date: date ?? this.date,
|
|
merchant: merchant ?? this.merchant,
|
|
userId: userId ?? this.userId,
|
|
type: type ?? this.type,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (categoryName.present) {
|
|
map['category_name'] = Variable<String>(categoryName.value);
|
|
}
|
|
if (amount.present) {
|
|
map['amount'] = Variable<double>(amount.value);
|
|
}
|
|
if (date.present) {
|
|
map['date'] = Variable<DateTime>(date.value);
|
|
}
|
|
if (merchant.present) {
|
|
map['merchant'] = Variable<String>(merchant.value);
|
|
}
|
|
if (userId.present) {
|
|
map['user_id'] = Variable<int>(userId.value);
|
|
}
|
|
if (type.present) {
|
|
map['type'] = Variable<String>(type.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TransactionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('categoryName: $categoryName, ')
|
|
..write('amount: $amount, ')
|
|
..write('date: $date, ')
|
|
..write('merchant: $merchant, ')
|
|
..write('userId: $userId, ')
|
|
..write('type: $type')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $UsersTable extends Users with TableInfo<$UsersTable, User> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$UsersTable(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 _emailMeta = const VerificationMeta('email');
|
|
@override
|
|
late final GeneratedColumn<String> email = GeneratedColumn<String>(
|
|
'email',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
|
|
);
|
|
static const VerificationMeta _passwordMeta = const VerificationMeta(
|
|
'password',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> password = GeneratedColumn<String>(
|
|
'password',
|
|
aliasedName,
|
|
false,
|
|
additionalChecks: GeneratedColumn.checkTextLength(minTextLength: 6),
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, name, email, password];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'users';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<User> 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('email')) {
|
|
context.handle(
|
|
_emailMeta,
|
|
email.isAcceptableOrUnknown(data['email']!, _emailMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_emailMeta);
|
|
}
|
|
if (data.containsKey('password')) {
|
|
context.handle(
|
|
_passwordMeta,
|
|
password.isAcceptableOrUnknown(data['password']!, _passwordMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_passwordMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
User map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return User(
|
|
id:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
email:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}email'],
|
|
)!,
|
|
password:
|
|
attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}password'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$UsersTable createAlias(String alias) {
|
|
return $UsersTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class User extends DataClass implements Insertable<User> {
|
|
final int id;
|
|
final String name;
|
|
final String email;
|
|
final String password;
|
|
const User({
|
|
required this.id,
|
|
required this.name,
|
|
required this.email,
|
|
required this.password,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['email'] = Variable<String>(email);
|
|
map['password'] = Variable<String>(password);
|
|
return map;
|
|
}
|
|
|
|
UsersCompanion toCompanion(bool nullToAbsent) {
|
|
return UsersCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
email: Value(email),
|
|
password: Value(password),
|
|
);
|
|
}
|
|
|
|
factory User.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return User(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
email: serializer.fromJson<String>(json['email']),
|
|
password: serializer.fromJson<String>(json['password']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'email': serializer.toJson<String>(email),
|
|
'password': serializer.toJson<String>(password),
|
|
};
|
|
}
|
|
|
|
User copyWith({int? id, String? name, String? email, String? password}) =>
|
|
User(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
email: email ?? this.email,
|
|
password: password ?? this.password,
|
|
);
|
|
User copyWithCompanion(UsersCompanion data) {
|
|
return User(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
email: data.email.present ? data.email.value : this.email,
|
|
password: data.password.present ? data.password.value : this.password,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('User(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('email: $email, ')
|
|
..write('password: $password')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, email, password);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is User &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.email == this.email &&
|
|
other.password == this.password);
|
|
}
|
|
|
|
class UsersCompanion extends UpdateCompanion<User> {
|
|
final Value<int> id;
|
|
final Value<String> name;
|
|
final Value<String> email;
|
|
final Value<String> password;
|
|
const UsersCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.email = const Value.absent(),
|
|
this.password = const Value.absent(),
|
|
});
|
|
UsersCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String name,
|
|
required String email,
|
|
required String password,
|
|
}) : name = Value(name),
|
|
email = Value(email),
|
|
password = Value(password);
|
|
static Insertable<User> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? email,
|
|
Expression<String>? password,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (email != null) 'email': email,
|
|
if (password != null) 'password': password,
|
|
});
|
|
}
|
|
|
|
UsersCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<String>? name,
|
|
Value<String>? email,
|
|
Value<String>? password,
|
|
}) {
|
|
return UsersCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
email: email ?? this.email,
|
|
password: password ?? this.password,
|
|
);
|
|
}
|
|
|
|
@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 (email.present) {
|
|
map['email'] = Variable<String>(email.value);
|
|
}
|
|
if (password.present) {
|
|
map['password'] = Variable<String>(password.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('UsersCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('email: $email, ')
|
|
..write('password: $password')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $CategoriesTable categories = $CategoriesTable(this);
|
|
late final $TransactionsTable transactions = $TransactionsTable(this);
|
|
late final $UsersTable users = $UsersTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
categories,
|
|
transactions,
|
|
users,
|
|
];
|
|
}
|
|
|
|
typedef $$CategoriesTableCreateCompanionBuilder =
|
|
CategoriesCompanion Function({
|
|
Value<int> id,
|
|
required String name,
|
|
required String icon,
|
|
Value<int?> userId,
|
|
required int color,
|
|
});
|
|
typedef $$CategoriesTableUpdateCompanionBuilder =
|
|
CategoriesCompanion Function({
|
|
Value<int> id,
|
|
Value<String> name,
|
|
Value<String> icon,
|
|
Value<int?> userId,
|
|
Value<int> color,
|
|
});
|
|
|
|
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 icon => $composableBuilder(
|
|
column: $table.icon,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get userId => $composableBuilder(
|
|
column: $table.userId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get color => $composableBuilder(
|
|
column: $table.color,
|
|
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 icon => $composableBuilder(
|
|
column: $table.icon,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get userId => $composableBuilder(
|
|
column: $table.userId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get color => $composableBuilder(
|
|
column: $table.color,
|
|
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 icon =>
|
|
$composableBuilder(column: $table.icon, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get userId =>
|
|
$composableBuilder(column: $table.userId, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get color =>
|
|
$composableBuilder(column: $table.color, builder: (column) => column);
|
|
}
|
|
|
|
class $$CategoriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$CategoriesTable,
|
|
CategoryDb,
|
|
$$CategoriesTableFilterComposer,
|
|
$$CategoriesTableOrderingComposer,
|
|
$$CategoriesTableAnnotationComposer,
|
|
$$CategoriesTableCreateCompanionBuilder,
|
|
$$CategoriesTableUpdateCompanionBuilder,
|
|
(
|
|
CategoryDb,
|
|
BaseReferences<_$AppDatabase, $CategoriesTable, CategoryDb>,
|
|
),
|
|
CategoryDb,
|
|
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> icon = const Value.absent(),
|
|
Value<int?> userId = const Value.absent(),
|
|
Value<int> color = const Value.absent(),
|
|
}) => CategoriesCompanion(
|
|
id: id,
|
|
name: name,
|
|
icon: icon,
|
|
userId: userId,
|
|
color: color,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
required String name,
|
|
required String icon,
|
|
Value<int?> userId = const Value.absent(),
|
|
required int color,
|
|
}) => CategoriesCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
icon: icon,
|
|
userId: userId,
|
|
color: color,
|
|
),
|
|
withReferenceMapper:
|
|
(p0) =>
|
|
p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
BaseReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$CategoriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$CategoriesTable,
|
|
CategoryDb,
|
|
$$CategoriesTableFilterComposer,
|
|
$$CategoriesTableOrderingComposer,
|
|
$$CategoriesTableAnnotationComposer,
|
|
$$CategoriesTableCreateCompanionBuilder,
|
|
$$CategoriesTableUpdateCompanionBuilder,
|
|
(CategoryDb, BaseReferences<_$AppDatabase, $CategoriesTable, CategoryDb>),
|
|
CategoryDb,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$TransactionsTableCreateCompanionBuilder =
|
|
TransactionsCompanion Function({
|
|
Value<int> id,
|
|
required String categoryName,
|
|
required double amount,
|
|
required DateTime date,
|
|
required String merchant,
|
|
Value<int?> userId,
|
|
Value<String> type,
|
|
});
|
|
typedef $$TransactionsTableUpdateCompanionBuilder =
|
|
TransactionsCompanion Function({
|
|
Value<int> id,
|
|
Value<String> categoryName,
|
|
Value<double> amount,
|
|
Value<DateTime> date,
|
|
Value<String> merchant,
|
|
Value<int?> userId,
|
|
Value<String> type,
|
|
});
|
|
|
|
class $$TransactionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $TransactionsTable> {
|
|
$$TransactionsTableFilterComposer({
|
|
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 categoryName => $composableBuilder(
|
|
column: $table.categoryName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get amount => $composableBuilder(
|
|
column: $table.amount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get merchant => $composableBuilder(
|
|
column: $table.merchant,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get userId => $composableBuilder(
|
|
column: $table.userId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$TransactionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $TransactionsTable> {
|
|
$$TransactionsTableOrderingComposer({
|
|
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 categoryName => $composableBuilder(
|
|
column: $table.categoryName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get amount => $composableBuilder(
|
|
column: $table.amount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get date => $composableBuilder(
|
|
column: $table.date,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get merchant => $composableBuilder(
|
|
column: $table.merchant,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get userId => $composableBuilder(
|
|
column: $table.userId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get type => $composableBuilder(
|
|
column: $table.type,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$TransactionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $TransactionsTable> {
|
|
$$TransactionsTableAnnotationComposer({
|
|
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 categoryName => $composableBuilder(
|
|
column: $table.categoryName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get amount =>
|
|
$composableBuilder(column: $table.amount, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get date =>
|
|
$composableBuilder(column: $table.date, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get merchant =>
|
|
$composableBuilder(column: $table.merchant, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get userId =>
|
|
$composableBuilder(column: $table.userId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get type =>
|
|
$composableBuilder(column: $table.type, 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<int> id = const Value.absent(),
|
|
Value<String> categoryName = const Value.absent(),
|
|
Value<double> amount = const Value.absent(),
|
|
Value<DateTime> date = const Value.absent(),
|
|
Value<String> merchant = const Value.absent(),
|
|
Value<int?> userId = const Value.absent(),
|
|
Value<String> type = const Value.absent(),
|
|
}) => TransactionsCompanion(
|
|
id: id,
|
|
categoryName: categoryName,
|
|
amount: amount,
|
|
date: date,
|
|
merchant: merchant,
|
|
userId: userId,
|
|
type: type,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
required String categoryName,
|
|
required double amount,
|
|
required DateTime date,
|
|
required String merchant,
|
|
Value<int?> userId = const Value.absent(),
|
|
Value<String> type = const Value.absent(),
|
|
}) => TransactionsCompanion.insert(
|
|
id: id,
|
|
categoryName: categoryName,
|
|
amount: amount,
|
|
date: date,
|
|
merchant: merchant,
|
|
userId: userId,
|
|
type: type,
|
|
),
|
|
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 $$UsersTableCreateCompanionBuilder =
|
|
UsersCompanion Function({
|
|
Value<int> id,
|
|
required String name,
|
|
required String email,
|
|
required String password,
|
|
});
|
|
typedef $$UsersTableUpdateCompanionBuilder =
|
|
UsersCompanion Function({
|
|
Value<int> id,
|
|
Value<String> name,
|
|
Value<String> email,
|
|
Value<String> password,
|
|
});
|
|
|
|
class $$UsersTableFilterComposer extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableFilterComposer({
|
|
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 email => $composableBuilder(
|
|
column: $table.email,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get password => $composableBuilder(
|
|
column: $table.password,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$UsersTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableOrderingComposer({
|
|
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 email => $composableBuilder(
|
|
column: $table.email,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get password => $composableBuilder(
|
|
column: $table.password,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$UsersTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $UsersTable> {
|
|
$$UsersTableAnnotationComposer({
|
|
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 email =>
|
|
$composableBuilder(column: $table.email, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get password =>
|
|
$composableBuilder(column: $table.password, builder: (column) => column);
|
|
}
|
|
|
|
class $$UsersTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$UsersTable,
|
|
User,
|
|
$$UsersTableFilterComposer,
|
|
$$UsersTableOrderingComposer,
|
|
$$UsersTableAnnotationComposer,
|
|
$$UsersTableCreateCompanionBuilder,
|
|
$$UsersTableUpdateCompanionBuilder,
|
|
(User, BaseReferences<_$AppDatabase, $UsersTable, User>),
|
|
User,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$UsersTableTableManager(_$AppDatabase db, $UsersTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer:
|
|
() => $$UsersTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer:
|
|
() => $$UsersTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer:
|
|
() => $$UsersTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> email = const Value.absent(),
|
|
Value<String> password = const Value.absent(),
|
|
}) => UsersCompanion(
|
|
id: id,
|
|
name: name,
|
|
email: email,
|
|
password: password,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
required String name,
|
|
required String email,
|
|
required String password,
|
|
}) => UsersCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
email: email,
|
|
password: password,
|
|
),
|
|
withReferenceMapper:
|
|
(p0) =>
|
|
p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
BaseReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$UsersTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$UsersTable,
|
|
User,
|
|
$$UsersTableFilterComposer,
|
|
$$UsersTableOrderingComposer,
|
|
$$UsersTableAnnotationComposer,
|
|
$$UsersTableCreateCompanionBuilder,
|
|
$$UsersTableUpdateCompanionBuilder,
|
|
(User, BaseReferences<_$AppDatabase, $UsersTable, User>),
|
|
User,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$CategoriesTableTableManager get categories =>
|
|
$$CategoriesTableTableManager(_db, _db.categories);
|
|
$$TransactionsTableTableManager get transactions =>
|
|
$$TransactionsTableTableManager(_db, _db.transactions);
|
|
$$UsersTableTableManager get users =>
|
|
$$UsersTableTableManager(_db, _db.users);
|
|
}
|