// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ignore_for_file: type=lint 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 GeneratedColumnWithTypeConverter color = GeneratedColumn('color', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL') .withConverter(Container.$convertercolor); late final GeneratedColumnWithTypeConverter metadata = GeneratedColumn('metadata', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '') .withConverter(Container.$convertermetadatan); @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: Container.$convertercolor.fromSql(attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}color'])!), metadata: Container.$convertermetadatan.fromSql(attachedDatabase .typeMapping .read(DriftSqlType.string, data['${effectivePrefix}metadata'])), ); } @override Container createAlias(String alias) { return Container(attachedDatabase, alias); } static TypeConverter $convertercolor = const ColorConverter(); static TypeConverter $convertermetadata = const ContainerMetadataConverter(); static TypeConverter $convertermetadatan = NullAwareTypeConverter.wrap($convertermetadata); @override bool get dontWriteConstraints => true; } 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 Color 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(Container.$convertercolor.toSql(color.value)); } if (metadata.present) { map['metadata'] = Variable(Container.$convertermetadatan.toSql(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 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 isProbablyReaderable = GeneratedColumn( 'is_probably_readerable', aliasedName, true, type: DriftSqlType.bool, 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.dateTime, requiredDuringInsert: true, $customConstraints: 'NOT NULL'); @override List get $columns => [ id, containerId, orderKey, url, title, 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'])!, 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']), isProbablyReaderable: attachedDatabase.typeMapping.read( DriftSqlType.bool, 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.dateTime, data['${effectivePrefix}timestamp'])!, ); } @override Tab createAlias(String alias) { return Tab(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class TabData extends DataClass implements Insertable { final String id; final String? containerId; final String orderKey; final String? url; final String? title; final bool? isProbablyReaderable; final String? extractedContentMarkdown; final String? extractedContentPlain; final String? fullContentMarkdown; final String? fullContentPlain; final DateTime timestamp; const TabData( {required this.id, this.containerId, required this.orderKey, this.url, this.title, this.isProbablyReaderable, this.extractedContentMarkdown, this.extractedContentPlain, this.fullContentMarkdown, this.fullContentPlain, required this.timestamp}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); 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); } 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']), containerId: serializer.fromJson(json['container_id']), orderKey: serializer.fromJson(json['order_key']), url: serializer.fromJson(json['url']), title: serializer.fromJson(json['title']), isProbablyReaderable: serializer.fromJson(json['is_probably_readerable']), extractedContentMarkdown: serializer.fromJson(json['extracted_content_markdown']), extractedContentPlain: serializer.fromJson(json['extracted_content_plain']), fullContentMarkdown: serializer.fromJson(json['full_content_markdown']), fullContentPlain: serializer.fromJson(json['full_content_plain']), timestamp: serializer.fromJson(json['timestamp']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'container_id': serializer.toJson(containerId), 'order_key': serializer.toJson(orderKey), 'url': serializer.toJson(url), 'title': serializer.toJson(title), 'is_probably_readerable': serializer.toJson(isProbablyReaderable), 'extracted_content_markdown': serializer.toJson(extractedContentMarkdown), 'extracted_content_plain': serializer.toJson(extractedContentPlain), 'full_content_markdown': serializer.toJson(fullContentMarkdown), 'full_content_plain': serializer.toJson(fullContentPlain), 'timestamp': serializer.toJson(timestamp), }; } TabData copyWith( {String? id, Value containerId = const Value.absent(), String? orderKey, Value url = 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(), DateTime? timestamp}) => TabData( id: id ?? this.id, 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, 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, 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, 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('containerId: $containerId, ') ..write('orderKey: $orderKey, ') ..write('url: $url, ') ..write('title: $title, ') ..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, containerId, orderKey, url, title, isProbablyReaderable, extractedContentMarkdown, extractedContentPlain, fullContentMarkdown, fullContentPlain, timestamp); @override bool operator ==(Object other) => identical(this, other) || (other is TabData && other.id == this.id && other.containerId == this.containerId && other.orderKey == this.orderKey && other.url == this.url && 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.timestamp == this.timestamp); } class TabCompanion extends UpdateCompanion { final Value id; final Value containerId; final Value orderKey; final Value url; final Value title; 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.containerId = const Value.absent(), this.orderKey = const Value.absent(), this.url = 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.timestamp = const Value.absent(), this.rowid = const Value.absent(), }); TabCompanion.insert({ required String id, this.containerId = const Value.absent(), required String orderKey, this.url = 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(), required DateTime timestamp, this.rowid = const Value.absent(), }) : id = Value(id), orderKey = Value(orderKey), timestamp = Value(timestamp); static Insertable custom({ Expression? id, Expression? containerId, Expression? orderKey, Expression? url, Expression? title, Expression? isProbablyReaderable, Expression? extractedContentMarkdown, Expression? extractedContentPlain, Expression? fullContentMarkdown, Expression? fullContentPlain, Expression? timestamp, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (containerId != null) 'container_id': containerId, if (orderKey != null) 'order_key': orderKey, if (url != null) 'url': url, 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 (timestamp != null) 'timestamp': timestamp, if (rowid != null) 'rowid': rowid, }); } TabCompanion copyWith( {Value? id, Value? containerId, Value? orderKey, Value? url, Value? title, Value? isProbablyReaderable, Value? extractedContentMarkdown, Value? extractedContentPlain, Value? fullContentMarkdown, Value? fullContentPlain, Value? timestamp, Value? rowid}) { return TabCompanion( id: id ?? this.id, containerId: containerId ?? this.containerId, orderKey: orderKey ?? this.orderKey, url: url ?? this.url, title: title ?? this.title, 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 (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 (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('containerId: $containerId, ') ..write('orderKey: $orderKey, ') ..write('url: $url, ') ..write('title: $title, ') ..write('isProbablyReaderable: $isProbablyReaderable, ') ..write('extractedContentMarkdown: $extractedContentMarkdown, ') ..write('extractedContentPlain: $extractedContentPlain, ') ..write('fullContentMarkdown: $fullContentMarkdown, ') ..write('fullContentPlain: $fullContentPlain, ') ..write('timestamp: $timestamp, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } class Document extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; Document(this.attachedDatabase, [this._alias]); late final GeneratedColumn documentId = GeneratedColumn( 'document_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL PRIMARY KEY'); late final GeneratedColumn mainDocumentId = GeneratedColumn( 'main_document_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: ''); late final GeneratedColumn contextId = GeneratedColumn( 'context_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: ''); late final GeneratedColumn content = GeneratedColumn( 'content', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL'); late final GeneratedColumn contentHash = GeneratedColumn( 'content_hash', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL'); late final GeneratedColumn metadata = GeneratedColumn( 'metadata', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: ''); @override List get $columns => [documentId, mainDocumentId, contextId, content, contentHash, metadata]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'document'; @override Set get $primaryKey => {documentId}; @override DocumentData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DocumentData( documentId: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}document_id'])!, mainDocumentId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}main_document_id']), contextId: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}context_id']), content: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}content'])!, contentHash: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}content_hash'])!, metadata: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}metadata']), ); } @override Document createAlias(String alias) { return Document(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class DocumentData extends DataClass implements Insertable { final String documentId; final String? mainDocumentId; final String? contextId; final String content; final String contentHash; final String? metadata; const DocumentData( {required this.documentId, this.mainDocumentId, this.contextId, required this.content, required this.contentHash, this.metadata}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['document_id'] = Variable(documentId); if (!nullToAbsent || mainDocumentId != null) { map['main_document_id'] = Variable(mainDocumentId); } if (!nullToAbsent || contextId != null) { map['context_id'] = Variable(contextId); } map['content'] = Variable(content); map['content_hash'] = Variable(contentHash); if (!nullToAbsent || metadata != null) { map['metadata'] = Variable(metadata); } return map; } factory DocumentData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return DocumentData( documentId: serializer.fromJson(json['document_id']), mainDocumentId: serializer.fromJson(json['main_document_id']), contextId: serializer.fromJson(json['context_id']), content: serializer.fromJson(json['content']), contentHash: serializer.fromJson(json['content_hash']), metadata: serializer.fromJson(json['metadata']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'document_id': serializer.toJson(documentId), 'main_document_id': serializer.toJson(mainDocumentId), 'context_id': serializer.toJson(contextId), 'content': serializer.toJson(content), 'content_hash': serializer.toJson(contentHash), 'metadata': serializer.toJson(metadata), }; } DocumentData copyWith( {String? documentId, Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), String? content, String? contentHash, Value metadata = const Value.absent()}) => DocumentData( documentId: documentId ?? this.documentId, mainDocumentId: mainDocumentId.present ? mainDocumentId.value : this.mainDocumentId, contextId: contextId.present ? contextId.value : this.contextId, content: content ?? this.content, contentHash: contentHash ?? this.contentHash, metadata: metadata.present ? metadata.value : this.metadata, ); DocumentData copyWithCompanion(DocumentCompanion data) { return DocumentData( documentId: data.documentId.present ? data.documentId.value : this.documentId, mainDocumentId: data.mainDocumentId.present ? data.mainDocumentId.value : this.mainDocumentId, contextId: data.contextId.present ? data.contextId.value : this.contextId, content: data.content.present ? data.content.value : this.content, contentHash: data.contentHash.present ? data.contentHash.value : this.contentHash, metadata: data.metadata.present ? data.metadata.value : this.metadata, ); } @override String toString() { return (StringBuffer('DocumentData(') ..write('documentId: $documentId, ') ..write('mainDocumentId: $mainDocumentId, ') ..write('contextId: $contextId, ') ..write('content: $content, ') ..write('contentHash: $contentHash, ') ..write('metadata: $metadata') ..write(')')) .toString(); } @override int get hashCode => Object.hash( documentId, mainDocumentId, contextId, content, contentHash, metadata); @override bool operator ==(Object other) => identical(this, other) || (other is DocumentData && other.documentId == this.documentId && other.mainDocumentId == this.mainDocumentId && other.contextId == this.contextId && other.content == this.content && other.contentHash == this.contentHash && other.metadata == this.metadata); } class DocumentCompanion extends UpdateCompanion { final Value documentId; final Value mainDocumentId; final Value contextId; final Value content; final Value contentHash; final Value metadata; final Value rowid; const DocumentCompanion({ this.documentId = const Value.absent(), this.mainDocumentId = const Value.absent(), this.contextId = const Value.absent(), this.content = const Value.absent(), this.contentHash = const Value.absent(), this.metadata = const Value.absent(), this.rowid = const Value.absent(), }); DocumentCompanion.insert({ required String documentId, this.mainDocumentId = const Value.absent(), this.contextId = const Value.absent(), required String content, required String contentHash, this.metadata = const Value.absent(), this.rowid = const Value.absent(), }) : documentId = Value(documentId), content = Value(content), contentHash = Value(contentHash); static Insertable custom({ Expression? documentId, Expression? mainDocumentId, Expression? contextId, Expression? content, Expression? contentHash, Expression? metadata, Expression? rowid, }) { return RawValuesInsertable({ if (documentId != null) 'document_id': documentId, if (mainDocumentId != null) 'main_document_id': mainDocumentId, if (contextId != null) 'context_id': contextId, if (content != null) 'content': content, if (contentHash != null) 'content_hash': contentHash, if (metadata != null) 'metadata': metadata, if (rowid != null) 'rowid': rowid, }); } DocumentCompanion copyWith( {Value? documentId, Value? mainDocumentId, Value? contextId, Value? content, Value? contentHash, Value? metadata, Value? rowid}) { return DocumentCompanion( documentId: documentId ?? this.documentId, mainDocumentId: mainDocumentId ?? this.mainDocumentId, contextId: contextId ?? this.contextId, content: content ?? this.content, contentHash: contentHash ?? this.contentHash, metadata: metadata ?? this.metadata, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (documentId.present) { map['document_id'] = Variable(documentId.value); } if (mainDocumentId.present) { map['main_document_id'] = Variable(mainDocumentId.value); } if (contextId.present) { map['context_id'] = Variable(contextId.value); } if (content.present) { map['content'] = Variable(content.value); } if (contentHash.present) { map['content_hash'] = Variable(contentHash.value); } if (metadata.present) { map['metadata'] = Variable(metadata.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('DocumentCompanion(') ..write('documentId: $documentId, ') ..write('mainDocumentId: $mainDocumentId, ') ..write('contextId: $contextId, ') ..write('content: $content, ') ..write('contentHash: $contentHash, ') ..write('metadata: $metadata, ') ..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, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: ''); late final GeneratedColumn url = GeneratedColumn( 'url', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: ''); late final GeneratedColumn extractedContentPlain = GeneratedColumn('extracted_content_plain', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: ''); late final GeneratedColumn fullContentPlain = GeneratedColumn( 'full_content_plain', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $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 TabFt map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return TabFt( 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 TabFt extends DataClass implements Insertable { final String title; final String url; final String extractedContentPlain; final String fullContentPlain; const TabFt( {required this.title, required this.url, required this.extractedContentPlain, required this.fullContentPlain}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['title'] = Variable(title); map['url'] = Variable(url); map['extracted_content_plain'] = Variable(extractedContentPlain); map['full_content_plain'] = Variable(fullContentPlain); return map; } factory TabFt.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return TabFt( title: serializer.fromJson(json['title']), url: serializer.fromJson(json['url']), extractedContentPlain: serializer.fromJson(json['extracted_content_plain']), fullContentPlain: serializer.fromJson(json['full_content_plain']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'title': serializer.toJson(title), 'url': serializer.toJson(url), 'extracted_content_plain': serializer.toJson(extractedContentPlain), 'full_content_plain': serializer.toJson(fullContentPlain), }; } TabFt copyWith( {String? title, String? url, String? extractedContentPlain, String? fullContentPlain}) => TabFt( title: title ?? this.title, url: url ?? this.url, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentPlain: fullContentPlain ?? this.fullContentPlain, ); TabFt copyWithCompanion(TabFtsCompanion data) { return TabFt( 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('TabFt(') ..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 TabFt && 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({ required String title, required String url, required String extractedContentPlain, required String fullContentPlain, this.rowid = const Value.absent(), }) : title = Value(title), url = Value(url), extractedContentPlain = Value(extractedContentPlain), fullContentPlain = Value(fullContentPlain); 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 DocumentVec extends Table with TableInfo { @override final GeneratedDatabase attachedDatabase; final String? _alias; DocumentVec(this.attachedDatabase, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL PRIMARY KEY'); late final GeneratedColumn mainDocumentId = GeneratedColumn( 'main_document_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: ''); late final GeneratedColumn contextId = GeneratedColumn( 'context_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, $customConstraints: ''); late final GeneratedColumn embedding = GeneratedColumn( 'embedding', aliasedName, false, type: DriftSqlType.blob, requiredDuringInsert: true, $customConstraints: 'NOT NULL'); late final GeneratedColumn contentHash = GeneratedColumn( 'content_hash', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL'); late final GeneratedColumn distance = GeneratedColumn( 'distance', aliasedName, true, type: DriftSqlType.double, requiredDuringInsert: false, $customConstraints: ''); late final GeneratedColumn k = GeneratedColumn( 'k', aliasedName, true, type: DriftSqlType.int, requiredDuringInsert: false, $customConstraints: ''); @override List get $columns => [id, mainDocumentId, contextId, embedding, contentHash, distance, k]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'document_vec'; @override Set get $primaryKey => {id}; @override DocumentVecData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DocumentVecData( id: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}id'])!, mainDocumentId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}main_document_id']), contextId: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}context_id']), embedding: attachedDatabase.typeMapping .read(DriftSqlType.blob, data['${effectivePrefix}embedding'])!, contentHash: attachedDatabase.typeMapping .read(DriftSqlType.string, data['${effectivePrefix}content_hash'])!, distance: attachedDatabase.typeMapping .read(DriftSqlType.double, data['${effectivePrefix}distance']), k: attachedDatabase.typeMapping .read(DriftSqlType.int, data['${effectivePrefix}k']), ); } @override DocumentVec createAlias(String alias) { return DocumentVec(attachedDatabase, alias); } @override bool get dontWriteConstraints => true; } class DocumentVecData extends DataClass implements Insertable { /// dummy definition of virtual table /// keep in sync with defined table definition final String id; final String? mainDocumentId; final String? contextId; final Uint8List embedding; final String contentHash; final double? distance; final int? k; const DocumentVecData( {required this.id, this.mainDocumentId, this.contextId, required this.embedding, required this.contentHash, this.distance, this.k}); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); if (!nullToAbsent || mainDocumentId != null) { map['main_document_id'] = Variable(mainDocumentId); } if (!nullToAbsent || contextId != null) { map['context_id'] = Variable(contextId); } map['embedding'] = Variable(embedding); map['content_hash'] = Variable(contentHash); if (!nullToAbsent || distance != null) { map['distance'] = Variable(distance); } if (!nullToAbsent || k != null) { map['k'] = Variable(k); } return map; } factory DocumentVecData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return DocumentVecData( id: serializer.fromJson(json['id']), mainDocumentId: serializer.fromJson(json['main_document_id']), contextId: serializer.fromJson(json['context_id']), embedding: serializer.fromJson(json['embedding']), contentHash: serializer.fromJson(json['content_hash']), distance: serializer.fromJson(json['distance']), k: serializer.fromJson(json['k']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'main_document_id': serializer.toJson(mainDocumentId), 'context_id': serializer.toJson(contextId), 'embedding': serializer.toJson(embedding), 'content_hash': serializer.toJson(contentHash), 'distance': serializer.toJson(distance), 'k': serializer.toJson(k), }; } DocumentVecData copyWith( {String? id, Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), Uint8List? embedding, String? contentHash, Value distance = const Value.absent(), Value k = const Value.absent()}) => DocumentVecData( id: id ?? this.id, mainDocumentId: mainDocumentId.present ? mainDocumentId.value : this.mainDocumentId, contextId: contextId.present ? contextId.value : this.contextId, embedding: embedding ?? this.embedding, contentHash: contentHash ?? this.contentHash, distance: distance.present ? distance.value : this.distance, k: k.present ? k.value : this.k, ); DocumentVecData copyWithCompanion(DocumentVecCompanion data) { return DocumentVecData( id: data.id.present ? data.id.value : this.id, mainDocumentId: data.mainDocumentId.present ? data.mainDocumentId.value : this.mainDocumentId, contextId: data.contextId.present ? data.contextId.value : this.contextId, embedding: data.embedding.present ? data.embedding.value : this.embedding, contentHash: data.contentHash.present ? data.contentHash.value : this.contentHash, distance: data.distance.present ? data.distance.value : this.distance, k: data.k.present ? data.k.value : this.k, ); } @override String toString() { return (StringBuffer('DocumentVecData(') ..write('id: $id, ') ..write('mainDocumentId: $mainDocumentId, ') ..write('contextId: $contextId, ') ..write('embedding: $embedding, ') ..write('contentHash: $contentHash, ') ..write('distance: $distance, ') ..write('k: $k') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, mainDocumentId, contextId, $driftBlobEquality.hash(embedding), contentHash, distance, k); @override bool operator ==(Object other) => identical(this, other) || (other is DocumentVecData && other.id == this.id && other.mainDocumentId == this.mainDocumentId && other.contextId == this.contextId && $driftBlobEquality.equals(other.embedding, this.embedding) && other.contentHash == this.contentHash && other.distance == this.distance && other.k == this.k); } class DocumentVecCompanion extends UpdateCompanion { final Value id; final Value mainDocumentId; final Value contextId; final Value embedding; final Value contentHash; final Value distance; final Value k; final Value rowid; const DocumentVecCompanion({ this.id = const Value.absent(), this.mainDocumentId = const Value.absent(), this.contextId = const Value.absent(), this.embedding = const Value.absent(), this.contentHash = const Value.absent(), this.distance = const Value.absent(), this.k = const Value.absent(), this.rowid = const Value.absent(), }); DocumentVecCompanion.insert({ required String id, this.mainDocumentId = const Value.absent(), this.contextId = const Value.absent(), required Uint8List embedding, required String contentHash, this.distance = const Value.absent(), this.k = const Value.absent(), this.rowid = const Value.absent(), }) : id = Value(id), embedding = Value(embedding), contentHash = Value(contentHash); static Insertable custom({ Expression? id, Expression? mainDocumentId, Expression? contextId, Expression? embedding, Expression? contentHash, Expression? distance, Expression? k, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (mainDocumentId != null) 'main_document_id': mainDocumentId, if (contextId != null) 'context_id': contextId, if (embedding != null) 'embedding': embedding, if (contentHash != null) 'content_hash': contentHash, if (distance != null) 'distance': distance, if (k != null) 'k': k, if (rowid != null) 'rowid': rowid, }); } DocumentVecCompanion copyWith( {Value? id, Value? mainDocumentId, Value? contextId, Value? embedding, Value? contentHash, Value? distance, Value? k, Value? rowid}) { return DocumentVecCompanion( id: id ?? this.id, mainDocumentId: mainDocumentId ?? this.mainDocumentId, contextId: contextId ?? this.contextId, embedding: embedding ?? this.embedding, contentHash: contentHash ?? this.contentHash, distance: distance ?? this.distance, k: k ?? this.k, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (mainDocumentId.present) { map['main_document_id'] = Variable(mainDocumentId.value); } if (contextId.present) { map['context_id'] = Variable(contextId.value); } if (embedding.present) { map['embedding'] = Variable(embedding.value); } if (contentHash.present) { map['content_hash'] = Variable(contentHash.value); } if (distance.present) { map['distance'] = Variable(distance.value); } if (k.present) { map['k'] = Variable(k.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('DocumentVecCompanion(') ..write('id: $id, ') ..write('mainDocumentId: $mainDocumentId, ') ..write('contextId: $contextId, ') ..write('embedding: $embedding, ') ..write('contentHash: $contentHash, ') ..write('distance: $distance, ') ..write('k: $k, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } abstract class _$TabDatabase extends GeneratedDatabase { _$TabDatabase(QueryExecutor e) : super(e); $TabDatabaseManager get managers => $TabDatabaseManager(this); late final Container container = Container(this); late final Tab tab = Tab(this); late final Document document = Document(this); late final Trigger tabDocumentDelete = Trigger( 'CREATE TRIGGER tab_document_delete AFTER DELETE ON tab BEGIN DELETE FROM document WHERE main_document_id = old.id;END', 'tab_document_delete'); late final TabFts tabFts = TabFts(this); 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'); late final Index documentMainDocumentId = Index('document_main_document_id', 'CREATE INDEX document_main_document_id ON document (main_document_id)'); late final Index documentContextId = Index('document_context_id', 'CREATE INDEX document_context_id ON document (context_id)'); late final DocumentVec documentVec = DocumentVec(this); late final Trigger documentDelete = Trigger( 'CREATE TRIGGER document_delete AFTER DELETE ON document BEGIN DELETE FROM document_vec WHERE id = old.document_id;END', 'document_delete'); late final Trigger documentUpdateDelete = Trigger( 'CREATE TRIGGER document_update_delete AFTER UPDATE ON document BEGIN DELETE FROM document_vec WHERE id = new.document_id AND content_hash != new.content_hash;END', 'document_update_delete'); late final ContainerDao containerDao = ContainerDao(this as TabDatabase); late final TabDao tabDao = TabDao(this as TabDatabase); late final VectorDao vectorDao = VectorDao(this as TabDatabase); Future optimizeFtsIndex() { return customInsert( 'INSERT INTO tab_fts (tab_fts) VALUES (\'optimize\')', variables: [], updates: {tabFts}, ); } Selectable containersWithCount() { return customSelect( 'SELECT container.*, tab_agg.tab_count FROM container LEFT JOIN (SELECT container_id, COUNT(*) AS tab_count, MAX(timestamp) AS last_updated FROM tab GROUP BY container_id) AS tab_agg ON container.id = tab_agg.container_id ORDER BY tab_agg.last_updated DESC NULLS LAST', variables: [], readsFrom: { container, tab, }).map((QueryRow row) => ContainerDataWithCount( id: row.read('id'), name: row.readNullable('name'), color: Container.$convertercolor.fromSql(row.read('color')), metadata: NullAwareTypeConverter.wrapFromSql( Container.$convertermetadata, row.readNullable('metadata')), tabCount: row.readNullable('tab_count'), )); } Selectable leadingOrderKey( {required int bucket, String? containerId}) { return customSelect( 'SELECT lexo_rank_previous(?1, (SELECT order_key FROM tab WHERE container_id IS ?2 ORDER BY order_key LIMIT 1)) AS _c0', variables: [ Variable(bucket), Variable(containerId) ], readsFrom: { tab, }).map((QueryRow row) => row.read('_c0')); } Selectable trailingOrderKey( {required int bucket, String? containerId}) { return customSelect( 'SELECT lexo_rank_next(?1, (SELECT order_key FROM tab WHERE container_id IS ?2 ORDER BY order_key DESC LIMIT 1)) AS _c0', variables: [ Variable(bucket), Variable(containerId) ], readsFrom: { tab, }).map((QueryRow row) => row.read('_c0')); } Selectable orderKeyAfterTab( {String? containerId, required String tabId}) { return customSelect( 'WITH ordered_table AS (SELECT id, order_key, LEAD(order_key)OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS next_order_key FROM tab WHERE container_id IS ?1) SELECT lexo_rank_reorder_after(order_key, next_order_key) AS _c0 FROM ordered_table WHERE id = ?2', variables: [ Variable(containerId), Variable(tabId) ], readsFrom: { tab, }).map((QueryRow row) => row.read('_c0')); } Selectable queryTabsBasic( {required String beforeMatch, required String afterMatch, required String query}) { return customSelect( 'WITH weights AS (SELECT 10.0 AS title_weight, 5.0 AS url_weight) SELECT t.id, highlight(tab_fts, 0, ?1, ?2) AS title, highlight(tab_fts, 1, ?1, ?2) AS url, bm25(tab_fts, weights.title_weight, weights.url_weight) AS weighted_rank, t.url AS clean_url FROM tab_fts AS fts INNER JOIN tab AS t ON t."rowid" = fts."rowid" CROSS JOIN weights WHERE fts.title LIKE ?3 OR fts.url LIKE ?3 ORDER BY weighted_rank ASC, t.timestamp DESC', variables: [ Variable(beforeMatch), Variable(afterMatch), Variable(query) ], readsFrom: { tab, tabFts, }).map((QueryRow row) => TabQueryResult( id: row.read('id'), title: row.readNullable('title'), url: row.readNullable('url'), cleanUrl: row.readNullable('clean_url'), weightedRank: row.read('weighted_rank'), )); } Selectable queryTabsFullContent( {required String beforeMatch, required String afterMatch, required String ellipsis, required int snippetLength, required String query}) { return customSelect( 'WITH weights AS (SELECT 10.0 AS title_weight, 5.0 AS url_weight, 3.0 AS extracted_weight, 1.0 AS full_weight) SELECT t.id, highlight(tab_fts, 0, ?1, ?2) AS title, highlight(tab_fts, 1, ?1, ?2) AS url, snippet(tab_fts, 2, ?1, ?2, ?3, ?4) AS extracted_content, snippet(tab_fts, 3, ?1, ?2, ?3, ?4) AS full_content,(bm25(tab_fts, weights.title_weight, weights.url_weight, weights.extracted_weight, weights.full_weight))AS weighted_rank, t.url AS clean_url FROM tab_fts(?5)AS fts INNER JOIN tab AS t ON t."rowid" = fts."rowid" CROSS JOIN weights ORDER BY weighted_rank ASC, t.timestamp DESC', variables: [ Variable(beforeMatch), Variable(afterMatch), Variable(ellipsis), Variable(snippetLength), Variable(query) ], readsFrom: { tab, tabFts, }).map((QueryRow row) => TabQueryResult( id: row.read('id'), title: row.readNullable('title'), url: row.readNullable('url'), cleanUrl: row.readNullable('clean_url'), extractedContent: row.readNullable('extracted_content'), fullContent: row.readNullable('full_content'), weightedRank: row.read('weighted_rank'), )); } Selectable missingDocumentEmbeddings( {String? mainDocumentId, String? contextId}) { return customSelect( 'SELECT doc.* FROM document AS doc WHERE doc.main_document_id IS COALESCE(?1, doc.main_document_id) AND doc.context_id IS COALESCE(?2, doc.context_id) AND NOT EXISTS (SELECT 1 AS _c0 FROM document_vec AS vec WHERE vec.id = doc.document_id)', variables: [ Variable(mainDocumentId), Variable(contextId) ], readsFrom: { document, documentVec, }).asyncMap(document.mapFromRow); } Selectable queryVectors( {required Uint8List searchVectors, int? k, String? mainDocumentId, String? contextId}) { return customSelect( 'SELECT vec.id, doc.main_document_id, doc.context_id, doc.content, doc.metadata, vec.distance FROM document_vec AS vec INNER JOIN document AS doc ON doc.document_id = vec.id WHERE vec.embedding MATCH ?1 AND vec.k = ?2 AND vec.main_document_id IS COALESCE(?3, vec.main_document_id) AND vec.context_id IS COALESCE(?4, vec.context_id) ORDER BY vec.distance', variables: [ Variable(searchVectors), Variable(k), Variable(mainDocumentId), Variable(contextId) ], readsFrom: { documentVec, document, }).map((QueryRow row) => VectorResult( id: row.read('id'), mainDocumentId: row.readNullable('main_document_id'), contextId: row.readNullable('context_id'), content: row.read('content'), metadata: row.readNullable('metadata'), distance: row.readNullable('distance'), )); } @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ container, tab, document, tabDocumentDelete, tabFts, tabAfterInsert, tabAfterDelete, tabAfterUpdate, documentMainDocumentId, documentContextId, documentVec, documentDelete, documentUpdateDelete ]; @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('document', kind: UpdateKind.delete), ], ), 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('document', limitUpdateKind: UpdateKind.delete), result: [ TableUpdate('document_vec', kind: UpdateKind.delete), ], ), WritePropagation( on: TableUpdateQuery.onTableName('document', limitUpdateKind: UpdateKind.update), result: [ TableUpdate('document_vec', kind: UpdateKind.delete), ], ), ], ); } typedef $ContainerCreateCompanionBuilder = ContainerCompanion Function({ required String id, Value name, required Color color, Value metadata, Value rowid, }); typedef $ContainerUpdateCompanionBuilder = ContainerCompanion Function({ Value id, Value name, Value color, Value metadata, Value rowid, }); final class $ContainerReferences extends BaseReferences<_$TabDatabase, Container, ContainerData> { $ContainerReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey> _tabRefsTable( _$TabDatabase db) => MultiTypedResultKey.fromTable(db.tab, aliasName: $_aliasNameGenerator(db.container.id, db.tab.containerId)); $TabProcessedTableManager get tabRefs { final manager = $TabTableManager($_db, $_db.tab) .filter((f) => f.containerId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_tabRefsTable($_db)); return ProcessedTableManager( manager.$state.copyWith(prefetchedData: cache)); } } class $ContainerFilterComposer extends Composer<_$TabDatabase, Container> { $ContainerFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column)); ColumnFilters get name => $composableBuilder( column: $table.name, builder: (column) => ColumnFilters(column)); ColumnWithTypeConverterFilters get color => $composableBuilder( column: $table.color, builder: (column) => ColumnWithTypeConverterFilters(column)); ColumnWithTypeConverterFilters get metadata => $composableBuilder( column: $table.metadata, builder: (column) => ColumnWithTypeConverterFilters(column)); Expression tabRefs(Expression Function($TabFilterComposer f) f) { final $TabFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.tab, getReferencedColumn: (t) => t.containerId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $TabFilterComposer( $db: $db, $table: $db.tab, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $ContainerOrderingComposer extends Composer<_$TabDatabase, Container> { $ContainerOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column)); ColumnOrderings get name => $composableBuilder( column: $table.name, builder: (column) => ColumnOrderings(column)); ColumnOrderings get color => $composableBuilder( column: $table.color, builder: (column) => ColumnOrderings(column)); ColumnOrderings get metadata => $composableBuilder( column: $table.metadata, builder: (column) => ColumnOrderings(column)); } class $ContainerAnnotationComposer extends Composer<_$TabDatabase, Container> { $ContainerAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get name => $composableBuilder(column: $table.name, builder: (column) => column); GeneratedColumnWithTypeConverter get color => $composableBuilder(column: $table.color, builder: (column) => column); GeneratedColumnWithTypeConverter get metadata => $composableBuilder(column: $table.metadata, builder: (column) => column); Expression tabRefs( Expression Function($TabAnnotationComposer a) f) { final $TabAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.id, referencedTable: $db.tab, getReferencedColumn: (t) => t.containerId, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $TabAnnotationComposer( $db: $db, $table: $db.tab, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return f(composer); } } class $ContainerTableManager extends RootTableManager< _$TabDatabase, Container, ContainerData, $ContainerFilterComposer, $ContainerOrderingComposer, $ContainerAnnotationComposer, $ContainerCreateCompanionBuilder, $ContainerUpdateCompanionBuilder, (ContainerData, $ContainerReferences), ContainerData, PrefetchHooks Function({bool tabRefs})> { $ContainerTableManager(_$TabDatabase db, Container table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $ContainerFilterComposer($db: db, $table: table), createOrderingComposer: () => $ContainerOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $ContainerAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value name = const Value.absent(), Value color = const Value.absent(), Value metadata = const Value.absent(), Value rowid = const Value.absent(), }) => ContainerCompanion( id: id, name: name, color: color, metadata: metadata, rowid: rowid, ), createCompanionCallback: ({ required String id, Value name = const Value.absent(), required Color color, Value metadata = const Value.absent(), Value rowid = const Value.absent(), }) => ContainerCompanion.insert( id: id, name: name, color: color, metadata: metadata, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $ContainerReferences(db, table, e))) .toList(), prefetchHooksCallback: ({tabRefs = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (tabRefs) db.tab], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (tabRefs) await $_getPrefetchedData( currentTable: table, referencedTable: $ContainerReferences._tabRefsTable(db), managerFromTypedResult: (p0) => $ContainerReferences(db, table, p0).tabRefs, referencedItemsForCurrentItem: (item, referencedItems) => referencedItems .where((e) => e.containerId == item.id), typedResults: items) ]; }, ); }, )); } typedef $ContainerProcessedTableManager = ProcessedTableManager< _$TabDatabase, Container, ContainerData, $ContainerFilterComposer, $ContainerOrderingComposer, $ContainerAnnotationComposer, $ContainerCreateCompanionBuilder, $ContainerUpdateCompanionBuilder, (ContainerData, $ContainerReferences), ContainerData, PrefetchHooks Function({bool tabRefs})>; typedef $TabCreateCompanionBuilder = TabCompanion Function({ required String id, Value containerId, required String orderKey, Value url, Value title, Value isProbablyReaderable, Value extractedContentMarkdown, Value extractedContentPlain, Value fullContentMarkdown, Value fullContentPlain, required DateTime timestamp, Value rowid, }); typedef $TabUpdateCompanionBuilder = TabCompanion Function({ Value id, Value containerId, Value orderKey, Value url, Value title, Value isProbablyReaderable, Value extractedContentMarkdown, Value extractedContentPlain, Value fullContentMarkdown, Value fullContentPlain, Value timestamp, Value rowid, }); final class $TabReferences extends BaseReferences<_$TabDatabase, Tab, TabData> { $TabReferences(super.$_db, super.$_table, super.$_typedResult); static Container _containerIdTable(_$TabDatabase db) => db.container .createAlias($_aliasNameGenerator(db.tab.containerId, db.container.id)); $ContainerProcessedTableManager? get containerId { final $_column = $_itemColumn('container_id'); if ($_column == null) return null; final manager = $ContainerTableManager($_db, $_db.container) .filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_containerIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( manager.$state.copyWith(prefetchedData: [item])); } } class $TabFilterComposer extends Composer<_$TabDatabase, Tab> { $TabFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column)); ColumnFilters get orderKey => $composableBuilder( column: $table.orderKey, builder: (column) => ColumnFilters(column)); ColumnFilters get url => $composableBuilder( column: $table.url, builder: (column) => ColumnFilters(column)); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column)); ColumnFilters get isProbablyReaderable => $composableBuilder( column: $table.isProbablyReaderable, builder: (column) => ColumnFilters(column)); ColumnFilters get extractedContentMarkdown => $composableBuilder( column: $table.extractedContentMarkdown, builder: (column) => ColumnFilters(column)); ColumnFilters get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => ColumnFilters(column)); ColumnFilters get fullContentMarkdown => $composableBuilder( column: $table.fullContentMarkdown, builder: (column) => ColumnFilters(column)); ColumnFilters get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => ColumnFilters(column)); ColumnFilters get timestamp => $composableBuilder( column: $table.timestamp, builder: (column) => ColumnFilters(column)); $ContainerFilterComposer get containerId { final $ContainerFilterComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.containerId, referencedTable: $db.container, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $ContainerFilterComposer( $db: $db, $table: $db.container, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $TabOrderingComposer extends Composer<_$TabDatabase, Tab> { $TabOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column)); ColumnOrderings get orderKey => $composableBuilder( column: $table.orderKey, builder: (column) => ColumnOrderings(column)); ColumnOrderings get url => $composableBuilder( column: $table.url, builder: (column) => ColumnOrderings(column)); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column)); ColumnOrderings get isProbablyReaderable => $composableBuilder( column: $table.isProbablyReaderable, builder: (column) => ColumnOrderings(column)); ColumnOrderings get extractedContentMarkdown => $composableBuilder( column: $table.extractedContentMarkdown, builder: (column) => ColumnOrderings(column)); ColumnOrderings get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => ColumnOrderings(column)); ColumnOrderings get fullContentMarkdown => $composableBuilder( column: $table.fullContentMarkdown, builder: (column) => ColumnOrderings(column)); ColumnOrderings get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => ColumnOrderings(column)); ColumnOrderings get timestamp => $composableBuilder( column: $table.timestamp, builder: (column) => ColumnOrderings(column)); $ContainerOrderingComposer get containerId { final $ContainerOrderingComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.containerId, referencedTable: $db.container, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $ContainerOrderingComposer( $db: $db, $table: $db.container, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $TabAnnotationComposer extends Composer<_$TabDatabase, Tab> { $TabAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get orderKey => $composableBuilder(column: $table.orderKey, builder: (column) => column); GeneratedColumn get url => $composableBuilder(column: $table.url, builder: (column) => column); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get isProbablyReaderable => $composableBuilder( column: $table.isProbablyReaderable, builder: (column) => column); GeneratedColumn get extractedContentMarkdown => $composableBuilder( column: $table.extractedContentMarkdown, builder: (column) => column); GeneratedColumn get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => column); GeneratedColumn get fullContentMarkdown => $composableBuilder( column: $table.fullContentMarkdown, builder: (column) => column); GeneratedColumn get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => column); GeneratedColumn get timestamp => $composableBuilder(column: $table.timestamp, builder: (column) => column); $ContainerAnnotationComposer get containerId { final $ContainerAnnotationComposer composer = $composerBuilder( composer: this, getCurrentColumn: (t) => t.containerId, referencedTable: $db.container, getReferencedColumn: (t) => t.id, builder: (joinBuilder, {$addJoinBuilderToRootComposer, $removeJoinBuilderFromRootComposer}) => $ContainerAnnotationComposer( $db: $db, $table: $db.container, $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, joinBuilder: joinBuilder, $removeJoinBuilderFromRootComposer: $removeJoinBuilderFromRootComposer, )); return composer; } } class $TabTableManager extends RootTableManager< _$TabDatabase, Tab, TabData, $TabFilterComposer, $TabOrderingComposer, $TabAnnotationComposer, $TabCreateCompanionBuilder, $TabUpdateCompanionBuilder, (TabData, $TabReferences), TabData, PrefetchHooks Function({bool containerId})> { $TabTableManager(_$TabDatabase db, Tab table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $TabFilterComposer($db: db, $table: table), createOrderingComposer: () => $TabOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $TabAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value containerId = const Value.absent(), Value orderKey = const Value.absent(), Value url = 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 timestamp = const Value.absent(), Value rowid = const Value.absent(), }) => TabCompanion( id: id, containerId: containerId, orderKey: orderKey, url: url, title: title, isProbablyReaderable: isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown, extractedContentPlain: extractedContentPlain, fullContentMarkdown: fullContentMarkdown, fullContentPlain: fullContentPlain, timestamp: timestamp, rowid: rowid, ), createCompanionCallback: ({ required String id, Value containerId = const Value.absent(), required String orderKey, Value url = 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(), required DateTime timestamp, Value rowid = const Value.absent(), }) => TabCompanion.insert( id: id, containerId: containerId, orderKey: orderKey, url: url, title: title, isProbablyReaderable: isProbablyReaderable, extractedContentMarkdown: extractedContentMarkdown, extractedContentPlain: extractedContentPlain, fullContentMarkdown: fullContentMarkdown, fullContentPlain: fullContentPlain, timestamp: timestamp, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), $TabReferences(db, table, e))) .toList(), prefetchHooksCallback: ({containerId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < T extends TableManagerState< dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic, dynamic>>(state) { if (containerId) { state = state.withJoin( currentTable: table, currentColumn: table.containerId, referencedTable: $TabReferences._containerIdTable(db), referencedColumn: $TabReferences._containerIdTable(db).id, ) as T; } return state; }, getPrefetchedDataCallback: (items) async { return []; }, ); }, )); } typedef $TabProcessedTableManager = ProcessedTableManager< _$TabDatabase, Tab, TabData, $TabFilterComposer, $TabOrderingComposer, $TabAnnotationComposer, $TabCreateCompanionBuilder, $TabUpdateCompanionBuilder, (TabData, $TabReferences), TabData, PrefetchHooks Function({bool containerId})>; typedef $DocumentCreateCompanionBuilder = DocumentCompanion Function({ required String documentId, Value mainDocumentId, Value contextId, required String content, required String contentHash, Value metadata, Value rowid, }); typedef $DocumentUpdateCompanionBuilder = DocumentCompanion Function({ Value documentId, Value mainDocumentId, Value contextId, Value content, Value contentHash, Value metadata, Value rowid, }); class $DocumentFilterComposer extends Composer<_$TabDatabase, Document> { $DocumentFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get documentId => $composableBuilder( column: $table.documentId, builder: (column) => ColumnFilters(column)); ColumnFilters get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => ColumnFilters(column)); ColumnFilters get contextId => $composableBuilder( column: $table.contextId, builder: (column) => ColumnFilters(column)); ColumnFilters get content => $composableBuilder( column: $table.content, builder: (column) => ColumnFilters(column)); ColumnFilters get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => ColumnFilters(column)); ColumnFilters get metadata => $composableBuilder( column: $table.metadata, builder: (column) => ColumnFilters(column)); } class $DocumentOrderingComposer extends Composer<_$TabDatabase, Document> { $DocumentOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get documentId => $composableBuilder( column: $table.documentId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get contextId => $composableBuilder( column: $table.contextId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get content => $composableBuilder( column: $table.content, builder: (column) => ColumnOrderings(column)); ColumnOrderings get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => ColumnOrderings(column)); ColumnOrderings get metadata => $composableBuilder( column: $table.metadata, builder: (column) => ColumnOrderings(column)); } class $DocumentAnnotationComposer extends Composer<_$TabDatabase, Document> { $DocumentAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get documentId => $composableBuilder( column: $table.documentId, builder: (column) => column); GeneratedColumn get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => column); GeneratedColumn get contextId => $composableBuilder(column: $table.contextId, builder: (column) => column); GeneratedColumn get content => $composableBuilder(column: $table.content, builder: (column) => column); GeneratedColumn get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => column); GeneratedColumn get metadata => $composableBuilder(column: $table.metadata, builder: (column) => column); } class $DocumentTableManager extends RootTableManager< _$TabDatabase, Document, DocumentData, $DocumentFilterComposer, $DocumentOrderingComposer, $DocumentAnnotationComposer, $DocumentCreateCompanionBuilder, $DocumentUpdateCompanionBuilder, (DocumentData, BaseReferences<_$TabDatabase, Document, DocumentData>), DocumentData, PrefetchHooks Function()> { $DocumentTableManager(_$TabDatabase db, Document table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $DocumentFilterComposer($db: db, $table: table), createOrderingComposer: () => $DocumentOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $DocumentAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value documentId = const Value.absent(), Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), Value content = const Value.absent(), Value contentHash = const Value.absent(), Value metadata = const Value.absent(), Value rowid = const Value.absent(), }) => DocumentCompanion( documentId: documentId, mainDocumentId: mainDocumentId, contextId: contextId, content: content, contentHash: contentHash, metadata: metadata, rowid: rowid, ), createCompanionCallback: ({ required String documentId, Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), required String content, required String contentHash, Value metadata = const Value.absent(), Value rowid = const Value.absent(), }) => DocumentCompanion.insert( documentId: documentId, mainDocumentId: mainDocumentId, contextId: contextId, content: content, contentHash: contentHash, metadata: metadata, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $DocumentProcessedTableManager = ProcessedTableManager< _$TabDatabase, Document, DocumentData, $DocumentFilterComposer, $DocumentOrderingComposer, $DocumentAnnotationComposer, $DocumentCreateCompanionBuilder, $DocumentUpdateCompanionBuilder, (DocumentData, BaseReferences<_$TabDatabase, Document, DocumentData>), DocumentData, PrefetchHooks Function()>; typedef $TabFtsCreateCompanionBuilder = TabFtsCompanion Function({ required String title, required String url, required String extractedContentPlain, required String fullContentPlain, Value rowid, }); typedef $TabFtsUpdateCompanionBuilder = TabFtsCompanion Function({ Value title, Value url, Value extractedContentPlain, Value fullContentPlain, Value rowid, }); class $TabFtsFilterComposer extends Composer<_$TabDatabase, TabFts> { $TabFtsFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get title => $composableBuilder( column: $table.title, builder: (column) => ColumnFilters(column)); ColumnFilters get url => $composableBuilder( column: $table.url, builder: (column) => ColumnFilters(column)); ColumnFilters get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => ColumnFilters(column)); ColumnFilters get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => ColumnFilters(column)); } class $TabFtsOrderingComposer extends Composer<_$TabDatabase, TabFts> { $TabFtsOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get title => $composableBuilder( column: $table.title, builder: (column) => ColumnOrderings(column)); ColumnOrderings get url => $composableBuilder( column: $table.url, builder: (column) => ColumnOrderings(column)); ColumnOrderings get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => ColumnOrderings(column)); ColumnOrderings get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => ColumnOrderings(column)); } class $TabFtsAnnotationComposer extends Composer<_$TabDatabase, TabFts> { $TabFtsAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get title => $composableBuilder(column: $table.title, builder: (column) => column); GeneratedColumn get url => $composableBuilder(column: $table.url, builder: (column) => column); GeneratedColumn get extractedContentPlain => $composableBuilder( column: $table.extractedContentPlain, builder: (column) => column); GeneratedColumn get fullContentPlain => $composableBuilder( column: $table.fullContentPlain, builder: (column) => column); } class $TabFtsTableManager extends RootTableManager< _$TabDatabase, TabFts, TabFt, $TabFtsFilterComposer, $TabFtsOrderingComposer, $TabFtsAnnotationComposer, $TabFtsCreateCompanionBuilder, $TabFtsUpdateCompanionBuilder, (TabFt, BaseReferences<_$TabDatabase, TabFts, TabFt>), TabFt, PrefetchHooks Function()> { $TabFtsTableManager(_$TabDatabase db, TabFts table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $TabFtsFilterComposer($db: db, $table: table), createOrderingComposer: () => $TabFtsOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $TabFtsAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value title = const Value.absent(), Value url = const Value.absent(), Value extractedContentPlain = const Value.absent(), Value fullContentPlain = const Value.absent(), Value rowid = const Value.absent(), }) => TabFtsCompanion( title: title, url: url, extractedContentPlain: extractedContentPlain, fullContentPlain: fullContentPlain, rowid: rowid, ), createCompanionCallback: ({ required String title, required String url, required String extractedContentPlain, required String fullContentPlain, Value rowid = const Value.absent(), }) => TabFtsCompanion.insert( title: title, url: url, extractedContentPlain: extractedContentPlain, fullContentPlain: fullContentPlain, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $TabFtsProcessedTableManager = ProcessedTableManager< _$TabDatabase, TabFts, TabFt, $TabFtsFilterComposer, $TabFtsOrderingComposer, $TabFtsAnnotationComposer, $TabFtsCreateCompanionBuilder, $TabFtsUpdateCompanionBuilder, (TabFt, BaseReferences<_$TabDatabase, TabFts, TabFt>), TabFt, PrefetchHooks Function()>; typedef $DocumentVecCreateCompanionBuilder = DocumentVecCompanion Function({ required String id, Value mainDocumentId, Value contextId, required Uint8List embedding, required String contentHash, Value distance, Value k, Value rowid, }); typedef $DocumentVecUpdateCompanionBuilder = DocumentVecCompanion Function({ Value id, Value mainDocumentId, Value contextId, Value embedding, Value contentHash, Value distance, Value k, Value rowid, }); class $DocumentVecFilterComposer extends Composer<_$TabDatabase, DocumentVec> { $DocumentVecFilterComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( column: $table.id, builder: (column) => ColumnFilters(column)); ColumnFilters get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => ColumnFilters(column)); ColumnFilters get contextId => $composableBuilder( column: $table.contextId, builder: (column) => ColumnFilters(column)); ColumnFilters get embedding => $composableBuilder( column: $table.embedding, builder: (column) => ColumnFilters(column)); ColumnFilters get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => ColumnFilters(column)); ColumnFilters get distance => $composableBuilder( column: $table.distance, builder: (column) => ColumnFilters(column)); ColumnFilters get k => $composableBuilder( column: $table.k, builder: (column) => ColumnFilters(column)); } class $DocumentVecOrderingComposer extends Composer<_$TabDatabase, DocumentVec> { $DocumentVecOrderingComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( column: $table.id, builder: (column) => ColumnOrderings(column)); ColumnOrderings get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get contextId => $composableBuilder( column: $table.contextId, builder: (column) => ColumnOrderings(column)); ColumnOrderings get embedding => $composableBuilder( column: $table.embedding, builder: (column) => ColumnOrderings(column)); ColumnOrderings get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => ColumnOrderings(column)); ColumnOrderings get distance => $composableBuilder( column: $table.distance, builder: (column) => ColumnOrderings(column)); ColumnOrderings get k => $composableBuilder( column: $table.k, builder: (column) => ColumnOrderings(column)); } class $DocumentVecAnnotationComposer extends Composer<_$TabDatabase, DocumentVec> { $DocumentVecAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get mainDocumentId => $composableBuilder( column: $table.mainDocumentId, builder: (column) => column); GeneratedColumn get contextId => $composableBuilder(column: $table.contextId, builder: (column) => column); GeneratedColumn get embedding => $composableBuilder(column: $table.embedding, builder: (column) => column); GeneratedColumn get contentHash => $composableBuilder( column: $table.contentHash, builder: (column) => column); GeneratedColumn get distance => $composableBuilder(column: $table.distance, builder: (column) => column); GeneratedColumn get k => $composableBuilder(column: $table.k, builder: (column) => column); } class $DocumentVecTableManager extends RootTableManager< _$TabDatabase, DocumentVec, DocumentVecData, $DocumentVecFilterComposer, $DocumentVecOrderingComposer, $DocumentVecAnnotationComposer, $DocumentVecCreateCompanionBuilder, $DocumentVecUpdateCompanionBuilder, ( DocumentVecData, BaseReferences<_$TabDatabase, DocumentVec, DocumentVecData> ), DocumentVecData, PrefetchHooks Function()> { $DocumentVecTableManager(_$TabDatabase db, DocumentVec table) : super(TableManagerState( db: db, table: table, createFilteringComposer: () => $DocumentVecFilterComposer($db: db, $table: table), createOrderingComposer: () => $DocumentVecOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $DocumentVecAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), Value embedding = const Value.absent(), Value contentHash = const Value.absent(), Value distance = const Value.absent(), Value k = const Value.absent(), Value rowid = const Value.absent(), }) => DocumentVecCompanion( id: id, mainDocumentId: mainDocumentId, contextId: contextId, embedding: embedding, contentHash: contentHash, distance: distance, k: k, rowid: rowid, ), createCompanionCallback: ({ required String id, Value mainDocumentId = const Value.absent(), Value contextId = const Value.absent(), required Uint8List embedding, required String contentHash, Value distance = const Value.absent(), Value k = const Value.absent(), Value rowid = const Value.absent(), }) => DocumentVecCompanion.insert( id: id, mainDocumentId: mainDocumentId, contextId: contextId, embedding: embedding, contentHash: contentHash, distance: distance, k: k, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, )); } typedef $DocumentVecProcessedTableManager = ProcessedTableManager< _$TabDatabase, DocumentVec, DocumentVecData, $DocumentVecFilterComposer, $DocumentVecOrderingComposer, $DocumentVecAnnotationComposer, $DocumentVecCreateCompanionBuilder, $DocumentVecUpdateCompanionBuilder, ( DocumentVecData, BaseReferences<_$TabDatabase, DocumentVec, DocumentVecData> ), DocumentVecData, PrefetchHooks Function()>; class $TabDatabaseManager { final _$TabDatabase _db; $TabDatabaseManager(this._db); $ContainerTableManager get container => $ContainerTableManager(_db, _db.container); $TabTableManager get tab => $TabTableManager(_db, _db.tab); $DocumentTableManager get document => $DocumentTableManager(_db, _db.document); $TabFtsTableManager get tabFts => $TabFtsTableManager(_db, _db.tabFts); $DocumentVecTableManager get documentVec => $DocumentVecTableManager(_db, _db.documentVec); }