// 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 id = GeneratedColumn( 'id', aliasedName, false, hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'PRIMARY KEY AUTOINCREMENT', ), ); static const VerificationMeta _titleMeta = const VerificationMeta('title'); @override late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _bodyMeta = const VerificationMeta('body'); @override late final GeneratedColumn body = GeneratedColumn( 'body', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); static const VerificationMeta _updatedAtMeta = const VerificationMeta( 'updatedAt', ); @override late final GeneratedColumn updatedAt = GeneratedColumn( 'updated_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); static const VerificationMeta _sortIndexMeta = const VerificationMeta( 'sortIndex', ); @override late final GeneratedColumn sortIndex = GeneratedColumn( 'sort_index', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); @override List get $columns => [ id, title, body, createdAt, updatedAt, sortIndex, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'notes'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('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); } return context; } @override Set get $primaryKey => {id}; @override DbNote map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DbNote( id: attachedDatabase.typeMapping.read( DriftSqlType.int, 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'], )!, ); } @override $NotesTable createAlias(String alias) { return $NotesTable(attachedDatabase, alias); } } class DbNote extends DataClass implements Insertable { final int id; final String title; final String body; final DateTime createdAt; final DateTime updatedAt; final int sortIndex; const DbNote({ required this.id, required this.title, required this.body, required this.createdAt, required this.updatedAt, required this.sortIndex, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['title'] = Variable(title); map['body'] = Variable(body); map['created_at'] = Variable(createdAt); map['updated_at'] = Variable(updatedAt); map['sort_index'] = Variable(sortIndex); 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), ); } factory DbNote.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return DbNote( id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), body: serializer.fromJson(json['body']), createdAt: serializer.fromJson(json['createdAt']), updatedAt: serializer.fromJson(json['updatedAt']), sortIndex: serializer.fromJson(json['sortIndex']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'body': serializer.toJson(body), 'createdAt': serializer.toJson(createdAt), 'updatedAt': serializer.toJson(updatedAt), 'sortIndex': serializer.toJson(sortIndex), }; } DbNote copyWith({ int? id, String? title, String? body, DateTime? createdAt, DateTime? updatedAt, int? sortIndex, }) => 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, ); 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, ); } @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(')')) .toString(); } @override int get hashCode => Object.hash(id, title, body, createdAt, updatedAt, sortIndex); @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); } class NotesCompanion extends UpdateCompanion { final Value id; final Value title; final Value body; final Value createdAt; final Value updatedAt; final Value sortIndex; 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(), }); NotesCompanion.insert({ this.id = const Value.absent(), required String title, required String body, required DateTime createdAt, required DateTime updatedAt, required int sortIndex, }) : title = Value(title), body = Value(body), createdAt = Value(createdAt), updatedAt = Value(updatedAt), sortIndex = Value(sortIndex); static Insertable custom({ Expression? id, Expression? title, Expression? body, Expression? createdAt, Expression? updatedAt, Expression? sortIndex, }) { 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, }); } NotesCompanion copyWith({ Value? id, Value? title, Value? body, Value? createdAt, Value? updatedAt, Value? sortIndex, }) { 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, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (title.present) { map['title'] = Variable(title.value); } if (body.present) { map['body'] = Variable(body.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (updatedAt.present) { map['updated_at'] = Variable(updatedAt.value); } if (sortIndex.present) { map['sort_index'] = Variable(sortIndex.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(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $NotesTable notes = $NotesTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [notes]; } typedef $$NotesTableCreateCompanionBuilder = NotesCompanion Function({ Value id, required String title, required String body, required DateTime createdAt, required DateTime updatedAt, required int sortIndex, }); typedef $$NotesTableUpdateCompanionBuilder = NotesCompanion Function({ Value id, Value title, Value body, Value createdAt, Value updatedAt, Value sortIndex, }); class $$NotesTableFilterComposer extends Composer<_$AppDatabase, $NotesTable> { $$NotesTableFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column), ); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column), ); ColumnFilters get body => $composableBuilder( column: $table.body, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get sortIndex => $composableBuilder( column: $table.sortIndex, builder: (column) => ColumnFilters(column), ); } class $$NotesTableOrderingComposer extends Composer<_$AppDatabase, $NotesTable> { $$NotesTableOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get body => $composableBuilder( column: $table.body, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get sortIndex => $composableBuilder( column: $table.sortIndex, builder: (column) => ColumnOrderings(column), ); } class $$NotesTableAnnotationComposer extends Composer<_$AppDatabase, $NotesTable> { $$NotesTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get body => $composableBuilder(column: $table.body, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); GeneratedColumn get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); GeneratedColumn get sortIndex => $composableBuilder(column: $table.sortIndex, 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 id = const Value.absent(), Value title = const Value.absent(), Value body = const Value.absent(), Value createdAt = const Value.absent(), Value updatedAt = const Value.absent(), Value sortIndex = const Value.absent(), }) => NotesCompanion( id: id, title: title, body: body, createdAt: createdAt, updatedAt: updatedAt, sortIndex: sortIndex, ), createCompanionCallback: ({ Value id = const Value.absent(), required String title, required String body, required DateTime createdAt, required DateTime updatedAt, required int sortIndex, }) => NotesCompanion.insert( id: id, title: title, body: body, createdAt: createdAt, updatedAt: updatedAt, sortIndex: sortIndex, ), 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() >; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$NotesTableTableManager get notes => $$NotesTableTableManager(_db, _db.notes); }