1716 lines
53 KiB
Dart
1716 lines
53 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $NotesTable extends Notes with TableInfo<$NotesTable, DbNote> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$NotesTable(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 _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _bodyMeta = const VerificationMeta('body');
|
|
@override
|
|
late final GeneratedColumn<String> body = GeneratedColumn<String>(
|
|
'body',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
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: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _sortIndexMeta = const VerificationMeta(
|
|
'sortIndex',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> sortIndex = GeneratedColumn<int>(
|
|
'sort_index',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _serverVersionMeta = const VerificationMeta(
|
|
'serverVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> serverVersion = GeneratedColumn<int>(
|
|
'server_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0),
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
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 _isDirtyMeta = const VerificationMeta(
|
|
'isDirty',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDirty = GeneratedColumn<bool>(
|
|
'is_dirty',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_dirty" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(true),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
title,
|
|
body,
|
|
createdAt,
|
|
updatedAt,
|
|
sortIndex,
|
|
serverVersion,
|
|
isDeleted,
|
|
categoryId,
|
|
isDirty,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'notes';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<DbNote> 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('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('body')) {
|
|
context.handle(
|
|
_bodyMeta,
|
|
body.isAcceptableOrUnknown(data['body']!, _bodyMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_bodyMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
if (data.containsKey('sort_index')) {
|
|
context.handle(
|
|
_sortIndexMeta,
|
|
sortIndex.isAcceptableOrUnknown(data['sort_index']!, _sortIndexMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_sortIndexMeta);
|
|
}
|
|
if (data.containsKey('server_version')) {
|
|
context.handle(
|
|
_serverVersionMeta,
|
|
serverVersion.isAcceptableOrUnknown(
|
|
data['server_version']!,
|
|
_serverVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('category_id')) {
|
|
context.handle(
|
|
_categoryIdMeta,
|
|
categoryId.isAcceptableOrUnknown(data['category_id']!, _categoryIdMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('is_dirty')) {
|
|
context.handle(
|
|
_isDirtyMeta,
|
|
isDirty.isAcceptableOrUnknown(data['is_dirty']!, _isDirtyMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
DbNote map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return DbNote(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
body: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}body'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
sortIndex: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}sort_index'],
|
|
)!,
|
|
serverVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}server_version'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
categoryId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category_id'],
|
|
),
|
|
isDirty: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_dirty'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$NotesTable createAlias(String alias) {
|
|
return $NotesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class DbNote extends DataClass implements Insertable<DbNote> {
|
|
final String id;
|
|
final String title;
|
|
final String body;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final int sortIndex;
|
|
final int serverVersion;
|
|
final bool isDeleted;
|
|
final String? categoryId;
|
|
final bool isDirty;
|
|
const DbNote({
|
|
required this.id,
|
|
required this.title,
|
|
required this.body,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.sortIndex,
|
|
required this.serverVersion,
|
|
required this.isDeleted,
|
|
this.categoryId,
|
|
required this.isDirty,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['title'] = Variable<String>(title);
|
|
map['body'] = Variable<String>(body);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
map['sort_index'] = Variable<int>(sortIndex);
|
|
map['server_version'] = Variable<int>(serverVersion);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
if (!nullToAbsent || categoryId != null) {
|
|
map['category_id'] = Variable<String>(categoryId);
|
|
}
|
|
map['is_dirty'] = Variable<bool>(isDirty);
|
|
return map;
|
|
}
|
|
|
|
NotesCompanion toCompanion(bool nullToAbsent) {
|
|
return NotesCompanion(
|
|
id: Value(id),
|
|
title: Value(title),
|
|
body: Value(body),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
sortIndex: Value(sortIndex),
|
|
serverVersion: Value(serverVersion),
|
|
isDeleted: Value(isDeleted),
|
|
categoryId: categoryId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(categoryId),
|
|
isDirty: Value(isDirty),
|
|
);
|
|
}
|
|
|
|
factory DbNote.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return DbNote(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
body: serializer.fromJson<String>(json['body']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
sortIndex: serializer.fromJson<int>(json['sortIndex']),
|
|
serverVersion: serializer.fromJson<int>(json['serverVersion']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
categoryId: serializer.fromJson<String?>(json['categoryId']),
|
|
isDirty: serializer.fromJson<bool>(json['isDirty']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'title': serializer.toJson<String>(title),
|
|
'body': serializer.toJson<String>(body),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'sortIndex': serializer.toJson<int>(sortIndex),
|
|
'serverVersion': serializer.toJson<int>(serverVersion),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'categoryId': serializer.toJson<String?>(categoryId),
|
|
'isDirty': serializer.toJson<bool>(isDirty),
|
|
};
|
|
}
|
|
|
|
DbNote copyWith({
|
|
String? id,
|
|
String? title,
|
|
String? body,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
int? sortIndex,
|
|
int? serverVersion,
|
|
bool? isDeleted,
|
|
Value<String?> categoryId = const Value.absent(),
|
|
bool? isDirty,
|
|
}) => DbNote(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
body: body ?? this.body,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
sortIndex: sortIndex ?? this.sortIndex,
|
|
serverVersion: serverVersion ?? this.serverVersion,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
categoryId: categoryId.present ? categoryId.value : this.categoryId,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
);
|
|
DbNote copyWithCompanion(NotesCompanion data) {
|
|
return DbNote(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
body: data.body.present ? data.body.value : this.body,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
sortIndex: data.sortIndex.present ? data.sortIndex.value : this.sortIndex,
|
|
serverVersion: data.serverVersion.present
|
|
? data.serverVersion.value
|
|
: this.serverVersion,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
categoryId: data.categoryId.present
|
|
? data.categoryId.value
|
|
: this.categoryId,
|
|
isDirty: data.isDirty.present ? data.isDirty.value : this.isDirty,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DbNote(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('body: $body, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('sortIndex: $sortIndex, ')
|
|
..write('serverVersion: $serverVersion, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('categoryId: $categoryId, ')
|
|
..write('isDirty: $isDirty')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
title,
|
|
body,
|
|
createdAt,
|
|
updatedAt,
|
|
sortIndex,
|
|
serverVersion,
|
|
isDeleted,
|
|
categoryId,
|
|
isDirty,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is DbNote &&
|
|
other.id == this.id &&
|
|
other.title == this.title &&
|
|
other.body == this.body &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.sortIndex == this.sortIndex &&
|
|
other.serverVersion == this.serverVersion &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.categoryId == this.categoryId &&
|
|
other.isDirty == this.isDirty);
|
|
}
|
|
|
|
class NotesCompanion extends UpdateCompanion<DbNote> {
|
|
final Value<String> id;
|
|
final Value<String> title;
|
|
final Value<String> body;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<int> sortIndex;
|
|
final Value<int> serverVersion;
|
|
final Value<bool> isDeleted;
|
|
final Value<String?> categoryId;
|
|
final Value<bool> isDirty;
|
|
final Value<int> rowid;
|
|
const NotesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.body = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.sortIndex = const Value.absent(),
|
|
this.serverVersion = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.categoryId = const Value.absent(),
|
|
this.isDirty = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
NotesCompanion.insert({
|
|
required String id,
|
|
required String title,
|
|
required String body,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
required int sortIndex,
|
|
this.serverVersion = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.categoryId = const Value.absent(),
|
|
this.isDirty = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
title = Value(title),
|
|
body = Value(body),
|
|
createdAt = Value(createdAt),
|
|
updatedAt = Value(updatedAt),
|
|
sortIndex = Value(sortIndex);
|
|
static Insertable<DbNote> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? title,
|
|
Expression<String>? body,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<int>? sortIndex,
|
|
Expression<int>? serverVersion,
|
|
Expression<bool>? isDeleted,
|
|
Expression<String>? categoryId,
|
|
Expression<bool>? isDirty,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (title != null) 'title': title,
|
|
if (body != null) 'body': body,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (sortIndex != null) 'sort_index': sortIndex,
|
|
if (serverVersion != null) 'server_version': serverVersion,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (categoryId != null) 'category_id': categoryId,
|
|
if (isDirty != null) 'is_dirty': isDirty,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
NotesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? title,
|
|
Value<String>? body,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<int>? sortIndex,
|
|
Value<int>? serverVersion,
|
|
Value<bool>? isDeleted,
|
|
Value<String?>? categoryId,
|
|
Value<bool>? isDirty,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return NotesCompanion(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
body: body ?? this.body,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
sortIndex: sortIndex ?? this.sortIndex,
|
|
serverVersion: serverVersion ?? this.serverVersion,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
categoryId: categoryId ?? this.categoryId,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
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 (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (body.present) {
|
|
map['body'] = Variable<String>(body.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (sortIndex.present) {
|
|
map['sort_index'] = Variable<int>(sortIndex.value);
|
|
}
|
|
if (serverVersion.present) {
|
|
map['server_version'] = Variable<int>(serverVersion.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (categoryId.present) {
|
|
map['category_id'] = Variable<String>(categoryId.value);
|
|
}
|
|
if (isDirty.present) {
|
|
map['is_dirty'] = Variable<bool>(isDirty.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('NotesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('title: $title, ')
|
|
..write('body: $body, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('sortIndex: $sortIndex, ')
|
|
..write('serverVersion: $serverVersion, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('categoryId: $categoryId, ')
|
|
..write('isDirty: $isDirty, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $CategoriesTable extends Categories
|
|
with TableInfo<$CategoriesTable, DbCategory> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$CategoriesTable(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 _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _serverVersionMeta = const VerificationMeta(
|
|
'serverVersion',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> serverVersion = GeneratedColumn<int>(
|
|
'server_version',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0),
|
|
);
|
|
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
|
|
'isDeleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
|
|
'is_deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _colorValueMeta = const VerificationMeta(
|
|
'colorValue',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> colorValue = GeneratedColumn<int>(
|
|
'color_value',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _iconCodePointMeta = const VerificationMeta(
|
|
'iconCodePoint',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> iconCodePoint = GeneratedColumn<int>(
|
|
'icon_code_point',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _isDirtyMeta = const VerificationMeta(
|
|
'isDirty',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDirty = GeneratedColumn<bool>(
|
|
'is_dirty',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_dirty" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(true),
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
serverVersion,
|
|
isDeleted,
|
|
colorValue,
|
|
iconCodePoint,
|
|
isDirty,
|
|
updatedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'categories';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<DbCategory> 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('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('server_version')) {
|
|
context.handle(
|
|
_serverVersionMeta,
|
|
serverVersion.isAcceptableOrUnknown(
|
|
data['server_version']!,
|
|
_serverVersionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_deleted')) {
|
|
context.handle(
|
|
_isDeletedMeta,
|
|
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('color_value')) {
|
|
context.handle(
|
|
_colorValueMeta,
|
|
colorValue.isAcceptableOrUnknown(data['color_value']!, _colorValueMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('icon_code_point')) {
|
|
context.handle(
|
|
_iconCodePointMeta,
|
|
iconCodePoint.isAcceptableOrUnknown(
|
|
data['icon_code_point']!,
|
|
_iconCodePointMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('is_dirty')) {
|
|
context.handle(
|
|
_isDirtyMeta,
|
|
isDirty.isAcceptableOrUnknown(data['is_dirty']!, _isDirtyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
DbCategory map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return DbCategory(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
serverVersion: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}server_version'],
|
|
)!,
|
|
isDeleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_deleted'],
|
|
)!,
|
|
colorValue: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}color_value'],
|
|
),
|
|
iconCodePoint: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}icon_code_point'],
|
|
),
|
|
isDirty: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_dirty'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$CategoriesTable createAlias(String alias) {
|
|
return $CategoriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class DbCategory extends DataClass implements Insertable<DbCategory> {
|
|
final String id;
|
|
final String name;
|
|
final int serverVersion;
|
|
final bool isDeleted;
|
|
final int? colorValue;
|
|
final int? iconCodePoint;
|
|
final bool isDirty;
|
|
final DateTime updatedAt;
|
|
const DbCategory({
|
|
required this.id,
|
|
required this.name,
|
|
required this.serverVersion,
|
|
required this.isDeleted,
|
|
this.colorValue,
|
|
this.iconCodePoint,
|
|
required this.isDirty,
|
|
required this.updatedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['server_version'] = Variable<int>(serverVersion);
|
|
map['is_deleted'] = Variable<bool>(isDeleted);
|
|
if (!nullToAbsent || colorValue != null) {
|
|
map['color_value'] = Variable<int>(colorValue);
|
|
}
|
|
if (!nullToAbsent || iconCodePoint != null) {
|
|
map['icon_code_point'] = Variable<int>(iconCodePoint);
|
|
}
|
|
map['is_dirty'] = Variable<bool>(isDirty);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
return map;
|
|
}
|
|
|
|
CategoriesCompanion toCompanion(bool nullToAbsent) {
|
|
return CategoriesCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
serverVersion: Value(serverVersion),
|
|
isDeleted: Value(isDeleted),
|
|
colorValue: colorValue == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(colorValue),
|
|
iconCodePoint: iconCodePoint == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(iconCodePoint),
|
|
isDirty: Value(isDirty),
|
|
updatedAt: Value(updatedAt),
|
|
);
|
|
}
|
|
|
|
factory DbCategory.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return DbCategory(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
serverVersion: serializer.fromJson<int>(json['serverVersion']),
|
|
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
|
|
colorValue: serializer.fromJson<int?>(json['colorValue']),
|
|
iconCodePoint: serializer.fromJson<int?>(json['iconCodePoint']),
|
|
isDirty: serializer.fromJson<bool>(json['isDirty']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'serverVersion': serializer.toJson<int>(serverVersion),
|
|
'isDeleted': serializer.toJson<bool>(isDeleted),
|
|
'colorValue': serializer.toJson<int?>(colorValue),
|
|
'iconCodePoint': serializer.toJson<int?>(iconCodePoint),
|
|
'isDirty': serializer.toJson<bool>(isDirty),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
};
|
|
}
|
|
|
|
DbCategory copyWith({
|
|
String? id,
|
|
String? name,
|
|
int? serverVersion,
|
|
bool? isDeleted,
|
|
Value<int?> colorValue = const Value.absent(),
|
|
Value<int?> iconCodePoint = const Value.absent(),
|
|
bool? isDirty,
|
|
DateTime? updatedAt,
|
|
}) => DbCategory(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
serverVersion: serverVersion ?? this.serverVersion,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
colorValue: colorValue.present ? colorValue.value : this.colorValue,
|
|
iconCodePoint: iconCodePoint.present
|
|
? iconCodePoint.value
|
|
: this.iconCodePoint,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
);
|
|
DbCategory copyWithCompanion(CategoriesCompanion data) {
|
|
return DbCategory(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
serverVersion: data.serverVersion.present
|
|
? data.serverVersion.value
|
|
: this.serverVersion,
|
|
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
|
|
colorValue: data.colorValue.present
|
|
? data.colorValue.value
|
|
: this.colorValue,
|
|
iconCodePoint: data.iconCodePoint.present
|
|
? data.iconCodePoint.value
|
|
: this.iconCodePoint,
|
|
isDirty: data.isDirty.present ? data.isDirty.value : this.isDirty,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DbCategory(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('serverVersion: $serverVersion, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('colorValue: $colorValue, ')
|
|
..write('iconCodePoint: $iconCodePoint, ')
|
|
..write('isDirty: $isDirty, ')
|
|
..write('updatedAt: $updatedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
serverVersion,
|
|
isDeleted,
|
|
colorValue,
|
|
iconCodePoint,
|
|
isDirty,
|
|
updatedAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is DbCategory &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.serverVersion == this.serverVersion &&
|
|
other.isDeleted == this.isDeleted &&
|
|
other.colorValue == this.colorValue &&
|
|
other.iconCodePoint == this.iconCodePoint &&
|
|
other.isDirty == this.isDirty &&
|
|
other.updatedAt == this.updatedAt);
|
|
}
|
|
|
|
class CategoriesCompanion extends UpdateCompanion<DbCategory> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<int> serverVersion;
|
|
final Value<bool> isDeleted;
|
|
final Value<int?> colorValue;
|
|
final Value<int?> iconCodePoint;
|
|
final Value<bool> isDirty;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<int> rowid;
|
|
const CategoriesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.serverVersion = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.colorValue = const Value.absent(),
|
|
this.iconCodePoint = const Value.absent(),
|
|
this.isDirty = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
CategoriesCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
this.serverVersion = const Value.absent(),
|
|
this.isDeleted = const Value.absent(),
|
|
this.colorValue = const Value.absent(),
|
|
this.iconCodePoint = const Value.absent(),
|
|
this.isDirty = const Value.absent(),
|
|
required DateTime updatedAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
updatedAt = Value(updatedAt);
|
|
static Insertable<DbCategory> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<int>? serverVersion,
|
|
Expression<bool>? isDeleted,
|
|
Expression<int>? colorValue,
|
|
Expression<int>? iconCodePoint,
|
|
Expression<bool>? isDirty,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (serverVersion != null) 'server_version': serverVersion,
|
|
if (isDeleted != null) 'is_deleted': isDeleted,
|
|
if (colorValue != null) 'color_value': colorValue,
|
|
if (iconCodePoint != null) 'icon_code_point': iconCodePoint,
|
|
if (isDirty != null) 'is_dirty': isDirty,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
CategoriesCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<int>? serverVersion,
|
|
Value<bool>? isDeleted,
|
|
Value<int?>? colorValue,
|
|
Value<int?>? iconCodePoint,
|
|
Value<bool>? isDirty,
|
|
Value<DateTime>? updatedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return CategoriesCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
serverVersion: serverVersion ?? this.serverVersion,
|
|
isDeleted: isDeleted ?? this.isDeleted,
|
|
colorValue: colorValue ?? this.colorValue,
|
|
iconCodePoint: iconCodePoint ?? this.iconCodePoint,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
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 (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (serverVersion.present) {
|
|
map['server_version'] = Variable<int>(serverVersion.value);
|
|
}
|
|
if (isDeleted.present) {
|
|
map['is_deleted'] = Variable<bool>(isDeleted.value);
|
|
}
|
|
if (colorValue.present) {
|
|
map['color_value'] = Variable<int>(colorValue.value);
|
|
}
|
|
if (iconCodePoint.present) {
|
|
map['icon_code_point'] = Variable<int>(iconCodePoint.value);
|
|
}
|
|
if (isDirty.present) {
|
|
map['is_dirty'] = Variable<bool>(isDirty.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('CategoriesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('serverVersion: $serverVersion, ')
|
|
..write('isDeleted: $isDeleted, ')
|
|
..write('colorValue: $colorValue, ')
|
|
..write('iconCodePoint: $iconCodePoint, ')
|
|
..write('isDirty: $isDirty, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $NotesTable notes = $NotesTable(this);
|
|
late final $CategoriesTable categories = $CategoriesTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [notes, categories];
|
|
}
|
|
|
|
typedef $$NotesTableCreateCompanionBuilder =
|
|
NotesCompanion Function({
|
|
required String id,
|
|
required String title,
|
|
required String body,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
required int sortIndex,
|
|
Value<int> serverVersion,
|
|
Value<bool> isDeleted,
|
|
Value<String?> categoryId,
|
|
Value<bool> isDirty,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$NotesTableUpdateCompanionBuilder =
|
|
NotesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> title,
|
|
Value<String> body,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<int> sortIndex,
|
|
Value<int> serverVersion,
|
|
Value<bool> isDeleted,
|
|
Value<String?> categoryId,
|
|
Value<bool> isDirty,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$NotesTableFilterComposer extends Composer<_$AppDatabase, $NotesTable> {
|
|
$$NotesTableFilterComposer({
|
|
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<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get body => $composableBuilder(
|
|
column: $table.body,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get sortIndex => $composableBuilder(
|
|
column: $table.sortIndex,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get categoryId => $composableBuilder(
|
|
column: $table.categoryId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$NotesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $NotesTable> {
|
|
$$NotesTableOrderingComposer({
|
|
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<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get body => $composableBuilder(
|
|
column: $table.body,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get sortIndex => $composableBuilder(
|
|
column: $table.sortIndex,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get categoryId => $composableBuilder(
|
|
column: $table.categoryId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$NotesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $NotesTable> {
|
|
$$NotesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get body =>
|
|
$composableBuilder(column: $table.body, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get sortIndex =>
|
|
$composableBuilder(column: $table.sortIndex, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get categoryId => $composableBuilder(
|
|
column: $table.categoryId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDirty =>
|
|
$composableBuilder(column: $table.isDirty, builder: (column) => column);
|
|
}
|
|
|
|
class $$NotesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$NotesTable,
|
|
DbNote,
|
|
$$NotesTableFilterComposer,
|
|
$$NotesTableOrderingComposer,
|
|
$$NotesTableAnnotationComposer,
|
|
$$NotesTableCreateCompanionBuilder,
|
|
$$NotesTableUpdateCompanionBuilder,
|
|
(DbNote, BaseReferences<_$AppDatabase, $NotesTable, DbNote>),
|
|
DbNote,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$NotesTableTableManager(_$AppDatabase db, $NotesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$NotesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$NotesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$NotesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String> body = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<int> sortIndex = const Value.absent(),
|
|
Value<int> serverVersion = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<String?> categoryId = const Value.absent(),
|
|
Value<bool> isDirty = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => NotesCompanion(
|
|
id: id,
|
|
title: title,
|
|
body: body,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
sortIndex: sortIndex,
|
|
serverVersion: serverVersion,
|
|
isDeleted: isDeleted,
|
|
categoryId: categoryId,
|
|
isDirty: isDirty,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String title,
|
|
required String body,
|
|
required DateTime createdAt,
|
|
required DateTime updatedAt,
|
|
required int sortIndex,
|
|
Value<int> serverVersion = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<String?> categoryId = const Value.absent(),
|
|
Value<bool> isDirty = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => NotesCompanion.insert(
|
|
id: id,
|
|
title: title,
|
|
body: body,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
sortIndex: sortIndex,
|
|
serverVersion: serverVersion,
|
|
isDeleted: isDeleted,
|
|
categoryId: categoryId,
|
|
isDirty: isDirty,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$NotesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$NotesTable,
|
|
DbNote,
|
|
$$NotesTableFilterComposer,
|
|
$$NotesTableOrderingComposer,
|
|
$$NotesTableAnnotationComposer,
|
|
$$NotesTableCreateCompanionBuilder,
|
|
$$NotesTableUpdateCompanionBuilder,
|
|
(DbNote, BaseReferences<_$AppDatabase, $NotesTable, DbNote>),
|
|
DbNote,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$CategoriesTableCreateCompanionBuilder =
|
|
CategoriesCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
Value<int> serverVersion,
|
|
Value<bool> isDeleted,
|
|
Value<int?> colorValue,
|
|
Value<int?> iconCodePoint,
|
|
Value<bool> isDirty,
|
|
required DateTime updatedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$CategoriesTableUpdateCompanionBuilder =
|
|
CategoriesCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<int> serverVersion,
|
|
Value<bool> isDeleted,
|
|
Value<int?> colorValue,
|
|
Value<int?> iconCodePoint,
|
|
Value<bool> isDirty,
|
|
Value<DateTime> updatedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$CategoriesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $CategoriesTable> {
|
|
$$CategoriesTableFilterComposer({
|
|
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<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get colorValue => $composableBuilder(
|
|
column: $table.colorValue,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get iconCodePoint => $composableBuilder(
|
|
column: $table.iconCodePoint,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$CategoriesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $CategoriesTable> {
|
|
$$CategoriesTableOrderingComposer({
|
|
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<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDeleted => $composableBuilder(
|
|
column: $table.isDeleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get colorValue => $composableBuilder(
|
|
column: $table.colorValue,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get iconCodePoint => $composableBuilder(
|
|
column: $table.iconCodePoint,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$CategoriesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $CategoriesTable> {
|
|
$$CategoriesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get serverVersion => $composableBuilder(
|
|
column: $table.serverVersion,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDeleted =>
|
|
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get colorValue => $composableBuilder(
|
|
column: $table.colorValue,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get iconCodePoint => $composableBuilder(
|
|
column: $table.iconCodePoint,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDirty =>
|
|
$composableBuilder(column: $table.isDirty, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
}
|
|
|
|
class $$CategoriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$CategoriesTable,
|
|
DbCategory,
|
|
$$CategoriesTableFilterComposer,
|
|
$$CategoriesTableOrderingComposer,
|
|
$$CategoriesTableAnnotationComposer,
|
|
$$CategoriesTableCreateCompanionBuilder,
|
|
$$CategoriesTableUpdateCompanionBuilder,
|
|
(
|
|
DbCategory,
|
|
BaseReferences<_$AppDatabase, $CategoriesTable, DbCategory>,
|
|
),
|
|
DbCategory,
|
|
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<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<int> serverVersion = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int?> colorValue = const Value.absent(),
|
|
Value<int?> iconCodePoint = const Value.absent(),
|
|
Value<bool> isDirty = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => CategoriesCompanion(
|
|
id: id,
|
|
name: name,
|
|
serverVersion: serverVersion,
|
|
isDeleted: isDeleted,
|
|
colorValue: colorValue,
|
|
iconCodePoint: iconCodePoint,
|
|
isDirty: isDirty,
|
|
updatedAt: updatedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
Value<int> serverVersion = const Value.absent(),
|
|
Value<bool> isDeleted = const Value.absent(),
|
|
Value<int?> colorValue = const Value.absent(),
|
|
Value<int?> iconCodePoint = const Value.absent(),
|
|
Value<bool> isDirty = const Value.absent(),
|
|
required DateTime updatedAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => CategoriesCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
serverVersion: serverVersion,
|
|
isDeleted: isDeleted,
|
|
colorValue: colorValue,
|
|
iconCodePoint: iconCodePoint,
|
|
isDirty: isDirty,
|
|
updatedAt: updatedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$CategoriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$CategoriesTable,
|
|
DbCategory,
|
|
$$CategoriesTableFilterComposer,
|
|
$$CategoriesTableOrderingComposer,
|
|
$$CategoriesTableAnnotationComposer,
|
|
$$CategoriesTableCreateCompanionBuilder,
|
|
$$CategoriesTableUpdateCompanionBuilder,
|
|
(DbCategory, BaseReferences<_$AppDatabase, $CategoriesTable, DbCategory>),
|
|
DbCategory,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$NotesTableTableManager get notes =>
|
|
$$NotesTableTableManager(_db, _db.notes);
|
|
$$CategoriesTableTableManager get categories =>
|
|
$$CategoriesTableTableManager(_db, _db.categories);
|
|
}
|