// dart format width=80 // GENERATED BY drift_dev, DO NOT MODIFY. // ignore_for_file: type=lint,unused_import // import 'package:drift/drift.dart'; class Container extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; Container(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn color = GeneratedColumn( 'color', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn orderKey = GeneratedColumn( 'order_key', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn isPinned = GeneratedColumn( 'is_pinned', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: 'NOT NULL DEFAULT 0', defaultValue: const CustomExpression('0'), ); late final GeneratedColumn metadata = GeneratedColumn( 'metadata', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [ id, name, color, orderKey, isPinned, metadata, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'container'; @override Set get $primaryKey => {id}; @override ContainerData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ContainerData( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, name: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}name'], ), color: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}color'], )!, orderKey: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}order_key'], )!, isPinned: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}is_pinned'], )!, metadata: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}metadata'], ), ); } @override Container createAlias(String alias) { return Container(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class ContainerData extends DataClass implements Insertable { final String id; final String? name; final int color; final String orderKey; final int isPinned; final String? metadata; const ContainerData({ required this.id, this.name, required this.color, required this.orderKey, required this.isPinned, this.metadata, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || name != null) { map['name'] = Variable(name); } map['color'] = Variable(color); map['order_key'] = Variable(orderKey); map['is_pinned'] = Variable(isPinned); if (!nullToAbsent || metadata != null) { map['metadata'] = Variable(metadata); } return map; } factory ContainerData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ContainerData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), color: serializer.fromJson(json['color']), orderKey: serializer.fromJson(json['orderKey']), isPinned: serializer.fromJson(json['isPinned']), metadata: serializer.fromJson(json['metadata']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'color': serializer.toJson(color), 'orderKey': serializer.toJson(orderKey), 'isPinned': serializer.toJson(isPinned), 'metadata': serializer.toJson(metadata), }; } ContainerData copyWith({ String? id, Value name = const Value.absent(), int? color, String? orderKey, int? isPinned, Value metadata = const Value.absent(), }) => ContainerData( id: id ?? this.id, name: name.present ? name.value : this.name, color: color ?? this.color, orderKey: orderKey ?? this.orderKey, isPinned: isPinned ?? this.isPinned, metadata: metadata.present ? metadata.value : this.metadata, ); ContainerData copyWithCompanion(ContainerCompanion data) { return ContainerData( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, color: data.color.present ? data.color.value : this.color, orderKey: data.orderKey.present ? data.orderKey.value : this.orderKey, isPinned: data.isPinned.present ? data.isPinned.value : this.isPinned, metadata: data.metadata.present ? data.metadata.value : this.metadata, ); } @override String toString() { return (StringBuffer('ContainerData(') ..write('id: $id, ') ..write('name: $name, ') ..write('color: $color, ') ..write('orderKey: $orderKey, ') ..write('isPinned: $isPinned, ') ..write('metadata: $metadata') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, color, orderKey, isPinned, metadata); @override bool operator ==(Object other) => identical(this, other) || (other is ContainerData && other.id == this.id && other.name == this.name && other.color == this.color && other.orderKey == this.orderKey && other.isPinned == this.isPinned && other.metadata == this.metadata); } class ContainerCompanion extends UpdateCompanion { final Value id; final Value name; final Value color; final Value orderKey; final Value isPinned; final Value metadata; final Value rowid; const ContainerCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.color = const Value.absent(), this.orderKey = const Value.absent(), this.isPinned = const Value.absent(), this.metadata = const Value.absent(), this.rowid = const Value.absent(), }); ContainerCompanion.insert({ required String id, this.name = const Value.absent(), required int color, required String orderKey, this.isPinned = const Value.absent(), this.metadata = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), color = Value(color), orderKey = Value(orderKey); static Insertable custom({ Expression? id, Expression? name, Expression? color, Expression? orderKey, Expression? isPinned, Expression? metadata, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (color != null) 'color': color, if (orderKey != null) 'order_key': orderKey, if (isPinned != null) 'is_pinned': isPinned, if (metadata != null) 'metadata': metadata, if (rowid != null) 'rowid': rowid, }); } ContainerCompanion copyWith({ Value? id, Value? name, Value? color, Value? orderKey, Value? isPinned, Value? metadata, Value? rowid, }) { return ContainerCompanion( id: id ?? this.id, name: name ?? this.name, color: color ?? this.color, orderKey: orderKey ?? this.orderKey, isPinned: isPinned ?? this.isPinned, metadata: metadata ?? this.metadata, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } if (color.present) { map['color'] = Variable(color.value); } if (orderKey.present) { map['order_key'] = Variable(orderKey.value); } if (isPinned.present) { map['is_pinned'] = Variable(isPinned.value); } if (metadata.present) { map['metadata'] = Variable(metadata.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ContainerCompanion(') ..write('id: $id, ') ..write('name: $name, ') ..write('color: $color, ') ..write('orderKey: $orderKey, ') ..write('isPinned: $isPinned, ') ..write('metadata: $metadata, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class Tab extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; Tab(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumn source = GeneratedColumn( 'source', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn parentId = GeneratedColumn( 'parent_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'REFERENCES tab(id)ON DELETE SET NULL', ); late final GeneratedColumn containerId = GeneratedColumn( 'container_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'REFERENCES container(id)ON DELETE CASCADE', ); late final GeneratedColumn orderKey = GeneratedColumn( 'order_key', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn url = GeneratedColumn( 'url', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn tabMode = GeneratedColumn( 'tab_mode', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: 'NOT NULL DEFAULT 0', defaultValue: const CustomExpression('0'), ); late final GeneratedColumn isolationContextId = GeneratedColumn( 'isolation_context_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn isPinned = GeneratedColumn( 'is_pinned', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: 'NOT NULL DEFAULT 0', defaultValue: const CustomExpression('0'), ); late final GeneratedColumn isProbablyReaderable = GeneratedColumn( 'is_probably_readerable', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentMarkdown = GeneratedColumn( 'extracted_content_markdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentPlain = GeneratedColumn( 'extracted_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentMarkdown = GeneratedColumn( 'full_content_markdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentPlain = GeneratedColumn( 'full_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn timestamp = GeneratedColumn( 'timestamp', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn contentHash = GeneratedColumn( 'content_hash', aliasedName, true, generatedAs: GeneratedAs( const CustomExpression( 'generate_content_hash(title, extracted_content_plain, full_content_plain)', ), false, ), type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: 'GENERATED ALWAYS AS (generate_content_hash(title, extracted_content_plain, full_content_plain)) VIRTUAL', ); @override List get $columns => [ id, source, parentId, containerId, orderKey, url, title, tabMode, isolationContextId, isPinned, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, timestamp, contentHash, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'tab'; @override Set get $primaryKey => {id}; @override TabData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return TabData( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, source: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}source'], )!, parentId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}parent_id'], ), containerId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}container_id'], ), orderKey: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}order_key'], )!, url: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], ), title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), tabMode: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}tab_mode'], )!, isolationContextId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}isolation_context_id'], ), isPinned: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}is_pinned'], )!, isProbablyReaderable: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}is_probably_readerable'], ), extractedContentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_markdown'], ), extractedContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], ), fullContentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_markdown'], ), fullContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_plain'], ), timestamp: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}timestamp'], )!, contentHash: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}content_hash'], ), ); } @override Tab createAlias(String alias) { return Tab(attachedDatabase, alias); } @override List get customConstraints => const [ 'CHECK((tab_mode = 2 AND isolation_context_id IS NOT NULL)OR(tab_mode != 2 AND isolation_context_id IS NULL))', ]; @override bool get dontWriteConstraints => true; } class TabData extends DataClass implements Insertable { final String id; final int source; final String? parentId; final String? containerId; final String orderKey; final String? url; final String? title; final int tabMode; final String? isolationContextId; final int isPinned; final int? isProbablyReaderable; final String? extractedContentMarkdown; final String? extractedContentPlain; final String? fullContentMarkdown; final String? fullContentPlain; final int timestamp; final int? contentHash; const TabData({ required this.id, required this.source, this.parentId, this.containerId, required this.orderKey, this.url, this.title, required this.tabMode, this.isolationContextId, required this.isPinned, this.isProbablyReaderable, this.extractedContentMarkdown, this.extractedContentPlain, this.fullContentMarkdown, this.fullContentPlain, required this.timestamp, this.contentHash, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['source'] = Variable(source); if (!nullToAbsent || parentId != null) { map['parent_id'] = Variable(parentId); } if (!nullToAbsent || containerId != null) { map['container_id'] = Variable(containerId); } map['order_key'] = Variable(orderKey); if (!nullToAbsent || url != null) { map['url'] = Variable(url); } if (!nullToAbsent || title != null) { map['title'] = Variable(title); } map['tab_mode'] = Variable(tabMode); if (!nullToAbsent || isolationContextId != null) { map['isolation_context_id'] = Variable(isolationContextId); } map['is_pinned'] = Variable(isPinned); if (!nullToAbsent || isProbablyReaderable != null) { map['is_probably_readerable'] = Variable(isProbablyReaderable); } if (!nullToAbsent || extractedContentMarkdown != null) { map['extracted_content_markdown'] = Variable( extractedContentMarkdown, ); } if (!nullToAbsent || extractedContentPlain != null) { map['extracted_content_plain'] = Variable(extractedContentPlain); } if (!nullToAbsent || fullContentMarkdown != null) { map['full_content_markdown'] = Variable(fullContentMarkdown); } if (!nullToAbsent || fullContentPlain != null) { map['full_content_plain'] = Variable(fullContentPlain); } map['timestamp'] = Variable(timestamp); return map; } factory TabData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return TabData( id: serializer.fromJson(json['id']), source: serializer.fromJson(json['source']), parentId: serializer.fromJson(json['parentId']), containerId: serializer.fromJson(json['containerId']), orderKey: serializer.fromJson(json['orderKey']), url: serializer.fromJson(json['url']), title: serializer.fromJson(json['title']), tabMode: serializer.fromJson(json['tabMode']), isolationContextId: serializer.fromJson( json['isolationContextId'], ), isPinned: serializer.fromJson(json['isPinned']), isProbablyReaderable: serializer.fromJson( json['isProbablyReaderable'], ), extractedContentMarkdown: serializer.fromJson( json['extractedContentMarkdown'], ), extractedContentPlain: serializer.fromJson( json['extractedContentPlain'], ), fullContentMarkdown: serializer.fromJson( json['fullContentMarkdown'], ), fullContentPlain: serializer.fromJson(json['fullContentPlain']), timestamp: serializer.fromJson(json['timestamp']), contentHash: serializer.fromJson(json['contentHash']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'source': serializer.toJson(source), 'parentId': serializer.toJson(parentId), 'containerId': serializer.toJson(containerId), 'orderKey': serializer.toJson(orderKey), 'url': serializer.toJson(url), 'title': serializer.toJson(title), 'tabMode': serializer.toJson(tabMode), 'isolationContextId': serializer.toJson(isolationContextId), 'isPinned': serializer.toJson(isPinned), 'isProbablyReaderable': serializer.toJson(isProbablyReaderable), 'extractedContentMarkdown': serializer.toJson( extractedContentMarkdown, ), 'extractedContentPlain': serializer.toJson( extractedContentPlain, ), 'fullContentMarkdown': serializer.toJson(fullContentMarkdown), 'fullContentPlain': serializer.toJson(fullContentPlain), 'timestamp': serializer.toJson(timestamp), 'contentHash': serializer.toJson(contentHash), }; } TabData copyWith({ String? id, int? source, Value parentId = const Value.absent(), Value containerId = const Value.absent(), String? orderKey, Value url = const Value.absent(), Value title = const Value.absent(), int? tabMode, Value isolationContextId = const Value.absent(), int? isPinned, Value isProbablyReaderable = const Value.absent(), Value extractedContentMarkdown = const Value.absent(), Value extractedContentPlain = const Value.absent(), Value fullContentMarkdown = const Value.absent(), Value fullContentPlain = const Value.absent(), int? timestamp, Value contentHash = const Value.absent(), }) => TabData( id: id ?? this.id, source: source ?? this.source, parentId: parentId.present ? parentId.value : this.parentId, containerId: containerId.present ? containerId.value : this.containerId, orderKey: orderKey ?? this.orderKey, url: url.present ? url.value : this.url, title: title.present ? title.value : this.title, tabMode: tabMode ?? this.tabMode, isolationContextId: isolationContextId.present ? isolationContextId.value : this.isolationContextId, isPinned: isPinned ?? this.isPinned, isProbablyReaderable: isProbablyReaderable.present ? isProbablyReaderable.value : this.isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown.present ? extractedContentMarkdown.value : this.extractedContentMarkdown, extractedContentPlain: extractedContentPlain.present ? extractedContentPlain.value : this.extractedContentPlain, fullContentMarkdown: fullContentMarkdown.present ? fullContentMarkdown.value : this.fullContentMarkdown, fullContentPlain: fullContentPlain.present ? fullContentPlain.value : this.fullContentPlain, timestamp: timestamp ?? this.timestamp, contentHash: contentHash.present ? contentHash.value : this.contentHash, ); @override String toString() { return (StringBuffer('TabData(') ..write('id: $id, ') ..write('source: $source, ') ..write('parentId: $parentId, ') ..write('containerId: $containerId, ') ..write('orderKey: $orderKey, ') ..write('url: $url, ') ..write('title: $title, ') ..write('tabMode: $tabMode, ') ..write('isolationContextId: $isolationContextId, ') ..write('isPinned: $isPinned, ') ..write('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('timestamp: $timestamp, ') ..write('contentHash: $contentHash') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, source, parentId, containerId, orderKey, url, title, tabMode, isolationContextId, isPinned, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, timestamp, contentHash, ); @override bool operator ==(Object other) => identical(this, other) || (other is TabData && other.id == this.id && other.source == this.source && other.parentId == this.parentId && other.containerId == this.containerId && other.orderKey == this.orderKey && other.url == this.url && other.title == this.title && other.tabMode == this.tabMode && other.isolationContextId == this.isolationContextId && other.isPinned == this.isPinned && other.isProbablyReaderable == this.isProbablyReaderable && other.extractedContentMarkdown == this.extractedContentMarkdown && other.extractedContentPlain == this.extractedContentPlain && other.fullContentMarkdown == this.fullContentMarkdown && other.fullContentPlain == this.fullContentPlain && other.timestamp == this.timestamp && other.contentHash == this.contentHash); } class TabCompanion extends UpdateCompanion { final Value id; final Value source; final Value parentId; final Value containerId; final Value orderKey; final Value url; final Value title; final Value tabMode; final Value isolationContextId; final Value isPinned; final Value isProbablyReaderable; final Value extractedContentMarkdown; final Value extractedContentPlain; final Value fullContentMarkdown; final Value fullContentPlain; final Value timestamp; final Value rowid; const TabCompanion({ this.id = const Value.absent(), this.source = const Value.absent(), this.parentId = const Value.absent(), this.containerId = const Value.absent(), this.orderKey = const Value.absent(), this.url = const Value.absent(), this.title = const Value.absent(), this.tabMode = const Value.absent(), this.isolationContextId = const Value.absent(), this.isPinned = const Value.absent(), this.isProbablyReaderable = const Value.absent(), this.extractedContentMarkdown = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentMarkdown = const Value.absent(), this.fullContentPlain = const Value.absent(), this.timestamp = const Value.absent(), this.rowid = const Value.absent(), }); TabCompanion.insert({ required String id, required int source, this.parentId = const Value.absent(), this.containerId = const Value.absent(), required String orderKey, this.url = const Value.absent(), this.title = const Value.absent(), this.tabMode = const Value.absent(), this.isolationContextId = const Value.absent(), this.isPinned = const Value.absent(), this.isProbablyReaderable = const Value.absent(), this.extractedContentMarkdown = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentMarkdown = const Value.absent(), this.fullContentPlain = const Value.absent(), required int timestamp, this.rowid = const Value.absent(), }) : id = Value(id), source = Value(source), orderKey = Value(orderKey), timestamp = Value(timestamp); static Insertable custom({ Expression? id, Expression? source, Expression? parentId, Expression? containerId, Expression? orderKey, Expression? url, Expression? title, Expression? tabMode, Expression? isolationContextId, Expression? isPinned, Expression? isProbablyReaderable, Expression? extractedContentMarkdown, Expression? extractedContentPlain, Expression? fullContentMarkdown, Expression? fullContentPlain, Expression? timestamp, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (source != null) 'source': source, if (parentId != null) 'parent_id': parentId, if (containerId != null) 'container_id': containerId, if (orderKey != null) 'order_key': orderKey, if (url != null) 'url': url, if (title != null) 'title': title, if (tabMode != null) 'tab_mode': tabMode, if (isolationContextId != null) 'isolation_context_id': isolationContextId, if (isPinned != null) 'is_pinned': isPinned, if (isProbablyReaderable != null) 'is_probably_readerable': isProbablyReaderable, if (extractedContentMarkdown != null) 'extracted_content_markdown': extractedContentMarkdown, if (extractedContentPlain != null) 'extracted_content_plain': extractedContentPlain, if (fullContentMarkdown != null) 'full_content_markdown': fullContentMarkdown, if (fullContentPlain != null) 'full_content_plain': fullContentPlain, if (timestamp != null) 'timestamp': timestamp, if (rowid != null) 'rowid': rowid, }); } TabCompanion copyWith({ Value? id, Value? source, Value? parentId, Value? containerId, Value? orderKey, Value? url, Value? title, Value? tabMode, Value? isolationContextId, Value? isPinned, Value? isProbablyReaderable, Value? extractedContentMarkdown, Value? extractedContentPlain, Value? fullContentMarkdown, Value? fullContentPlain, Value? timestamp, Value? rowid, }) { return TabCompanion( id: id ?? this.id, source: source ?? this.source, parentId: parentId ?? this.parentId, containerId: containerId ?? this.containerId, orderKey: orderKey ?? this.orderKey, url: url ?? this.url, title: title ?? this.title, tabMode: tabMode ?? this.tabMode, isolationContextId: isolationContextId ?? this.isolationContextId, isPinned: isPinned ?? this.isPinned, isProbablyReaderable: isProbablyReaderable ?? this.isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown ?? this.extractedContentMarkdown, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentMarkdown: fullContentMarkdown ?? this.fullContentMarkdown, fullContentPlain: fullContentPlain ?? this.fullContentPlain, timestamp: timestamp ?? this.timestamp, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (source.present) { map['source'] = Variable(source.value); } if (parentId.present) { map['parent_id'] = Variable(parentId.value); } if (containerId.present) { map['container_id'] = Variable(containerId.value); } if (orderKey.present) { map['order_key'] = Variable(orderKey.value); } if (url.present) { map['url'] = Variable(url.value); } if (title.present) { map['title'] = Variable(title.value); } if (tabMode.present) { map['tab_mode'] = Variable(tabMode.value); } if (isolationContextId.present) { map['isolation_context_id'] = Variable(isolationContextId.value); } if (isPinned.present) { map['is_pinned'] = Variable(isPinned.value); } if (isProbablyReaderable.present) { map['is_probably_readerable'] = Variable(isProbablyReaderable.value); } if (extractedContentMarkdown.present) { map['extracted_content_markdown'] = Variable( extractedContentMarkdown.value, ); } if (extractedContentPlain.present) { map['extracted_content_plain'] = Variable( extractedContentPlain.value, ); } if (fullContentMarkdown.present) { map['full_content_markdown'] = Variable( fullContentMarkdown.value, ); } if (fullContentPlain.present) { map['full_content_plain'] = Variable(fullContentPlain.value); } if (timestamp.present) { map['timestamp'] = Variable(timestamp.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('TabCompanion(') ..write('id: $id, ') ..write('source: $source, ') ..write('parentId: $parentId, ') ..write('containerId: $containerId, ') ..write('orderKey: $orderKey, ') ..write('url: $url, ') ..write('title: $title, ') ..write('tabMode: $tabMode, ') ..write('isolationContextId: $isolationContextId, ') ..write('isPinned: $isPinned, ') ..write('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('timestamp: $timestamp, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class ClosedTabTombstone extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; ClosedTabTombstone(this.attachedDatabase, [this._alias]); late final GeneratedColumn tabId = GeneratedColumn( 'tab_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumn closedAt = GeneratedColumn( 'closed_at', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); @override List get $columns => [tabId, closedAt]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'closed_tab_tombstone'; @override Set get $primaryKey => {tabId}; @override ClosedTabTombstoneData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ClosedTabTombstoneData( tabId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tab_id'], )!, closedAt: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}closed_at'], )!, ); } @override ClosedTabTombstone createAlias(String alias) { return ClosedTabTombstone(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class ClosedTabTombstoneData extends DataClass implements Insertable { final String tabId; final int closedAt; const ClosedTabTombstoneData({required this.tabId, required this.closedAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['tab_id'] = Variable(tabId); map['closed_at'] = Variable(closedAt); return map; } factory ClosedTabTombstoneData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ClosedTabTombstoneData( tabId: serializer.fromJson(json['tabId']), closedAt: serializer.fromJson(json['closedAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'tabId': serializer.toJson(tabId), 'closedAt': serializer.toJson(closedAt), }; } ClosedTabTombstoneData copyWith({String? tabId, int? closedAt}) => ClosedTabTombstoneData( tabId: tabId ?? this.tabId, closedAt: closedAt ?? this.closedAt, ); ClosedTabTombstoneData copyWithCompanion(ClosedTabTombstoneCompanion data) { return ClosedTabTombstoneData( tabId: data.tabId.present ? data.tabId.value : this.tabId, closedAt: data.closedAt.present ? data.closedAt.value : this.closedAt, ); } @override String toString() { return (StringBuffer('ClosedTabTombstoneData(') ..write('tabId: $tabId, ') ..write('closedAt: $closedAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash(tabId, closedAt); @override bool operator ==(Object other) => identical(this, other) || (other is ClosedTabTombstoneData && other.tabId == this.tabId && other.closedAt == this.closedAt); } class ClosedTabTombstoneCompanion extends UpdateCompanion { final Value tabId; final Value closedAt; final Value rowid; const ClosedTabTombstoneCompanion({ this.tabId = const Value.absent(), this.closedAt = const Value.absent(), this.rowid = const Value.absent(), }); ClosedTabTombstoneCompanion.insert({ required String tabId, required int closedAt, this.rowid = const Value.absent(), }) : tabId = Value(tabId), closedAt = Value(closedAt); static Insertable custom({ Expression? tabId, Expression? closedAt, Expression? rowid, }) { return RawValuesInsertable({ if (tabId != null) 'tab_id': tabId, if (closedAt != null) 'closed_at': closedAt, if (rowid != null) 'rowid': rowid, }); } ClosedTabTombstoneCompanion copyWith({ Value? tabId, Value? closedAt, Value? rowid, }) { return ClosedTabTombstoneCompanion( tabId: tabId ?? this.tabId, closedAt: closedAt ?? this.closedAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (tabId.present) { map['tab_id'] = Variable(tabId.value); } if (closedAt.present) { map['closed_at'] = Variable(closedAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('ClosedTabTombstoneCompanion(') ..write('tabId: $tabId, ') ..write('closedAt: $closedAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class CaptureTab extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; CaptureTab(this.attachedDatabase, [this._alias]); late final GeneratedColumn tabId = GeneratedColumn( 'tab_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL PRIMARY KEY REFERENCES tab(id)ON DELETE CASCADE', ); late final GeneratedColumn captureId = GeneratedColumn( 'capture_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn sourceUrl = GeneratedColumn( 'source_url', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn status = GeneratedColumn( 'status', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'NOT NULL DEFAULT \'pending\'', defaultValue: const CustomExpression('\'pending\''), ); late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); @override List get $columns => [ tabId, captureId, sourceUrl, status, createdAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'capture_tab'; @override Set get $primaryKey => {tabId}; @override CaptureTabData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return CaptureTabData( tabId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}tab_id'], )!, captureId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}capture_id'], )!, sourceUrl: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}source_url'], )!, status: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}status'], )!, createdAt: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}created_at'], )!, ); } @override CaptureTab createAlias(String alias) { return CaptureTab(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class CaptureTabData extends DataClass implements Insertable { final String tabId; final String captureId; final String sourceUrl; final String status; final int createdAt; const CaptureTabData({ required this.tabId, required this.captureId, required this.sourceUrl, required this.status, required this.createdAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['tab_id'] = Variable(tabId); map['capture_id'] = Variable(captureId); map['source_url'] = Variable(sourceUrl); map['status'] = Variable(status); map['created_at'] = Variable(createdAt); return map; } factory CaptureTabData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return CaptureTabData( tabId: serializer.fromJson(json['tabId']), captureId: serializer.fromJson(json['captureId']), sourceUrl: serializer.fromJson(json['sourceUrl']), status: serializer.fromJson(json['status']), createdAt: serializer.fromJson(json['createdAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'tabId': serializer.toJson(tabId), 'captureId': serializer.toJson(captureId), 'sourceUrl': serializer.toJson(sourceUrl), 'status': serializer.toJson(status), 'createdAt': serializer.toJson(createdAt), }; } CaptureTabData copyWith({ String? tabId, String? captureId, String? sourceUrl, String? status, int? createdAt, }) => CaptureTabData( tabId: tabId ?? this.tabId, captureId: captureId ?? this.captureId, sourceUrl: sourceUrl ?? this.sourceUrl, status: status ?? this.status, createdAt: createdAt ?? this.createdAt, ); CaptureTabData copyWithCompanion(CaptureTabCompanion data) { return CaptureTabData( tabId: data.tabId.present ? data.tabId.value : this.tabId, captureId: data.captureId.present ? data.captureId.value : this.captureId, sourceUrl: data.sourceUrl.present ? data.sourceUrl.value : this.sourceUrl, status: data.status.present ? data.status.value : this.status, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ); } @override String toString() { return (StringBuffer('CaptureTabData(') ..write('tabId: $tabId, ') ..write('captureId: $captureId, ') ..write('sourceUrl: $sourceUrl, ') ..write('status: $status, ') ..write('createdAt: $createdAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash(tabId, captureId, sourceUrl, status, createdAt); @override bool operator ==(Object other) => identical(this, other) || (other is CaptureTabData && other.tabId == this.tabId && other.captureId == this.captureId && other.sourceUrl == this.sourceUrl && other.status == this.status && other.createdAt == this.createdAt); } class CaptureTabCompanion extends UpdateCompanion { final Value tabId; final Value captureId; final Value sourceUrl; final Value status; final Value createdAt; final Value rowid; const CaptureTabCompanion({ this.tabId = const Value.absent(), this.captureId = const Value.absent(), this.sourceUrl = const Value.absent(), this.status = const Value.absent(), this.createdAt = const Value.absent(), this.rowid = const Value.absent(), }); CaptureTabCompanion.insert({ required String tabId, required String captureId, required String sourceUrl, this.status = const Value.absent(), required int createdAt, this.rowid = const Value.absent(), }) : tabId = Value(tabId), captureId = Value(captureId), sourceUrl = Value(sourceUrl), createdAt = Value(createdAt); static Insertable custom({ Expression? tabId, Expression? captureId, Expression? sourceUrl, Expression? status, Expression? createdAt, Expression? rowid, }) { return RawValuesInsertable({ if (tabId != null) 'tab_id': tabId, if (captureId != null) 'capture_id': captureId, if (sourceUrl != null) 'source_url': sourceUrl, if (status != null) 'status': status, if (createdAt != null) 'created_at': createdAt, if (rowid != null) 'rowid': rowid, }); } CaptureTabCompanion copyWith({ Value? tabId, Value? captureId, Value? sourceUrl, Value? status, Value? createdAt, Value? rowid, }) { return CaptureTabCompanion( tabId: tabId ?? this.tabId, captureId: captureId ?? this.captureId, sourceUrl: sourceUrl ?? this.sourceUrl, status: status ?? this.status, createdAt: createdAt ?? this.createdAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (tabId.present) { map['tab_id'] = Variable(tabId.value); } if (captureId.present) { map['capture_id'] = Variable(captureId.value); } if (sourceUrl.present) { map['source_url'] = Variable(sourceUrl.value); } if (status.present) { map['status'] = Variable(status.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('CaptureTabCompanion(') ..write('tabId: $tabId, ') ..write('captureId: $captureId, ') ..write('sourceUrl: $sourceUrl, ') ..write('status: $status, ') ..write('createdAt: $createdAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class TabFts extends Table with TableInfo, VirtualTableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; TabFts(this.attachedDatabase, [this._alias]); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn url = GeneratedColumn( 'url', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentPlain = GeneratedColumn( 'extracted_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentPlain = GeneratedColumn( 'full_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [ title, url, extractedContentPlain, fullContentPlain, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'tab_fts'; @override Set get $primaryKey => const {}; @override TabFtsData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return TabFtsData( title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), url: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], ), extractedContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], ), fullContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_plain'], ), ); } @override TabFts createAlias(String alias) { return TabFts(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; @override String get moduleAndArgs => 'fts5(title, url, extracted_content_plain, full_content_plain, content=tab, tokenize="trigram")'; } class TabFtsData extends DataClass implements Insertable { final String? title; final String? url; final String? extractedContentPlain; final String? fullContentPlain; const TabFtsData({ this.title, this.url, this.extractedContentPlain, this.fullContentPlain, }); @override Map toColumns(bool nullToAbsent) { final map = {}; if (!nullToAbsent || title != null) { map['title'] = Variable(title); } if (!nullToAbsent || url != null) { map['url'] = Variable(url); } if (!nullToAbsent || extractedContentPlain != null) { map['extracted_content_plain'] = Variable(extractedContentPlain); } if (!nullToAbsent || fullContentPlain != null) { map['full_content_plain'] = Variable(fullContentPlain); } return map; } factory TabFtsData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return TabFtsData( title: serializer.fromJson(json['title']), url: serializer.fromJson(json['url']), extractedContentPlain: serializer.fromJson( json['extractedContentPlain'], ), fullContentPlain: serializer.fromJson(json['fullContentPlain']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'title': serializer.toJson(title), 'url': serializer.toJson(url), 'extractedContentPlain': serializer.toJson( extractedContentPlain, ), 'fullContentPlain': serializer.toJson(fullContentPlain), }; } TabFtsData copyWith({ Value title = const Value.absent(), Value url = const Value.absent(), Value extractedContentPlain = const Value.absent(), Value fullContentPlain = const Value.absent(), }) => TabFtsData( title: title.present ? title.value : this.title, url: url.present ? url.value : this.url, extractedContentPlain: extractedContentPlain.present ? extractedContentPlain.value : this.extractedContentPlain, fullContentPlain: fullContentPlain.present ? fullContentPlain.value : this.fullContentPlain, ); TabFtsData copyWithCompanion(TabFtsCompanion data) { return TabFtsData( title: data.title.present ? data.title.value : this.title, url: data.url.present ? data.url.value : this.url, extractedContentPlain: data.extractedContentPlain.present ? data.extractedContentPlain.value : this.extractedContentPlain, fullContentPlain: data.fullContentPlain.present ? data.fullContentPlain.value : this.fullContentPlain, ); } @override String toString() { return (StringBuffer('TabFtsData(') ..write('title: $title, ') ..write('url: $url, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentPlain: $fullContentPlain') ..write(')')) .toString(); } @override int get hashCode => Object.hash(title, url, extractedContentPlain, fullContentPlain); @override bool operator ==(Object other) => identical(this, other) || (other is TabFtsData && other.title == this.title && other.url == this.url && other.extractedContentPlain == this.extractedContentPlain && other.fullContentPlain == this.fullContentPlain); } class TabFtsCompanion extends UpdateCompanion { final Value title; final Value url; final Value extractedContentPlain; final Value fullContentPlain; final Value rowid; const TabFtsCompanion({ this.title = const Value.absent(), this.url = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentPlain = const Value.absent(), this.rowid = const Value.absent(), }); TabFtsCompanion.insert({ this.title = const Value.absent(), this.url = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentPlain = const Value.absent(), this.rowid = const Value.absent(), }); static Insertable custom({ Expression? title, Expression? url, Expression? extractedContentPlain, Expression? fullContentPlain, Expression? rowid, }) { return RawValuesInsertable({ if (title != null) 'title': title, if (url != null) 'url': url, if (extractedContentPlain != null) 'extracted_content_plain': extractedContentPlain, if (fullContentPlain != null) 'full_content_plain': fullContentPlain, if (rowid != null) 'rowid': rowid, }); } TabFtsCompanion copyWith({ Value? title, Value? url, Value? extractedContentPlain, Value? fullContentPlain, Value? rowid, }) { return TabFtsCompanion( title: title ?? this.title, url: url ?? this.url, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentPlain: fullContentPlain ?? this.fullContentPlain, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (title.present) { map['title'] = Variable(title.value); } if (url.present) { map['url'] = Variable(url.value); } if (extractedContentPlain.present) { map['extracted_content_plain'] = Variable( extractedContentPlain.value, ); } if (fullContentPlain.present) { map['full_content_plain'] = Variable(fullContentPlain.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('TabFtsCompanion(') ..write('title: $title, ') ..write('url: $url, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class LocalIndexSetting extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; LocalIndexSetting(this.attachedDatabase, [this._alias]); late final GeneratedColumn key = GeneratedColumn( 'key', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumn value = GeneratedColumn( 'value', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); @override List get $columns => [key, value]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'local_index_setting'; @override Set get $primaryKey => {key}; @override LocalIndexSettingData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return LocalIndexSettingData( key: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}key'], )!, value: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}value'], )!, ); } @override LocalIndexSetting createAlias(String alias) { return LocalIndexSetting(attachedDatabase, alias); } @override bool get isStrict => true; @override bool get dontWriteConstraints => true; } class LocalIndexSettingData extends DataClass implements Insertable { final String key; final int value; const LocalIndexSettingData({required this.key, required this.value}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['key'] = Variable(key); map['value'] = Variable(value); return map; } factory LocalIndexSettingData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return LocalIndexSettingData( key: serializer.fromJson(json['key']), value: serializer.fromJson(json['value']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'key': serializer.toJson(key), 'value': serializer.toJson(value), }; } LocalIndexSettingData copyWith({String? key, int? value}) => LocalIndexSettingData(key: key ?? this.key, value: value ?? this.value); LocalIndexSettingData copyWithCompanion(LocalIndexSettingCompanion data) { return LocalIndexSettingData( key: data.key.present ? data.key.value : this.key, value: data.value.present ? data.value.value : this.value, ); } @override String toString() { return (StringBuffer('LocalIndexSettingData(') ..write('key: $key, ') ..write('value: $value') ..write(')')) .toString(); } @override int get hashCode => Object.hash(key, value); @override bool operator ==(Object other) => identical(this, other) || (other is LocalIndexSettingData && other.key == this.key && other.value == this.value); } class LocalIndexSettingCompanion extends UpdateCompanion { final Value key; final Value value; final Value rowid; const LocalIndexSettingCompanion({ this.key = const Value.absent(), this.value = const Value.absent(), this.rowid = const Value.absent(), }); LocalIndexSettingCompanion.insert({ required String key, required int value, this.rowid = const Value.absent(), }) : key = Value(key), value = Value(value); static Insertable custom({ Expression? key, Expression? value, Expression? rowid, }) { return RawValuesInsertable({ if (key != null) 'key': key, if (value != null) 'value': value, if (rowid != null) 'rowid': rowid, }); } LocalIndexSettingCompanion copyWith({ Value? key, Value? value, Value? rowid, }) { return LocalIndexSettingCompanion( key: key ?? this.key, value: value ?? this.value, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (key.present) { map['key'] = Variable(key.value); } if (value.present) { map['value'] = Variable(value.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('LocalIndexSettingCompanion(') ..write('key: $key, ') ..write('value: $value, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class History extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; History(this.attachedDatabase, [this._alias]); late final GeneratedColumn urlCanonical = GeneratedColumn( 'url_canonical', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); late final GeneratedColumn urlHost = GeneratedColumn( 'url_host', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn urlPath = GeneratedColumn( 'url_path', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn isProbablyReaderable = GeneratedColumn( 'is_probably_readerable', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentMarkdown = GeneratedColumn( 'extracted_content_markdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentPlain = GeneratedColumn( 'extracted_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentMarkdown = GeneratedColumn( 'full_content_markdown', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentPlain = GeneratedColumn( 'full_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn contentHash = GeneratedColumn( 'content_hash', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn observedAt = GeneratedColumn( 'observed_at', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); late final GeneratedColumn observedCount = GeneratedColumn( 'observed_count', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: 'NOT NULL DEFAULT 1', defaultValue: const CustomExpression('1'), ); @override List get $columns => [ urlCanonical, urlHost, urlPath, title, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, contentHash, observedAt, observedCount, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'history'; @override Set get $primaryKey => {urlCanonical}; @override HistoryData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return HistoryData( urlCanonical: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url_canonical'], )!, urlHost: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url_host'], )!, urlPath: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url_path'], ), title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), isProbablyReaderable: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}is_probably_readerable'], ), extractedContentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_markdown'], ), extractedContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], ), fullContentMarkdown: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_markdown'], ), fullContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_plain'], ), contentHash: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}content_hash'], ), observedAt: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}observed_at'], )!, observedCount: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}observed_count'], )!, ); } @override History createAlias(String alias) { return History(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class HistoryData extends DataClass implements Insertable { final String urlCanonical; final String urlHost; final String? urlPath; final String? title; final int? isProbablyReaderable; final String? extractedContentMarkdown; final String? extractedContentPlain; final String? fullContentMarkdown; final String? fullContentPlain; final int? contentHash; final int observedAt; final int observedCount; const HistoryData({ required this.urlCanonical, required this.urlHost, this.urlPath, this.title, this.isProbablyReaderable, this.extractedContentMarkdown, this.extractedContentPlain, this.fullContentMarkdown, this.fullContentPlain, this.contentHash, required this.observedAt, required this.observedCount, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['url_canonical'] = Variable(urlCanonical); map['url_host'] = Variable(urlHost); if (!nullToAbsent || urlPath != null) { map['url_path'] = Variable(urlPath); } if (!nullToAbsent || title != null) { map['title'] = Variable(title); } if (!nullToAbsent || isProbablyReaderable != null) { map['is_probably_readerable'] = Variable(isProbablyReaderable); } if (!nullToAbsent || extractedContentMarkdown != null) { map['extracted_content_markdown'] = Variable( extractedContentMarkdown, ); } if (!nullToAbsent || extractedContentPlain != null) { map['extracted_content_plain'] = Variable(extractedContentPlain); } if (!nullToAbsent || fullContentMarkdown != null) { map['full_content_markdown'] = Variable(fullContentMarkdown); } if (!nullToAbsent || fullContentPlain != null) { map['full_content_plain'] = Variable(fullContentPlain); } if (!nullToAbsent || contentHash != null) { map['content_hash'] = Variable(contentHash); } map['observed_at'] = Variable(observedAt); map['observed_count'] = Variable(observedCount); return map; } factory HistoryData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return HistoryData( urlCanonical: serializer.fromJson(json['urlCanonical']), urlHost: serializer.fromJson(json['urlHost']), urlPath: serializer.fromJson(json['urlPath']), title: serializer.fromJson(json['title']), isProbablyReaderable: serializer.fromJson( json['isProbablyReaderable'], ), extractedContentMarkdown: serializer.fromJson( json['extractedContentMarkdown'], ), extractedContentPlain: serializer.fromJson( json['extractedContentPlain'], ), fullContentMarkdown: serializer.fromJson( json['fullContentMarkdown'], ), fullContentPlain: serializer.fromJson(json['fullContentPlain']), contentHash: serializer.fromJson(json['contentHash']), observedAt: serializer.fromJson(json['observedAt']), observedCount: serializer.fromJson(json['observedCount']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'urlCanonical': serializer.toJson(urlCanonical), 'urlHost': serializer.toJson(urlHost), 'urlPath': serializer.toJson(urlPath), 'title': serializer.toJson(title), 'isProbablyReaderable': serializer.toJson(isProbablyReaderable), 'extractedContentMarkdown': serializer.toJson( extractedContentMarkdown, ), 'extractedContentPlain': serializer.toJson( extractedContentPlain, ), 'fullContentMarkdown': serializer.toJson(fullContentMarkdown), 'fullContentPlain': serializer.toJson(fullContentPlain), 'contentHash': serializer.toJson(contentHash), 'observedAt': serializer.toJson(observedAt), 'observedCount': serializer.toJson(observedCount), }; } HistoryData copyWith({ String? urlCanonical, String? urlHost, Value urlPath = const Value.absent(), Value title = const Value.absent(), Value isProbablyReaderable = const Value.absent(), Value extractedContentMarkdown = const Value.absent(), Value extractedContentPlain = const Value.absent(), Value fullContentMarkdown = const Value.absent(), Value fullContentPlain = const Value.absent(), Value contentHash = const Value.absent(), int? observedAt, int? observedCount, }) => HistoryData( urlCanonical: urlCanonical ?? this.urlCanonical, urlHost: urlHost ?? this.urlHost, urlPath: urlPath.present ? urlPath.value : this.urlPath, title: title.present ? title.value : this.title, isProbablyReaderable: isProbablyReaderable.present ? isProbablyReaderable.value : this.isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown.present ? extractedContentMarkdown.value : this.extractedContentMarkdown, extractedContentPlain: extractedContentPlain.present ? extractedContentPlain.value : this.extractedContentPlain, fullContentMarkdown: fullContentMarkdown.present ? fullContentMarkdown.value : this.fullContentMarkdown, fullContentPlain: fullContentPlain.present ? fullContentPlain.value : this.fullContentPlain, contentHash: contentHash.present ? contentHash.value : this.contentHash, observedAt: observedAt ?? this.observedAt, observedCount: observedCount ?? this.observedCount, ); HistoryData copyWithCompanion(HistoryCompanion data) { return HistoryData( urlCanonical: data.urlCanonical.present ? data.urlCanonical.value : this.urlCanonical, urlHost: data.urlHost.present ? data.urlHost.value : this.urlHost, urlPath: data.urlPath.present ? data.urlPath.value : this.urlPath, title: data.title.present ? data.title.value : this.title, isProbablyReaderable: data.isProbablyReaderable.present ? data.isProbablyReaderable.value : this.isProbablyReaderable, extractedContentMarkdown: data.extractedContentMarkdown.present ? data.extractedContentMarkdown.value : this.extractedContentMarkdown, extractedContentPlain: data.extractedContentPlain.present ? data.extractedContentPlain.value : this.extractedContentPlain, fullContentMarkdown: data.fullContentMarkdown.present ? data.fullContentMarkdown.value : this.fullContentMarkdown, fullContentPlain: data.fullContentPlain.present ? data.fullContentPlain.value : this.fullContentPlain, contentHash: data.contentHash.present ? data.contentHash.value : this.contentHash, observedAt: data.observedAt.present ? data.observedAt.value : this.observedAt, observedCount: data.observedCount.present ? data.observedCount.value : this.observedCount, ); } @override String toString() { return (StringBuffer('HistoryData(') ..write('urlCanonical: $urlCanonical, ') ..write('urlHost: $urlHost, ') ..write('urlPath: $urlPath, ') ..write('title: $title, ') ..write('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('contentHash: $contentHash, ') ..write('observedAt: $observedAt, ') ..write('observedCount: $observedCount') ..write(')')) .toString(); } @override int get hashCode => Object.hash( urlCanonical, urlHost, urlPath, title, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, contentHash, observedAt, observedCount, ); @override bool operator ==(Object other) => identical(this, other) || (other is HistoryData && other.urlCanonical == this.urlCanonical && other.urlHost == this.urlHost && other.urlPath == this.urlPath && other.title == this.title && other.isProbablyReaderable == this.isProbablyReaderable && other.extractedContentMarkdown == this.extractedContentMarkdown && other.extractedContentPlain == this.extractedContentPlain && other.fullContentMarkdown == this.fullContentMarkdown && other.fullContentPlain == this.fullContentPlain && other.contentHash == this.contentHash && other.observedAt == this.observedAt && other.observedCount == this.observedCount); } class HistoryCompanion extends UpdateCompanion { final Value urlCanonical; final Value urlHost; final Value urlPath; final Value title; final Value isProbablyReaderable; final Value extractedContentMarkdown; final Value extractedContentPlain; final Value fullContentMarkdown; final Value fullContentPlain; final Value contentHash; final Value observedAt; final Value observedCount; final Value rowid; const HistoryCompanion({ this.urlCanonical = const Value.absent(), this.urlHost = const Value.absent(), this.urlPath = const Value.absent(), this.title = const Value.absent(), this.isProbablyReaderable = const Value.absent(), this.extractedContentMarkdown = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentMarkdown = const Value.absent(), this.fullContentPlain = const Value.absent(), this.contentHash = const Value.absent(), this.observedAt = const Value.absent(), this.observedCount = const Value.absent(), this.rowid = const Value.absent(), }); HistoryCompanion.insert({ required String urlCanonical, required String urlHost, this.urlPath = const Value.absent(), this.title = const Value.absent(), this.isProbablyReaderable = const Value.absent(), this.extractedContentMarkdown = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentMarkdown = const Value.absent(), this.fullContentPlain = const Value.absent(), this.contentHash = const Value.absent(), required int observedAt, this.observedCount = const Value.absent(), this.rowid = const Value.absent(), }) : urlCanonical = Value(urlCanonical), urlHost = Value(urlHost), observedAt = Value(observedAt); static Insertable custom({ Expression? urlCanonical, Expression? urlHost, Expression? urlPath, Expression? title, Expression? isProbablyReaderable, Expression? extractedContentMarkdown, Expression? extractedContentPlain, Expression? fullContentMarkdown, Expression? fullContentPlain, Expression? contentHash, Expression? observedAt, Expression? observedCount, Expression? rowid, }) { return RawValuesInsertable({ if (urlCanonical != null) 'url_canonical': urlCanonical, if (urlHost != null) 'url_host': urlHost, if (urlPath != null) 'url_path': urlPath, if (title != null) 'title': title, if (isProbablyReaderable != null) 'is_probably_readerable': isProbablyReaderable, if (extractedContentMarkdown != null) 'extracted_content_markdown': extractedContentMarkdown, if (extractedContentPlain != null) 'extracted_content_plain': extractedContentPlain, if (fullContentMarkdown != null) 'full_content_markdown': fullContentMarkdown, if (fullContentPlain != null) 'full_content_plain': fullContentPlain, if (contentHash != null) 'content_hash': contentHash, if (observedAt != null) 'observed_at': observedAt, if (observedCount != null) 'observed_count': observedCount, if (rowid != null) 'rowid': rowid, }); } HistoryCompanion copyWith({ Value? urlCanonical, Value? urlHost, Value? urlPath, Value? title, Value? isProbablyReaderable, Value? extractedContentMarkdown, Value? extractedContentPlain, Value? fullContentMarkdown, Value? fullContentPlain, Value? contentHash, Value? observedAt, Value? observedCount, Value? rowid, }) { return HistoryCompanion( urlCanonical: urlCanonical ?? this.urlCanonical, urlHost: urlHost ?? this.urlHost, urlPath: urlPath ?? this.urlPath, title: title ?? this.title, isProbablyReaderable: isProbablyReaderable ?? this.isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown ?? this.extractedContentMarkdown, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentMarkdown: fullContentMarkdown ?? this.fullContentMarkdown, fullContentPlain: fullContentPlain ?? this.fullContentPlain, contentHash: contentHash ?? this.contentHash, observedAt: observedAt ?? this.observedAt, observedCount: observedCount ?? this.observedCount, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (urlCanonical.present) { map['url_canonical'] = Variable(urlCanonical.value); } if (urlHost.present) { map['url_host'] = Variable(urlHost.value); } if (urlPath.present) { map['url_path'] = Variable(urlPath.value); } if (title.present) { map['title'] = Variable(title.value); } if (isProbablyReaderable.present) { map['is_probably_readerable'] = Variable(isProbablyReaderable.value); } if (extractedContentMarkdown.present) { map['extracted_content_markdown'] = Variable( extractedContentMarkdown.value, ); } if (extractedContentPlain.present) { map['extracted_content_plain'] = Variable( extractedContentPlain.value, ); } if (fullContentMarkdown.present) { map['full_content_markdown'] = Variable( fullContentMarkdown.value, ); } if (fullContentPlain.present) { map['full_content_plain'] = Variable(fullContentPlain.value); } if (contentHash.present) { map['content_hash'] = Variable(contentHash.value); } if (observedAt.present) { map['observed_at'] = Variable(observedAt.value); } if (observedCount.present) { map['observed_count'] = Variable(observedCount.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('HistoryCompanion(') ..write('urlCanonical: $urlCanonical, ') ..write('urlHost: $urlHost, ') ..write('urlPath: $urlPath, ') ..write('title: $title, ') ..write('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('contentHash: $contentHash, ') ..write('observedAt: $observedAt, ') ..write('observedCount: $observedCount, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class HistoryFts extends Table with TableInfo, VirtualTableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; HistoryFts(this.attachedDatabase, [this._alias]); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn urlHost = GeneratedColumn( 'url_host', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn urlPath = GeneratedColumn( 'url_path', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn extractedContentPlain = GeneratedColumn( 'extracted_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); late final GeneratedColumn fullContentPlain = GeneratedColumn( 'full_content_plain', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [ title, urlHost, urlPath, extractedContentPlain, fullContentPlain, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'history_fts'; @override Set get $primaryKey => const {}; @override HistoryFtsData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return HistoryFtsData( title: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}title'], ), urlHost: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url_host'], ), urlPath: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url_path'], ), extractedContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], ), fullContentPlain: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}full_content_plain'], ), ); } @override HistoryFts createAlias(String alias) { return HistoryFts(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; @override String get moduleAndArgs => 'fts5(title, url_host, url_path, extracted_content_plain, full_content_plain, content=history, tokenize="trigram")'; } class HistoryFtsData extends DataClass implements Insertable { final String? title; final String? urlHost; final String? urlPath; final String? extractedContentPlain; final String? fullContentPlain; const HistoryFtsData({ this.title, this.urlHost, this.urlPath, this.extractedContentPlain, this.fullContentPlain, }); @override Map toColumns(bool nullToAbsent) { final map = {}; if (!nullToAbsent || title != null) { map['title'] = Variable(title); } if (!nullToAbsent || urlHost != null) { map['url_host'] = Variable(urlHost); } if (!nullToAbsent || urlPath != null) { map['url_path'] = Variable(urlPath); } if (!nullToAbsent || extractedContentPlain != null) { map['extracted_content_plain'] = Variable(extractedContentPlain); } if (!nullToAbsent || fullContentPlain != null) { map['full_content_plain'] = Variable(fullContentPlain); } return map; } factory HistoryFtsData.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return HistoryFtsData( title: serializer.fromJson(json['title']), urlHost: serializer.fromJson(json['urlHost']), urlPath: serializer.fromJson(json['urlPath']), extractedContentPlain: serializer.fromJson( json['extractedContentPlain'], ), fullContentPlain: serializer.fromJson(json['fullContentPlain']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'title': serializer.toJson(title), 'urlHost': serializer.toJson(urlHost), 'urlPath': serializer.toJson(urlPath), 'extractedContentPlain': serializer.toJson( extractedContentPlain, ), 'fullContentPlain': serializer.toJson(fullContentPlain), }; } HistoryFtsData copyWith({ Value title = const Value.absent(), Value urlHost = const Value.absent(), Value urlPath = const Value.absent(), Value extractedContentPlain = const Value.absent(), Value fullContentPlain = const Value.absent(), }) => HistoryFtsData( title: title.present ? title.value : this.title, urlHost: urlHost.present ? urlHost.value : this.urlHost, urlPath: urlPath.present ? urlPath.value : this.urlPath, extractedContentPlain: extractedContentPlain.present ? extractedContentPlain.value : this.extractedContentPlain, fullContentPlain: fullContentPlain.present ? fullContentPlain.value : this.fullContentPlain, ); HistoryFtsData copyWithCompanion(HistoryFtsCompanion data) { return HistoryFtsData( title: data.title.present ? data.title.value : this.title, urlHost: data.urlHost.present ? data.urlHost.value : this.urlHost, urlPath: data.urlPath.present ? data.urlPath.value : this.urlPath, extractedContentPlain: data.extractedContentPlain.present ? data.extractedContentPlain.value : this.extractedContentPlain, fullContentPlain: data.fullContentPlain.present ? data.fullContentPlain.value : this.fullContentPlain, ); } @override String toString() { return (StringBuffer('HistoryFtsData(') ..write('title: $title, ') ..write('urlHost: $urlHost, ') ..write('urlPath: $urlPath, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentPlain: $fullContentPlain') ..write(')')) .toString(); } @override int get hashCode => Object.hash( title, urlHost, urlPath, extractedContentPlain, fullContentPlain, ); @override bool operator ==(Object other) => identical(this, other) || (other is HistoryFtsData && other.title == this.title && other.urlHost == this.urlHost && other.urlPath == this.urlPath && other.extractedContentPlain == this.extractedContentPlain && other.fullContentPlain == this.fullContentPlain); } class HistoryFtsCompanion extends UpdateCompanion { final Value title; final Value urlHost; final Value urlPath; final Value extractedContentPlain; final Value fullContentPlain; final Value rowid; const HistoryFtsCompanion({ this.title = const Value.absent(), this.urlHost = const Value.absent(), this.urlPath = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentPlain = const Value.absent(), this.rowid = const Value.absent(), }); HistoryFtsCompanion.insert({ this.title = const Value.absent(), this.urlHost = const Value.absent(), this.urlPath = const Value.absent(), this.extractedContentPlain = const Value.absent(), this.fullContentPlain = const Value.absent(), this.rowid = const Value.absent(), }); static Insertable custom({ Expression? title, Expression? urlHost, Expression? urlPath, Expression? extractedContentPlain, Expression? fullContentPlain, Expression? rowid, }) { return RawValuesInsertable({ if (title != null) 'title': title, if (urlHost != null) 'url_host': urlHost, if (urlPath != null) 'url_path': urlPath, if (extractedContentPlain != null) 'extracted_content_plain': extractedContentPlain, if (fullContentPlain != null) 'full_content_plain': fullContentPlain, if (rowid != null) 'rowid': rowid, }); } HistoryFtsCompanion copyWith({ Value? title, Value? urlHost, Value? urlPath, Value? extractedContentPlain, Value? fullContentPlain, Value? rowid, }) { return HistoryFtsCompanion( title: title ?? this.title, urlHost: urlHost ?? this.urlHost, urlPath: urlPath ?? this.urlPath, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentPlain: fullContentPlain ?? this.fullContentPlain, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (title.present) { map['title'] = Variable(title.value); } if (urlHost.present) { map['url_host'] = Variable(urlHost.value); } if (urlPath.present) { map['url_path'] = Variable(urlPath.value); } if (extractedContentPlain.present) { map['extracted_content_plain'] = Variable( extractedContentPlain.value, ); } if (fullContentPlain.present) { map['full_content_plain'] = Variable(fullContentPlain.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('HistoryFtsCompanion(') ..write('title: $title, ') ..write('urlHost: $urlHost, ') ..write('urlPath: $urlPath, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class DatabaseAtV14 extends GeneratedDatabase { DatabaseAtV14(QueryExecutor e) : super(e); late final Container container = Container(this); late final Tab tab = Tab(this); late final ClosedTabTombstone closedTabTombstone = ClosedTabTombstone(this); late final Index idxTabParentContainer = Index( 'idx_tab_parent_container', 'CREATE INDEX idx_tab_parent_container ON tab (parent_id, container_id)', ); late final CaptureTab captureTab = CaptureTab(this); late final Index idxCaptureTabCaptureId = Index( 'idx_capture_tab_capture_id', 'CREATE INDEX idx_capture_tab_capture_id ON capture_tab (capture_id)', ); late final TabFts tabFts = TabFts(this); late final Trigger tabMaintainParentChainOnDelete = Trigger( 'CREATE TRIGGER tab_maintain_parent_chain_on_delete BEFORE DELETE ON tab BEGIN UPDATE tab SET parent_id = CASE WHEN OLD.parent_id IS NOT NULL AND EXISTS (SELECT 1 FROM tab WHERE id = OLD.parent_id) THEN OLD.parent_id ELSE NULL END WHERE parent_id = OLD.id;END', 'tab_maintain_parent_chain_on_delete', ); late final Trigger tabAfterInsert = Trigger( 'CREATE TRIGGER tab_after_insert AFTER INSERT ON tab BEGIN INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', 'tab_after_insert', ); late final Trigger tabAfterDelete = Trigger( 'CREATE TRIGGER tab_after_delete AFTER DELETE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);END', 'tab_after_delete', ); late final Trigger tabAfterUpdate = Trigger( 'CREATE TRIGGER tab_after_update AFTER UPDATE OF title, url, extracted_content_plain, full_content_plain ON tab WHEN OLD.content_hash IS NOT NEW.content_hash OR OLD.url IS NOT NEW.url BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', 'tab_after_update', ); late final LocalIndexSetting localIndexSetting = LocalIndexSetting(this); late final History history = History(this); late final Index idxHistoryHost = Index( 'idx_history_host', 'CREATE INDEX idx_history_host ON history (url_host)', ); late final Index idxHistoryObserved = Index( 'idx_history_observed', 'CREATE INDEX idx_history_observed ON history (observed_at DESC)', ); late final HistoryFts historyFts = HistoryFts(this); late final Trigger historyAfterInsert = Trigger( 'CREATE TRIGGER history_after_insert AFTER INSERT ON history BEGIN INSERT INTO history_fts ("rowid", title, url_host, url_path, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url_host, new.url_path, new.extracted_content_plain, new.full_content_plain);END', 'history_after_insert', ); late final Trigger historyAfterDelete = Trigger( 'CREATE TRIGGER history_after_delete AFTER DELETE ON history BEGIN INSERT INTO history_fts (history_fts, "rowid", title, url_host, url_path, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url_host, old.url_path, old.extracted_content_plain, old.full_content_plain);END', 'history_after_delete', ); late final Trigger historyAfterUpdate = Trigger( 'CREATE TRIGGER history_after_update AFTER UPDATE OF title, url_host, url_path, extracted_content_plain, full_content_plain ON history BEGIN INSERT INTO history_fts (history_fts, "rowid", title, url_host, url_path, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url_host, old.url_path, old.extracted_content_plain, old.full_content_plain);INSERT INTO history_fts ("rowid", title, url_host, url_path, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url_host, new.url_path, new.extracted_content_plain, new.full_content_plain);END', 'history_after_update', ); late final Trigger tabToHistoryOnInsert = Trigger( 'CREATE TRIGGER tab_to_history_on_insert AFTER INSERT ON tab WHEN NEW.url IS NOT NULL AND url_indexable(CAST(NEW.url AS TEXT)) = 1 AND (SELECT value FROM local_index_setting WHERE "key" = \'enabled\') = 1 AND(NEW.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = NEW.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1) BEGIN INSERT INTO history (url_canonical, url_host, url_path, title, is_probably_readerable, extracted_content_markdown, extracted_content_plain, full_content_markdown, full_content_plain, content_hash, observed_at, observed_count) VALUES (url_canonical(CAST(NEW.url AS TEXT)), url_host(CAST(NEW.url AS TEXT)), url_path(CAST(NEW.url AS TEXT)), NEW.title, NEW.is_probably_readerable, NEW.extracted_content_markdown, NEW.extracted_content_plain, NEW.full_content_markdown, NEW.full_content_plain, NEW.content_hash, strftime(\'%s\', \'now\') * 1000, 1) ON CONFLICT (url_canonical) DO UPDATE SET title = COALESCE(excluded.title, history.title), is_probably_readerable = excluded.is_probably_readerable, extracted_content_markdown = excluded.extracted_content_markdown, extracted_content_plain = excluded.extracted_content_plain, full_content_markdown = excluded.full_content_markdown, full_content_plain = excluded.full_content_plain, content_hash = excluded.content_hash, observed_at = excluded.observed_at, observed_count = history.observed_count + 1 WHERE history.content_hash IS NOT excluded.content_hash;END', 'tab_to_history_on_insert', ); late final Trigger tabToHistoryOnUpdate = Trigger( 'CREATE TRIGGER tab_to_history_on_update AFTER UPDATE OF title, url, extracted_content_plain, extracted_content_markdown, full_content_plain, full_content_markdown, is_probably_readerable ON tab WHEN NEW.url IS NOT NULL AND url_indexable(CAST(NEW.url AS TEXT)) = 1 AND(OLD.content_hash IS NOT NEW.content_hash OR OLD.url IS NOT NEW.url)AND (SELECT value FROM local_index_setting WHERE "key" = \'enabled\') = 1 AND(NEW.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = NEW.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1) BEGIN INSERT INTO history (url_canonical, url_host, url_path, title, is_probably_readerable, extracted_content_markdown, extracted_content_plain, full_content_markdown, full_content_plain, content_hash, observed_at, observed_count) VALUES (url_canonical(CAST(NEW.url AS TEXT)), url_host(CAST(NEW.url AS TEXT)), url_path(CAST(NEW.url AS TEXT)), NEW.title, NEW.is_probably_readerable, NEW.extracted_content_markdown, NEW.extracted_content_plain, NEW.full_content_markdown, NEW.full_content_plain, NEW.content_hash, strftime(\'%s\', \'now\') * 1000, 1) ON CONFLICT (url_canonical) DO UPDATE SET title = COALESCE(excluded.title, history.title), is_probably_readerable = excluded.is_probably_readerable, extracted_content_markdown = excluded.extracted_content_markdown, extracted_content_plain = excluded.extracted_content_plain, full_content_markdown = excluded.full_content_markdown, full_content_plain = excluded.full_content_plain, content_hash = excluded.content_hash, observed_at = excluded.observed_at, observed_count = history.observed_count + 1 WHERE history.content_hash IS NOT excluded.content_hash;END', 'tab_to_history_on_update', ); late final Trigger tabToHistoryOnContainerUpdate = Trigger( 'CREATE TRIGGER tab_to_history_on_container_update AFTER UPDATE OF container_id ON tab WHEN NEW.url IS NOT NULL AND url_indexable(CAST(NEW.url AS TEXT)) = 1 AND (SELECT value FROM local_index_setting WHERE "key" = \'enabled\') = 1 BEGIN DELETE FROM history WHERE url_canonical = url_canonical(CAST(NEW.url AS TEXT)) AND NOT EXISTS (SELECT 1 FROM tab AS candidate WHERE candidate.url IS NOT NULL AND url_indexable(CAST(candidate.url AS TEXT)) = 1 AND url_canonical(CAST(candidate.url AS TEXT)) = history.url_canonical AND(candidate.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = candidate.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1));INSERT INTO history (url_canonical, url_host, url_path, title, is_probably_readerable, extracted_content_markdown, extracted_content_plain, full_content_markdown, full_content_plain, content_hash, observed_at, observed_count) SELECT url_canonical(CAST(candidate.url AS TEXT)), url_host(CAST(candidate.url AS TEXT)), url_path(CAST(candidate.url AS TEXT)), candidate.title, candidate.is_probably_readerable, candidate.extracted_content_markdown, candidate.extracted_content_plain, candidate.full_content_markdown, candidate.full_content_plain, candidate.content_hash, strftime(\'%s\', \'now\') * 1000, 1 FROM tab AS candidate WHERE candidate.url IS NOT NULL AND url_indexable(CAST(candidate.url AS TEXT)) = 1 AND url_canonical(CAST(candidate.url AS TEXT)) = url_canonical(CAST(NEW.url AS TEXT)) AND(candidate.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = candidate.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1) ORDER BY candidate.timestamp DESC, candidate."rowid" DESC LIMIT 1 ON CONFLICT (url_canonical) DO UPDATE SET title = COALESCE(excluded.title, history.title), is_probably_readerable = excluded.is_probably_readerable, extracted_content_markdown = excluded.extracted_content_markdown, extracted_content_plain = excluded.extracted_content_plain, full_content_markdown = excluded.full_content_markdown, full_content_plain = excluded.full_content_plain, content_hash = excluded.content_hash, observed_at = excluded.observed_at, observed_count = history.observed_count + 1;END', 'tab_to_history_on_container_update', ); late final Trigger containerToHistoryOnMetadataUpdate = Trigger( 'CREATE TRIGGER container_to_history_on_metadata_update AFTER UPDATE OF metadata ON container WHEN COALESCE(json_extract(OLD.metadata, \'\$.excludeFromIndex\') = 1, 0) != COALESCE(json_extract(NEW.metadata, \'\$.excludeFromIndex\') = 1, 0) AND (SELECT value FROM local_index_setting WHERE "key" = \'enabled\') = 1 BEGIN DELETE FROM history WHERE url_canonical IN (SELECT DISTINCT url_canonical(CAST(affected.url AS TEXT)) FROM tab AS affected WHERE affected.container_id = NEW.id AND affected.url IS NOT NULL AND url_indexable(CAST(affected.url AS TEXT)) = 1) AND NOT EXISTS (SELECT 1 FROM tab AS candidate WHERE candidate.url IS NOT NULL AND url_indexable(CAST(candidate.url AS TEXT)) = 1 AND url_canonical(CAST(candidate.url AS TEXT)) = history.url_canonical AND(candidate.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = candidate.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1));INSERT INTO history (url_canonical, url_host, url_path, title, is_probably_readerable, extracted_content_markdown, extracted_content_plain, full_content_markdown, full_content_plain, content_hash, observed_at, observed_count) SELECT url_canonical(CAST(candidate.url AS TEXT)), url_host(CAST(candidate.url AS TEXT)), url_path(CAST(candidate.url AS TEXT)), candidate.title, candidate.is_probably_readerable, candidate.extracted_content_markdown, candidate.extracted_content_plain, candidate.full_content_markdown, candidate.full_content_plain, candidate.content_hash, strftime(\'%s\', \'now\') * 1000, 1 FROM tab AS candidate WHERE candidate.url IS NOT NULL AND url_indexable(CAST(candidate.url AS TEXT)) = 1 AND url_canonical(CAST(candidate.url AS TEXT)) IN (SELECT DISTINCT url_canonical(CAST(affected.url AS TEXT)) FROM tab AS affected WHERE affected.container_id = NEW.id AND affected.url IS NOT NULL AND url_indexable(CAST(affected.url AS TEXT)) = 1) AND(candidate.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = candidate.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1) AND NOT EXISTS (SELECT 1 FROM tab AS newer WHERE newer.url IS NOT NULL AND url_indexable(CAST(newer.url AS TEXT)) = 1 AND url_canonical(CAST(newer.url AS TEXT)) = url_canonical(CAST(candidate.url AS TEXT)) AND(newer.tab_mode != 1 OR (SELECT value FROM local_index_setting WHERE "key" = \'index_private\') = 1)AND NOT EXISTS (SELECT 1 FROM container WHERE container.id = newer.container_id AND json_extract(container.metadata, \'\$.excludeFromIndex\') = 1) AND(newer.timestamp > candidate.timestamp OR(newer.timestamp = candidate.timestamp AND newer."rowid" > candidate."rowid"))) ON CONFLICT (url_canonical) DO UPDATE SET title = COALESCE(excluded.title, history.title), is_probably_readerable = excluded.is_probably_readerable, extracted_content_markdown = excluded.extracted_content_markdown, extracted_content_plain = excluded.extracted_content_plain, full_content_markdown = excluded.full_content_markdown, full_content_plain = excluded.full_content_plain, content_hash = excluded.content_hash, observed_at = excluded.observed_at, observed_count = history.observed_count + 1;END', 'container_to_history_on_metadata_update', ); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ container, tab, closedTabTombstone, idxTabParentContainer, captureTab, idxCaptureTabCaptureId, tabFts, tabMaintainParentChainOnDelete, tabAfterInsert, tabAfterDelete, tabAfterUpdate, localIndexSetting, history, idxHistoryHost, idxHistoryObserved, historyFts, historyAfterInsert, historyAfterDelete, historyAfterUpdate, tabToHistoryOnInsert, tabToHistoryOnUpdate, tabToHistoryOnContainerUpdate, containerToHistoryOnMetadataUpdate, ]; @override StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ WritePropagation( on: TableUpdateQuery.onTableName( 'container', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('tab', kind: UpdateKind.delete)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('capture_tab', kind: UpdateKind.delete)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('tab', kind: UpdateKind.update)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.insert, ), result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.update, ), result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'history', limitUpdateKind: UpdateKind.insert, ), result: [TableUpdate('history_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'history', limitUpdateKind: UpdateKind.delete, ), result: [TableUpdate('history_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'history', limitUpdateKind: UpdateKind.update, ), result: [TableUpdate('history_fts', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.insert, ), result: [TableUpdate('history', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.update, ), result: [TableUpdate('history', kind: UpdateKind.insert)], ), WritePropagation( on: TableUpdateQuery.onTableName( 'tab', limitUpdateKind: UpdateKind.update, ), result: [ TableUpdate('history', kind: UpdateKind.delete), TableUpdate('history', kind: UpdateKind.insert), ], ), WritePropagation( on: TableUpdateQuery.onTableName( 'container', limitUpdateKind: UpdateKind.update, ), result: [ TableUpdate('history', kind: UpdateKind.delete), TableUpdate('history', kind: UpdateKind.insert), ], ), ]); @override int get schemaVersion => 14; }