// 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 metadata = GeneratedColumn( 'metadata', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); @override List get $columns => [id, name, color, 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'], )!, 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? metadata; const ContainerData({ required this.id, this.name, required this.color, 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); 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']), 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), 'metadata': serializer.toJson(metadata), }; } ContainerData copyWith({ String? id, Value name = const Value.absent(), int? color, Value metadata = const Value.absent(), }) => ContainerData( id: id ?? this.id, name: name.present ? name.value : this.name, color: color ?? this.color, 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, 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('metadata: $metadata') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name, color, 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.metadata == this.metadata); } class ContainerCompanion extends UpdateCompanion { final Value id; final Value name; final Value color; final Value metadata; final Value rowid; const ContainerCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), this.color = 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, this.metadata = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), color = Value(color); static Insertable custom({ Expression? id, Expression? name, Expression? color, Expression? metadata, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (color != null) 'color': color, if (metadata != null) 'metadata': metadata, if (rowid != null) 'rowid': rowid, }); } ContainerCompanion copyWith({ Value? id, Value? name, Value? color, Value? metadata, Value? rowid, }) { return ContainerCompanion( id: id ?? this.id, name: name ?? this.name, color: color ?? this.color, 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 (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('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 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', ); @override List get $columns => [ id, source, parentId, containerId, orderKey, url, title, tabMode, isolationContextId, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, timestamp, ]; @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'], ), 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'], )!, ); } @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? isProbablyReaderable; final String? extractedContentMarkdown; final String? extractedContentPlain; final String? fullContentMarkdown; final String? fullContentPlain; final int timestamp; const TabData({ required this.id, required this.source, this.parentId, this.containerId, required this.orderKey, this.url, this.title, required this.tabMode, this.isolationContextId, this.isProbablyReaderable, this.extractedContentMarkdown, this.extractedContentPlain, this.fullContentMarkdown, this.fullContentPlain, required this.timestamp, }); @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); } 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'], ), 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']), ); } @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), 'isProbablyReaderable': serializer.toJson(isProbablyReaderable), 'extractedContentMarkdown': serializer.toJson( extractedContentMarkdown, ), 'extractedContentPlain': serializer.toJson( extractedContentPlain, ), 'fullContentMarkdown': serializer.toJson(fullContentMarkdown), 'fullContentPlain': serializer.toJson(fullContentPlain), 'timestamp': serializer.toJson(timestamp), }; } 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(), 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, }) => 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, 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, ); TabData copyWithCompanion(TabCompanion data) { return TabData( id: data.id.present ? data.id.value : this.id, source: data.source.present ? data.source.value : this.source, parentId: data.parentId.present ? data.parentId.value : this.parentId, containerId: data.containerId.present ? data.containerId.value : this.containerId, orderKey: data.orderKey.present ? data.orderKey.value : this.orderKey, url: data.url.present ? data.url.value : this.url, title: data.title.present ? data.title.value : this.title, tabMode: data.tabMode.present ? data.tabMode.value : this.tabMode, isolationContextId: data.isolationContextId.present ? data.isolationContextId.value : this.isolationContextId, 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, timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp, ); } @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('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('timestamp: $timestamp') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, source, parentId, containerId, orderKey, url, title, tabMode, isolationContextId, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, timestamp, ); @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.isProbablyReaderable == this.isProbablyReaderable && other.extractedContentMarkdown == this.extractedContentMarkdown && other.extractedContentPlain == this.extractedContentPlain && other.fullContentMarkdown == this.fullContentMarkdown && other.fullContentPlain == this.fullContentPlain && other.timestamp == this.timestamp); } 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 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.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.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? 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 (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? 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, 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 (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('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('timestamp: $timestamp, ') ..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 DatabaseAtV6 extends GeneratedDatabase { DatabaseAtV6(QueryExecutor e) : super(e); late final Container container = Container(this); late final Tab tab = Tab(this); 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 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);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', ); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ container, tab, tabFts, tabMaintainParentChainOnDelete, tabAfterInsert, tabAfterDelete, tabAfterUpdate, ]; @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('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)], ), ]); @override int get schemaVersion => 6; }