// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ignore_for_file: type=lint class $BookmarksTable extends Bookmarks with TableInfo<$BookmarksTable, BookmarkRow> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $BookmarksTable(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, additionalChecks: GeneratedColumn.checkTextLength( minTextLength: 1, maxTextLength: 200, ), type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _urlMeta = const VerificationMeta('url'); @override late final GeneratedColumn url = GeneratedColumn( 'url', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _noteMeta = const VerificationMeta('note'); @override late final GeneratedColumn note = GeneratedColumn( 'note', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, defaultValue: const Constant(''), ); static const VerificationMeta _favoriteMeta = const VerificationMeta( 'favorite', ); @override late final GeneratedColumn favorite = GeneratedColumn( 'favorite', aliasedName, false, type: DriftSqlType.bool, requiredDuringInsert: false, defaultConstraints: GeneratedColumn.constraintIsAlways( 'CHECK ("favorite" IN (0, 1))', ), defaultValue: const Constant(false), ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: false, defaultValue: currentDateAndTime, ); @override List get $columns => [ id, title, url, note, favorite, createdAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'bookmarks'; @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('url')) { context.handle( _urlMeta, url.isAcceptableOrUnknown(data['url']!, _urlMeta), ); } else if (isInserting) { context.missing(_urlMeta); } if (data.containsKey('note')) { context.handle( _noteMeta, note.isAcceptableOrUnknown(data['note']!, _noteMeta), ); } if (data.containsKey('favorite')) { context.handle( _favoriteMeta, favorite.isAcceptableOrUnknown(data['favorite']!, _favoriteMeta), ); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } return context; } @override Set get $primaryKey => {id}; @override BookmarkRow map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return BookmarkRow( id: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}id'], )!, title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], )!, url: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], )!, note: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}note'], )!, favorite: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}favorite'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}created_at'], )!, ); } @override $BookmarksTable createAlias(String alias) { return $BookmarksTable(attachedDatabase, alias); } } class BookmarkRow extends DataClass implements Insertable { final int id; final String title; final String url; final String note; final bool favorite; final DateTime createdAt; const BookmarkRow({ required this.id, required this.title, required this.url, required this.note, required this.favorite, required this.createdAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['title'] = Variable(title); map['url'] = Variable(url); map['note'] = Variable(note); map['favorite'] = Variable(favorite); map['created_at'] = Variable(createdAt); return map; } BookmarksCompanion toCompanion(bool nullToAbsent) { return BookmarksCompanion( id: Value(id), title: Value(title), url: Value(url), note: Value(note), favorite: Value(favorite), createdAt: Value(createdAt), ); } factory BookmarkRow.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return BookmarkRow( id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), url: serializer.fromJson(json['url']), note: serializer.fromJson(json['note']), favorite: serializer.fromJson(json['favorite']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'url': serializer.toJson(url), 'note': serializer.toJson(note), 'favorite': serializer.toJson(favorite), 'createdAt': serializer.toJson(createdAt), }; } BookmarkRow copyWith({ int? id, String? title, String? url, String? note, bool? favorite, DateTime? createdAt, }) => BookmarkRow( id: id ?? this.id, title: title ?? this.title, url: url ?? this.url, note: note ?? this.note, favorite: favorite ?? this.favorite, createdAt: createdAt ?? this.createdAt, ); BookmarkRow copyWithCompanion(BookmarksCompanion data) { return BookmarkRow( id: data.id.present ? data.id.value : this.id, title: data.title.present ? data.title.value : this.title, url: data.url.present ? data.url.value : this.url, note: data.note.present ? data.note.value : this.note, favorite: data.favorite.present ? data.favorite.value : this.favorite, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('BookmarkRow(') ..write('id: $id, ') ..write('title: $title, ') ..write('url: $url, ') ..write('note: $note, ') ..write('favorite: $favorite, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, title, url, note, favorite, createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is BookmarkRow && other.id == this.id && other.title == this.title && other.url == this.url && other.note == this.note && other.favorite == this.favorite && other.createdAt == this.createdAt); } class BookmarksCompanion extends UpdateCompanion { final Value id; final Value title; final Value url; final Value note; final Value favorite; final Value createdAt; const BookmarksCompanion({ this.id = const Value.absent(), this.title = const Value.absent(), this.url = const Value.absent(), this.note = const Value.absent(), this.favorite = const Value.absent(), this.createdAt = const Value.absent(), }); BookmarksCompanion.insert({ this.id = const Value.absent(), required String title, required String url, this.note = const Value.absent(), this.favorite = const Value.absent(), this.createdAt = const Value.absent(), }) : title = Value(title), url = Value(url); static Insertable custom({ Expression? id, Expression? title, Expression? url, Expression? note, Expression? favorite, Expression? createdAt, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (title != null) 'title': title, if (url != null) 'url': url, if (note != null) 'note': note, if (favorite != null) 'favorite': favorite, if (createdAt != null) 'created_at': createdAt, }); } BookmarksCompanion copyWith({ Value? id, Value? title, Value? url, Value? note, Value? favorite, Value? createdAt, }) { return BookmarksCompanion( id: id ?? this.id, title: title ?? this.title, url: url ?? this.url, note: note ?? this.note, favorite: favorite ?? this.favorite, createdAt: createdAt ?? this.createdAt, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (title.present) { map['title'] = Variable(title.value); } if (url.present) { map['url'] = Variable(url.value); } if (note.present) { map['note'] = Variable(note.value); } if (favorite.present) { map['favorite'] = Variable(favorite.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } return map; } @override String toString() { return (StringBuffer('BookmarksCompanion(') ..write('id: $id, ') ..write('title: $title, ') ..write('url: $url, ') ..write('note: $note, ') ..write('favorite: $favorite, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } } abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); late final $BookmarksTable bookmarks = $BookmarksTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [bookmarks]; } typedef $$BookmarksTableCreateCompanionBuilder = BookmarksCompanion Function({ Value id, required String title, required String url, Value note, Value favorite, Value createdAt, }); typedef $$BookmarksTableUpdateCompanionBuilder = BookmarksCompanion Function({ Value id, Value title, Value url, Value note, Value favorite, Value createdAt, }); class $$BookmarksTableFilterComposer extends Composer<_$AppDatabase, $BookmarksTable> { $$BookmarksTableFilterComposer({ 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 url => $composableBuilder( column: $table.url, builder: (column) => ColumnFilters(column), ); ColumnFilters get note => $composableBuilder( column: $table.note, builder: (column) => ColumnFilters(column), ); ColumnFilters get favorite => $composableBuilder( column: $table.favorite, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); } class $$BookmarksTableOrderingComposer extends Composer<_$AppDatabase, $BookmarksTable> { $$BookmarksTableOrderingComposer({ 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 url => $composableBuilder( column: $table.url, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get note => $composableBuilder( column: $table.note, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get favorite => $composableBuilder( column: $table.favorite, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); } class $$BookmarksTableAnnotationComposer extends Composer<_$AppDatabase, $BookmarksTable> { $$BookmarksTableAnnotationComposer({ 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 url => $composableBuilder(column: $table.url, builder: (column) => column); GeneratedColumn get note => $composableBuilder(column: $table.note, builder: (column) => column); GeneratedColumn get favorite => $composableBuilder(column: $table.favorite, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); } class $$BookmarksTableTableManager extends RootTableManager< _$AppDatabase, $BookmarksTable, BookmarkRow, $$BookmarksTableFilterComposer, $$BookmarksTableOrderingComposer, $$BookmarksTableAnnotationComposer, $$BookmarksTableCreateCompanionBuilder, $$BookmarksTableUpdateCompanionBuilder, ( BookmarkRow, BaseReferences<_$AppDatabase, $BookmarksTable, BookmarkRow>, ), BookmarkRow, PrefetchHooks Function() > { $$BookmarksTableTableManager(_$AppDatabase db, $BookmarksTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$BookmarksTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$BookmarksTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$BookmarksTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value title = const Value.absent(), Value url = const Value.absent(), Value note = const Value.absent(), Value favorite = const Value.absent(), Value createdAt = const Value.absent(), }) => BookmarksCompanion( id: id, title: title, url: url, note: note, favorite: favorite, createdAt: createdAt, ), createCompanionCallback: ({ Value id = const Value.absent(), required String title, required String url, Value note = const Value.absent(), Value favorite = const Value.absent(), Value createdAt = const Value.absent(), }) => BookmarksCompanion.insert( id: id, title: title, url: url, note: note, favorite: favorite, createdAt: createdAt, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable<$BookmarksTable, BookmarkRow>(table), BaseReferences<_$AppDatabase, $BookmarksTable, BookmarkRow>( db, table, e, ), ), ) .toList(), prefetchHooksCallback: null, ), ); } typedef $$BookmarksTableProcessedTableManager = ProcessedTableManager< _$AppDatabase, $BookmarksTable, BookmarkRow, $$BookmarksTableFilterComposer, $$BookmarksTableOrderingComposer, $$BookmarksTableAnnotationComposer, $$BookmarksTableCreateCompanionBuilder, $$BookmarksTableUpdateCompanionBuilder, ( BookmarkRow, BaseReferences<_$AppDatabase, $BookmarksTable, BookmarkRow>, ), BookmarkRow, PrefetchHooks Function() >; class $AppDatabaseManager { final _$AppDatabase _db; $AppDatabaseManager(this._db); $$BookmarksTableTableManager get bookmarks => $$BookmarksTableTableManager(_db, _db.bookmarks); }