// GENERATED CODE - DO NOT MODIFY BY HAND part of 'task_store.dart'; // ignore_for_file: type=lint class $UploadTasksTable extends UploadTasks with TableInfo<$UploadTasksTable, UploadTask> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $UploadTasksTable(this.attachedDatabase, [this._alias]); static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _accountIdMeta = const VerificationMeta( 'accountId', ); @override late final GeneratedColumn accountId = GeneratedColumn( 'account_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _albumIdMeta = const VerificationMeta( 'albumId', ); @override late final GeneratedColumn albumId = GeneratedColumn( 'album_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _categoryIdMeta = const VerificationMeta( 'categoryId', ); @override late final GeneratedColumn categoryId = GeneratedColumn( 'category_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _clientTaskIdMeta = const VerificationMeta( 'clientTaskId', ); @override late final GeneratedColumn clientTaskId = GeneratedColumn( 'client_task_id', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _sourceFilePathMeta = const VerificationMeta( 'sourceFilePath', ); @override late final GeneratedColumn sourceFilePath = GeneratedColumn( 'source_file_path', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _filenameMeta = const VerificationMeta( 'filename', ); @override late final GeneratedColumn filename = GeneratedColumn( 'filename', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _bytesMeta = const VerificationMeta('bytes'); @override late final GeneratedColumn bytes = GeneratedColumn( 'bytes', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true, ); static const VerificationMeta _contentTypeMeta = const VerificationMeta( 'contentType', ); @override late final GeneratedColumn contentType = GeneratedColumn( 'content_type', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ); @override late final GeneratedColumnWithTypeConverter state = GeneratedColumn( 'state', aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, ).withConverter($UploadTasksTable.$converterstate); static const VerificationMeta _attemptMeta = const VerificationMeta( 'attempt', ); @override late final GeneratedColumn attempt = GeneratedColumn( 'attempt', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: false, defaultValue: const Constant(0), ); static const VerificationMeta _nextRetryAtMeta = const VerificationMeta( 'nextRetryAt', ); @override late final GeneratedColumn nextRetryAt = GeneratedColumn( 'next_retry_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); static const VerificationMeta _serverUploadIdMeta = const VerificationMeta( 'serverUploadId', ); @override late final GeneratedColumn serverUploadId = GeneratedColumn( 'server_upload_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _serverPhotoIdMeta = const VerificationMeta( 'serverPhotoId', ); @override late final GeneratedColumn serverPhotoId = GeneratedColumn( 'server_photo_id', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _lastErrorMeta = const VerificationMeta( 'lastError', ); @override late final GeneratedColumn lastError = GeneratedColumn( 'last_error', aliasedName, true, type: DriftSqlType.string, requiredDuringInsert: false, ); static const VerificationMeta _cleanedAtMeta = const VerificationMeta( 'cleanedAt', ); @override late final GeneratedColumn cleanedAt = GeneratedColumn( 'cleaned_at', aliasedName, true, type: DriftSqlType.dateTime, requiredDuringInsert: false, ); static const VerificationMeta _createdAtMeta = const VerificationMeta( 'createdAt', ); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); static const VerificationMeta _updatedAtMeta = const VerificationMeta( 'updatedAt', ); @override late final GeneratedColumn updatedAt = GeneratedColumn( 'updated_at', aliasedName, false, type: DriftSqlType.dateTime, requiredDuringInsert: true, ); @override List get $columns => [ id, accountId, albumId, categoryId, clientTaskId, sourceFilePath, filename, bytes, contentType, state, attempt, nextRetryAt, serverUploadId, serverPhotoId, lastError, cleanedAt, createdAt, updatedAt, ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'upload_tasks'; @override VerificationContext validateIntegrity( Insertable instance, { bool isInserting = false, }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } else if (isInserting) { context.missing(_idMeta); } if (data.containsKey('account_id')) { context.handle( _accountIdMeta, accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), ); } else if (isInserting) { context.missing(_accountIdMeta); } if (data.containsKey('album_id')) { context.handle( _albumIdMeta, albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta), ); } else if (isInserting) { context.missing(_albumIdMeta); } if (data.containsKey('category_id')) { context.handle( _categoryIdMeta, categoryId.isAcceptableOrUnknown(data['category_id']!, _categoryIdMeta), ); } if (data.containsKey('client_task_id')) { context.handle( _clientTaskIdMeta, clientTaskId.isAcceptableOrUnknown( data['client_task_id']!, _clientTaskIdMeta, ), ); } else if (isInserting) { context.missing(_clientTaskIdMeta); } if (data.containsKey('source_file_path')) { context.handle( _sourceFilePathMeta, sourceFilePath.isAcceptableOrUnknown( data['source_file_path']!, _sourceFilePathMeta, ), ); } else if (isInserting) { context.missing(_sourceFilePathMeta); } if (data.containsKey('filename')) { context.handle( _filenameMeta, filename.isAcceptableOrUnknown(data['filename']!, _filenameMeta), ); } else if (isInserting) { context.missing(_filenameMeta); } if (data.containsKey('bytes')) { context.handle( _bytesMeta, bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta), ); } else if (isInserting) { context.missing(_bytesMeta); } if (data.containsKey('content_type')) { context.handle( _contentTypeMeta, contentType.isAcceptableOrUnknown( data['content_type']!, _contentTypeMeta, ), ); } else if (isInserting) { context.missing(_contentTypeMeta); } if (data.containsKey('attempt')) { context.handle( _attemptMeta, attempt.isAcceptableOrUnknown(data['attempt']!, _attemptMeta), ); } if (data.containsKey('next_retry_at')) { context.handle( _nextRetryAtMeta, nextRetryAt.isAcceptableOrUnknown( data['next_retry_at']!, _nextRetryAtMeta, ), ); } if (data.containsKey('server_upload_id')) { context.handle( _serverUploadIdMeta, serverUploadId.isAcceptableOrUnknown( data['server_upload_id']!, _serverUploadIdMeta, ), ); } if (data.containsKey('server_photo_id')) { context.handle( _serverPhotoIdMeta, serverPhotoId.isAcceptableOrUnknown( data['server_photo_id']!, _serverPhotoIdMeta, ), ); } if (data.containsKey('last_error')) { context.handle( _lastErrorMeta, lastError.isAcceptableOrUnknown(data['last_error']!, _lastErrorMeta), ); } if (data.containsKey('cleaned_at')) { context.handle( _cleanedAtMeta, cleanedAt.isAcceptableOrUnknown(data['cleaned_at']!, _cleanedAtMeta), ); } if (data.containsKey('created_at')) { context.handle( _createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), ); } else if (isInserting) { context.missing(_createdAtMeta); } if (data.containsKey('updated_at')) { context.handle( _updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), ); } else if (isInserting) { context.missing(_updatedAtMeta); } return context; } @override Set get $primaryKey => {id}; @override UploadTask map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return UploadTask( id: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}id'], )!, accountId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}account_id'], )!, albumId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}album_id'], )!, categoryId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}category_id'], ), clientTaskId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}client_task_id'], )!, sourceFilePath: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}source_file_path'], )!, filename: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}filename'], )!, bytes: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}bytes'], )!, contentType: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}content_type'], )!, state: $UploadTasksTable.$converterstate.fromSql( attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}state'], )!, ), attempt: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}attempt'], )!, nextRetryAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}next_retry_at'], ), serverUploadId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}server_upload_id'], ), serverPhotoId: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}server_photo_id'], ), lastError: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}last_error'], ), cleanedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}cleaned_at'], ), createdAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}created_at'], )!, updatedAt: attachedDatabase.typeMapping.read( DriftSqlType.dateTime, data['${effectivePrefix}updated_at'], )!, ); } @override $UploadTasksTable createAlias(String alias) { return $UploadTasksTable(attachedDatabase, alias); } static TypeConverter $converterstate = const _UploadTaskStateConverter(); } class UploadTask extends DataClass implements Insertable { /// 任务 ID(客户端生成 uuid,PK;与服务端 uploadId 无关)。 final String id; /// 账号隔离键(登录账号,见 Session.account)。 final String accountId; /// 目标相册 ID。 final String albumId; /// 目标分类 ID;缺省为相册默认分类(契约 UploadInitRequest.categoryId)。 final String? categoryId; /// 客户端幂等键(同账号同相册内唯一,应用侧校验,见库级文档)。 final String clientTaskId; /// 源文件绝对路径(受管目录副本:app 支持目录/uploads/{albumId}/)。 final String sourceFilePath; /// 原始文件名(仅元数据, maxLength 255,契约对齐)。 final String filename; /// 申明文件字节数(完成核验时与服务端逐一比对)。 final int bytes; /// MIME 类型(白名单 image/jpeg | image/png | image/heic)。 final String contentType; /// 任务状态(状态机见 task_state.dart)。 final UploadTaskState state; /// 已尝试传输次数(退避与上限判断依据)。 final int attempt; /// 下次可重试时间(waitingNetwork/retryableFailed 的退避闹钟);null=无 /// 待重试。 final DateTime? nextRetryAt; /// 服务端上传会话 ID(initUpload 成功后回填,重试复用)。 final String? serverUploadId; /// 服务端预创建照片 ID(initUpload 成功后回填)。 final String? serverPhotoId; /// 最近一次失败原因(错误码文本,见 core/error_codes.dart;成功迁移时 /// 清除)。 final String? lastError; /// 源文件已清理时间(保留策略执行器写入;null=未清理)。实现增补字段, /// 见库级文档。 final DateTime? cleanedAt; /// 创建时间(入 preparing 时刻)。 final DateTime createdAt; /// 最近更新时间(每次状态迁移刷新;保留策略的年龄基准)。 final DateTime updatedAt; const UploadTask({ required this.id, required this.accountId, required this.albumId, this.categoryId, required this.clientTaskId, required this.sourceFilePath, required this.filename, required this.bytes, required this.contentType, required this.state, required this.attempt, this.nextRetryAt, this.serverUploadId, this.serverPhotoId, this.lastError, this.cleanedAt, required this.createdAt, required this.updatedAt, }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['account_id'] = Variable(accountId); map['album_id'] = Variable(albumId); if (!nullToAbsent || categoryId != null) { map['category_id'] = Variable(categoryId); } map['client_task_id'] = Variable(clientTaskId); map['source_file_path'] = Variable(sourceFilePath); map['filename'] = Variable(filename); map['bytes'] = Variable(bytes); map['content_type'] = Variable(contentType); { map['state'] = Variable( $UploadTasksTable.$converterstate.toSql(state), ); } map['attempt'] = Variable(attempt); if (!nullToAbsent || nextRetryAt != null) { map['next_retry_at'] = Variable(nextRetryAt); } if (!nullToAbsent || serverUploadId != null) { map['server_upload_id'] = Variable(serverUploadId); } if (!nullToAbsent || serverPhotoId != null) { map['server_photo_id'] = Variable(serverPhotoId); } if (!nullToAbsent || lastError != null) { map['last_error'] = Variable(lastError); } if (!nullToAbsent || cleanedAt != null) { map['cleaned_at'] = Variable(cleanedAt); } map['created_at'] = Variable(createdAt); map['updated_at'] = Variable(updatedAt); return map; } UploadTasksCompanion toCompanion(bool nullToAbsent) { return UploadTasksCompanion( id: Value(id), accountId: Value(accountId), albumId: Value(albumId), categoryId: categoryId == null && nullToAbsent ? const Value.absent() : Value(categoryId), clientTaskId: Value(clientTaskId), sourceFilePath: Value(sourceFilePath), filename: Value(filename), bytes: Value(bytes), contentType: Value(contentType), state: Value(state), attempt: Value(attempt), nextRetryAt: nextRetryAt == null && nullToAbsent ? const Value.absent() : Value(nextRetryAt), serverUploadId: serverUploadId == null && nullToAbsent ? const Value.absent() : Value(serverUploadId), serverPhotoId: serverPhotoId == null && nullToAbsent ? const Value.absent() : Value(serverPhotoId), lastError: lastError == null && nullToAbsent ? const Value.absent() : Value(lastError), cleanedAt: cleanedAt == null && nullToAbsent ? const Value.absent() : Value(cleanedAt), createdAt: Value(createdAt), updatedAt: Value(updatedAt), ); } factory UploadTask.fromJson( Map json, { ValueSerializer? serializer, }) { serializer ??= driftRuntimeOptions.defaultSerializer; return UploadTask( id: serializer.fromJson(json['id']), accountId: serializer.fromJson(json['accountId']), albumId: serializer.fromJson(json['albumId']), categoryId: serializer.fromJson(json['categoryId']), clientTaskId: serializer.fromJson(json['clientTaskId']), sourceFilePath: serializer.fromJson(json['sourceFilePath']), filename: serializer.fromJson(json['filename']), bytes: serializer.fromJson(json['bytes']), contentType: serializer.fromJson(json['contentType']), state: serializer.fromJson(json['state']), attempt: serializer.fromJson(json['attempt']), nextRetryAt: serializer.fromJson(json['nextRetryAt']), serverUploadId: serializer.fromJson(json['serverUploadId']), serverPhotoId: serializer.fromJson(json['serverPhotoId']), lastError: serializer.fromJson(json['lastError']), cleanedAt: serializer.fromJson(json['cleanedAt']), createdAt: serializer.fromJson(json['createdAt']), updatedAt: serializer.fromJson(json['updatedAt']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'accountId': serializer.toJson(accountId), 'albumId': serializer.toJson(albumId), 'categoryId': serializer.toJson(categoryId), 'clientTaskId': serializer.toJson(clientTaskId), 'sourceFilePath': serializer.toJson(sourceFilePath), 'filename': serializer.toJson(filename), 'bytes': serializer.toJson(bytes), 'contentType': serializer.toJson(contentType), 'state': serializer.toJson(state), 'attempt': serializer.toJson(attempt), 'nextRetryAt': serializer.toJson(nextRetryAt), 'serverUploadId': serializer.toJson(serverUploadId), 'serverPhotoId': serializer.toJson(serverPhotoId), 'lastError': serializer.toJson(lastError), 'cleanedAt': serializer.toJson(cleanedAt), 'createdAt': serializer.toJson(createdAt), 'updatedAt': serializer.toJson(updatedAt), }; } UploadTask copyWith({ String? id, String? accountId, String? albumId, Value categoryId = const Value.absent(), String? clientTaskId, String? sourceFilePath, String? filename, int? bytes, String? contentType, UploadTaskState? state, int? attempt, Value nextRetryAt = const Value.absent(), Value serverUploadId = const Value.absent(), Value serverPhotoId = const Value.absent(), Value lastError = const Value.absent(), Value cleanedAt = const Value.absent(), DateTime? createdAt, DateTime? updatedAt, }) => UploadTask( id: id ?? this.id, accountId: accountId ?? this.accountId, albumId: albumId ?? this.albumId, categoryId: categoryId.present ? categoryId.value : this.categoryId, clientTaskId: clientTaskId ?? this.clientTaskId, sourceFilePath: sourceFilePath ?? this.sourceFilePath, filename: filename ?? this.filename, bytes: bytes ?? this.bytes, contentType: contentType ?? this.contentType, state: state ?? this.state, attempt: attempt ?? this.attempt, nextRetryAt: nextRetryAt.present ? nextRetryAt.value : this.nextRetryAt, serverUploadId: serverUploadId.present ? serverUploadId.value : this.serverUploadId, serverPhotoId: serverPhotoId.present ? serverPhotoId.value : this.serverPhotoId, lastError: lastError.present ? lastError.value : this.lastError, cleanedAt: cleanedAt.present ? cleanedAt.value : this.cleanedAt, createdAt: createdAt ?? this.createdAt, updatedAt: updatedAt ?? this.updatedAt, ); UploadTask copyWithCompanion(UploadTasksCompanion data) { return UploadTask( id: data.id.present ? data.id.value : this.id, accountId: data.accountId.present ? data.accountId.value : this.accountId, albumId: data.albumId.present ? data.albumId.value : this.albumId, categoryId: data.categoryId.present ? data.categoryId.value : this.categoryId, clientTaskId: data.clientTaskId.present ? data.clientTaskId.value : this.clientTaskId, sourceFilePath: data.sourceFilePath.present ? data.sourceFilePath.value : this.sourceFilePath, filename: data.filename.present ? data.filename.value : this.filename, bytes: data.bytes.present ? data.bytes.value : this.bytes, contentType: data.contentType.present ? data.contentType.value : this.contentType, state: data.state.present ? data.state.value : this.state, attempt: data.attempt.present ? data.attempt.value : this.attempt, nextRetryAt: data.nextRetryAt.present ? data.nextRetryAt.value : this.nextRetryAt, serverUploadId: data.serverUploadId.present ? data.serverUploadId.value : this.serverUploadId, serverPhotoId: data.serverPhotoId.present ? data.serverPhotoId.value : this.serverPhotoId, lastError: data.lastError.present ? data.lastError.value : this.lastError, cleanedAt: data.cleanedAt.present ? data.cleanedAt.value : this.cleanedAt, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, ); } @override String toString() { return (StringBuffer('UploadTask(') ..write('id: $id, ') ..write('accountId: $accountId, ') ..write('albumId: $albumId, ') ..write('categoryId: $categoryId, ') ..write('clientTaskId: $clientTaskId, ') ..write('sourceFilePath: $sourceFilePath, ') ..write('filename: $filename, ') ..write('bytes: $bytes, ') ..write('contentType: $contentType, ') ..write('state: $state, ') ..write('attempt: $attempt, ') ..write('nextRetryAt: $nextRetryAt, ') ..write('serverUploadId: $serverUploadId, ') ..write('serverPhotoId: $serverPhotoId, ') ..write('lastError: $lastError, ') ..write('cleanedAt: $cleanedAt, ') ..write('createdAt: $createdAt, ') ..write('updatedAt: $updatedAt') ..write(')')) .toString(); } @override int get hashCode => Object.hash( id, accountId, albumId, categoryId, clientTaskId, sourceFilePath, filename, bytes, contentType, state, attempt, nextRetryAt, serverUploadId, serverPhotoId, lastError, cleanedAt, createdAt, updatedAt, ); @override bool operator ==(Object other) => identical(this, other) || (other is UploadTask && other.id == this.id && other.accountId == this.accountId && other.albumId == this.albumId && other.categoryId == this.categoryId && other.clientTaskId == this.clientTaskId && other.sourceFilePath == this.sourceFilePath && other.filename == this.filename && other.bytes == this.bytes && other.contentType == this.contentType && other.state == this.state && other.attempt == this.attempt && other.nextRetryAt == this.nextRetryAt && other.serverUploadId == this.serverUploadId && other.serverPhotoId == this.serverPhotoId && other.lastError == this.lastError && other.cleanedAt == this.cleanedAt && other.createdAt == this.createdAt && other.updatedAt == this.updatedAt); } class UploadTasksCompanion extends UpdateCompanion { final Value id; final Value accountId; final Value albumId; final Value categoryId; final Value clientTaskId; final Value sourceFilePath; final Value filename; final Value bytes; final Value contentType; final Value state; final Value attempt; final Value nextRetryAt; final Value serverUploadId; final Value serverPhotoId; final Value lastError; final Value cleanedAt; final Value createdAt; final Value updatedAt; final Value rowid; const UploadTasksCompanion({ this.id = const Value.absent(), this.accountId = const Value.absent(), this.albumId = const Value.absent(), this.categoryId = const Value.absent(), this.clientTaskId = const Value.absent(), this.sourceFilePath = const Value.absent(), this.filename = const Value.absent(), this.bytes = const Value.absent(), this.contentType = const Value.absent(), this.state = const Value.absent(), this.attempt = const Value.absent(), this.nextRetryAt = const Value.absent(), this.serverUploadId = const Value.absent(), this.serverPhotoId = const Value.absent(), this.lastError = const Value.absent(), this.cleanedAt = const Value.absent(), this.createdAt = const Value.absent(), this.updatedAt = const Value.absent(), this.rowid = const Value.absent(), }); UploadTasksCompanion.insert({ required String id, required String accountId, required String albumId, this.categoryId = const Value.absent(), required String clientTaskId, required String sourceFilePath, required String filename, required int bytes, required String contentType, required UploadTaskState state, this.attempt = const Value.absent(), this.nextRetryAt = const Value.absent(), this.serverUploadId = const Value.absent(), this.serverPhotoId = const Value.absent(), this.lastError = const Value.absent(), this.cleanedAt = const Value.absent(), required DateTime createdAt, required DateTime updatedAt, this.rowid = const Value.absent(), }) : id = Value(id), accountId = Value(accountId), albumId = Value(albumId), clientTaskId = Value(clientTaskId), sourceFilePath = Value(sourceFilePath), filename = Value(filename), bytes = Value(bytes), contentType = Value(contentType), state = Value(state), createdAt = Value(createdAt), updatedAt = Value(updatedAt); static Insertable custom({ Expression? id, Expression? accountId, Expression? albumId, Expression? categoryId, Expression? clientTaskId, Expression? sourceFilePath, Expression? filename, Expression? bytes, Expression? contentType, Expression? state, Expression? attempt, Expression? nextRetryAt, Expression? serverUploadId, Expression? serverPhotoId, Expression? lastError, Expression? cleanedAt, Expression? createdAt, Expression? updatedAt, Expression? rowid, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (accountId != null) 'account_id': accountId, if (albumId != null) 'album_id': albumId, if (categoryId != null) 'category_id': categoryId, if (clientTaskId != null) 'client_task_id': clientTaskId, if (sourceFilePath != null) 'source_file_path': sourceFilePath, if (filename != null) 'filename': filename, if (bytes != null) 'bytes': bytes, if (contentType != null) 'content_type': contentType, if (state != null) 'state': state, if (attempt != null) 'attempt': attempt, if (nextRetryAt != null) 'next_retry_at': nextRetryAt, if (serverUploadId != null) 'server_upload_id': serverUploadId, if (serverPhotoId != null) 'server_photo_id': serverPhotoId, if (lastError != null) 'last_error': lastError, if (cleanedAt != null) 'cleaned_at': cleanedAt, if (createdAt != null) 'created_at': createdAt, if (updatedAt != null) 'updated_at': updatedAt, if (rowid != null) 'rowid': rowid, }); } UploadTasksCompanion copyWith({ Value? id, Value? accountId, Value? albumId, Value? categoryId, Value? clientTaskId, Value? sourceFilePath, Value? filename, Value? bytes, Value? contentType, Value? state, Value? attempt, Value? nextRetryAt, Value? serverUploadId, Value? serverPhotoId, Value? lastError, Value? cleanedAt, Value? createdAt, Value? updatedAt, Value? rowid, }) { return UploadTasksCompanion( id: id ?? this.id, accountId: accountId ?? this.accountId, albumId: albumId ?? this.albumId, categoryId: categoryId ?? this.categoryId, clientTaskId: clientTaskId ?? this.clientTaskId, sourceFilePath: sourceFilePath ?? this.sourceFilePath, filename: filename ?? this.filename, bytes: bytes ?? this.bytes, contentType: contentType ?? this.contentType, state: state ?? this.state, attempt: attempt ?? this.attempt, nextRetryAt: nextRetryAt ?? this.nextRetryAt, serverUploadId: serverUploadId ?? this.serverUploadId, serverPhotoId: serverPhotoId ?? this.serverPhotoId, lastError: lastError ?? this.lastError, cleanedAt: cleanedAt ?? this.cleanedAt, createdAt: createdAt ?? this.createdAt, updatedAt: updatedAt ?? this.updatedAt, rowid: rowid ?? this.rowid, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (accountId.present) { map['account_id'] = Variable(accountId.value); } if (albumId.present) { map['album_id'] = Variable(albumId.value); } if (categoryId.present) { map['category_id'] = Variable(categoryId.value); } if (clientTaskId.present) { map['client_task_id'] = Variable(clientTaskId.value); } if (sourceFilePath.present) { map['source_file_path'] = Variable(sourceFilePath.value); } if (filename.present) { map['filename'] = Variable(filename.value); } if (bytes.present) { map['bytes'] = Variable(bytes.value); } if (contentType.present) { map['content_type'] = Variable(contentType.value); } if (state.present) { map['state'] = Variable( $UploadTasksTable.$converterstate.toSql(state.value), ); } if (attempt.present) { map['attempt'] = Variable(attempt.value); } if (nextRetryAt.present) { map['next_retry_at'] = Variable(nextRetryAt.value); } if (serverUploadId.present) { map['server_upload_id'] = Variable(serverUploadId.value); } if (serverPhotoId.present) { map['server_photo_id'] = Variable(serverPhotoId.value); } if (lastError.present) { map['last_error'] = Variable(lastError.value); } if (cleanedAt.present) { map['cleaned_at'] = Variable(cleanedAt.value); } if (createdAt.present) { map['created_at'] = Variable(createdAt.value); } if (updatedAt.present) { map['updated_at'] = Variable(updatedAt.value); } if (rowid.present) { map['rowid'] = Variable(rowid.value); } return map; } @override String toString() { return (StringBuffer('UploadTasksCompanion(') ..write('id: $id, ') ..write('accountId: $accountId, ') ..write('albumId: $albumId, ') ..write('categoryId: $categoryId, ') ..write('clientTaskId: $clientTaskId, ') ..write('sourceFilePath: $sourceFilePath, ') ..write('filename: $filename, ') ..write('bytes: $bytes, ') ..write('contentType: $contentType, ') ..write('state: $state, ') ..write('attempt: $attempt, ') ..write('nextRetryAt: $nextRetryAt, ') ..write('serverUploadId: $serverUploadId, ') ..write('serverPhotoId: $serverPhotoId, ') ..write('lastError: $lastError, ') ..write('cleanedAt: $cleanedAt, ') ..write('createdAt: $createdAt, ') ..write('updatedAt: $updatedAt, ') ..write('rowid: $rowid') ..write(')')) .toString(); } } abstract class _$UploadTaskDb extends GeneratedDatabase { _$UploadTaskDb(QueryExecutor e) : super(e); $UploadTaskDbManager get managers => $UploadTaskDbManager(this); late final $UploadTasksTable uploadTasks = $UploadTasksTable(this); late final Index uploadTasksAccountIdx = Index( 'upload_tasks_account_idx', 'CREATE INDEX upload_tasks_account_idx ON upload_tasks (account_id)', ); late final Index uploadTasksAccountStateIdx = Index( 'upload_tasks_account_state_idx', 'CREATE INDEX upload_tasks_account_state_idx ON upload_tasks (account_id, state)', ); late final Index uploadTasksAccountAlbumStateIdx = Index( 'upload_tasks_account_album_state_idx', 'CREATE INDEX upload_tasks_account_album_state_idx ON upload_tasks (account_id, album_id, state)', ); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ uploadTasks, uploadTasksAccountIdx, uploadTasksAccountStateIdx, uploadTasksAccountAlbumStateIdx, ]; @override DriftDatabaseOptions get options => const DriftDatabaseOptions(storeDateTimeAsText: true); } typedef $$UploadTasksTableCreateCompanionBuilder = UploadTasksCompanion Function({ required String id, required String accountId, required String albumId, Value categoryId, required String clientTaskId, required String sourceFilePath, required String filename, required int bytes, required String contentType, required UploadTaskState state, Value attempt, Value nextRetryAt, Value serverUploadId, Value serverPhotoId, Value lastError, Value cleanedAt, required DateTime createdAt, required DateTime updatedAt, Value rowid, }); typedef $$UploadTasksTableUpdateCompanionBuilder = UploadTasksCompanion Function({ Value id, Value accountId, Value albumId, Value categoryId, Value clientTaskId, Value sourceFilePath, Value filename, Value bytes, Value contentType, Value state, Value attempt, Value nextRetryAt, Value serverUploadId, Value serverPhotoId, Value lastError, Value cleanedAt, Value createdAt, Value updatedAt, Value rowid, }); class $$UploadTasksTableFilterComposer extends Composer<_$UploadTaskDb, $UploadTasksTable> { $$UploadTasksTableFilterComposer({ 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 accountId => $composableBuilder( column: $table.accountId, builder: (column) => ColumnFilters(column), ); ColumnFilters get albumId => $composableBuilder( column: $table.albumId, builder: (column) => ColumnFilters(column), ); ColumnFilters get categoryId => $composableBuilder( column: $table.categoryId, builder: (column) => ColumnFilters(column), ); ColumnFilters get clientTaskId => $composableBuilder( column: $table.clientTaskId, builder: (column) => ColumnFilters(column), ); ColumnFilters get sourceFilePath => $composableBuilder( column: $table.sourceFilePath, builder: (column) => ColumnFilters(column), ); ColumnFilters get filename => $composableBuilder( column: $table.filename, builder: (column) => ColumnFilters(column), ); ColumnFilters get bytes => $composableBuilder( column: $table.bytes, builder: (column) => ColumnFilters(column), ); ColumnFilters get contentType => $composableBuilder( column: $table.contentType, builder: (column) => ColumnFilters(column), ); ColumnWithTypeConverterFilters get state => $composableBuilder( column: $table.state, builder: (column) => ColumnWithTypeConverterFilters(column), ); ColumnFilters get attempt => $composableBuilder( column: $table.attempt, builder: (column) => ColumnFilters(column), ); ColumnFilters get nextRetryAt => $composableBuilder( column: $table.nextRetryAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get serverUploadId => $composableBuilder( column: $table.serverUploadId, builder: (column) => ColumnFilters(column), ); ColumnFilters get serverPhotoId => $composableBuilder( column: $table.serverPhotoId, builder: (column) => ColumnFilters(column), ); ColumnFilters get lastError => $composableBuilder( column: $table.lastError, builder: (column) => ColumnFilters(column), ); ColumnFilters get cleanedAt => $composableBuilder( column: $table.cleanedAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnFilters(column), ); ColumnFilters get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnFilters(column), ); } class $$UploadTasksTableOrderingComposer extends Composer<_$UploadTaskDb, $UploadTasksTable> { $$UploadTasksTableOrderingComposer({ 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 accountId => $composableBuilder( column: $table.accountId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get albumId => $composableBuilder( column: $table.albumId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get categoryId => $composableBuilder( column: $table.categoryId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get clientTaskId => $composableBuilder( column: $table.clientTaskId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get sourceFilePath => $composableBuilder( column: $table.sourceFilePath, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get filename => $composableBuilder( column: $table.filename, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get bytes => $composableBuilder( column: $table.bytes, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get contentType => $composableBuilder( column: $table.contentType, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get state => $composableBuilder( column: $table.state, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get attempt => $composableBuilder( column: $table.attempt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get nextRetryAt => $composableBuilder( column: $table.nextRetryAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get serverUploadId => $composableBuilder( column: $table.serverUploadId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get serverPhotoId => $composableBuilder( column: $table.serverPhotoId, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get lastError => $composableBuilder( column: $table.lastError, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get cleanedAt => $composableBuilder( column: $table.cleanedAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get createdAt => $composableBuilder( column: $table.createdAt, builder: (column) => ColumnOrderings(column), ); ColumnOrderings get updatedAt => $composableBuilder( column: $table.updatedAt, builder: (column) => ColumnOrderings(column), ); } class $$UploadTasksTableAnnotationComposer extends Composer<_$UploadTaskDb, $UploadTasksTable> { $$UploadTasksTableAnnotationComposer({ required super.$db, required super.$table, super.joinBuilder, super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get accountId => $composableBuilder(column: $table.accountId, builder: (column) => column); GeneratedColumn get albumId => $composableBuilder(column: $table.albumId, builder: (column) => column); GeneratedColumn get categoryId => $composableBuilder( column: $table.categoryId, builder: (column) => column, ); GeneratedColumn get clientTaskId => $composableBuilder( column: $table.clientTaskId, builder: (column) => column, ); GeneratedColumn get sourceFilePath => $composableBuilder( column: $table.sourceFilePath, builder: (column) => column, ); GeneratedColumn get filename => $composableBuilder(column: $table.filename, builder: (column) => column); GeneratedColumn get bytes => $composableBuilder(column: $table.bytes, builder: (column) => column); GeneratedColumn get contentType => $composableBuilder( column: $table.contentType, builder: (column) => column, ); GeneratedColumnWithTypeConverter get state => $composableBuilder(column: $table.state, builder: (column) => column); GeneratedColumn get attempt => $composableBuilder(column: $table.attempt, builder: (column) => column); GeneratedColumn get nextRetryAt => $composableBuilder( column: $table.nextRetryAt, builder: (column) => column, ); GeneratedColumn get serverUploadId => $composableBuilder( column: $table.serverUploadId, builder: (column) => column, ); GeneratedColumn get serverPhotoId => $composableBuilder( column: $table.serverPhotoId, builder: (column) => column, ); GeneratedColumn get lastError => $composableBuilder(column: $table.lastError, builder: (column) => column); GeneratedColumn get cleanedAt => $composableBuilder(column: $table.cleanedAt, builder: (column) => column); GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); GeneratedColumn get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); } class $$UploadTasksTableTableManager extends RootTableManager< _$UploadTaskDb, $UploadTasksTable, UploadTask, $$UploadTasksTableFilterComposer, $$UploadTasksTableOrderingComposer, $$UploadTasksTableAnnotationComposer, $$UploadTasksTableCreateCompanionBuilder, $$UploadTasksTableUpdateCompanionBuilder, ( UploadTask, BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>, ), UploadTask, PrefetchHooks Function() > { $$UploadTasksTableTableManager(_$UploadTaskDb db, $UploadTasksTable table) : super( TableManagerState( db: db, table: table, createFilteringComposer: () => $$UploadTasksTableFilterComposer($db: db, $table: table), createOrderingComposer: () => $$UploadTasksTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$UploadTasksTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), Value accountId = const Value.absent(), Value albumId = const Value.absent(), Value categoryId = const Value.absent(), Value clientTaskId = const Value.absent(), Value sourceFilePath = const Value.absent(), Value filename = const Value.absent(), Value bytes = const Value.absent(), Value contentType = const Value.absent(), Value state = const Value.absent(), Value attempt = const Value.absent(), Value nextRetryAt = const Value.absent(), Value serverUploadId = const Value.absent(), Value serverPhotoId = const Value.absent(), Value lastError = const Value.absent(), Value cleanedAt = const Value.absent(), Value createdAt = const Value.absent(), Value updatedAt = const Value.absent(), Value rowid = const Value.absent(), }) => UploadTasksCompanion( id: id, accountId: accountId, albumId: albumId, categoryId: categoryId, clientTaskId: clientTaskId, sourceFilePath: sourceFilePath, filename: filename, bytes: bytes, contentType: contentType, state: state, attempt: attempt, nextRetryAt: nextRetryAt, serverUploadId: serverUploadId, serverPhotoId: serverPhotoId, lastError: lastError, cleanedAt: cleanedAt, createdAt: createdAt, updatedAt: updatedAt, rowid: rowid, ), createCompanionCallback: ({ required String id, required String accountId, required String albumId, Value categoryId = const Value.absent(), required String clientTaskId, required String sourceFilePath, required String filename, required int bytes, required String contentType, required UploadTaskState state, Value attempt = const Value.absent(), Value nextRetryAt = const Value.absent(), Value serverUploadId = const Value.absent(), Value serverPhotoId = const Value.absent(), Value lastError = const Value.absent(), Value cleanedAt = const Value.absent(), required DateTime createdAt, required DateTime updatedAt, Value rowid = const Value.absent(), }) => UploadTasksCompanion.insert( id: id, accountId: accountId, albumId: albumId, categoryId: categoryId, clientTaskId: clientTaskId, sourceFilePath: sourceFilePath, filename: filename, bytes: bytes, contentType: contentType, state: state, attempt: attempt, nextRetryAt: nextRetryAt, serverUploadId: serverUploadId, serverPhotoId: serverPhotoId, lastError: lastError, cleanedAt: cleanedAt, createdAt: createdAt, updatedAt: updatedAt, rowid: rowid, ), withReferenceMapper: (p0) => p0 .map( (e) => ( e.readTable<$UploadTasksTable, UploadTask>(table), BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>( db, table, e, ), ), ) .toList(), prefetchHooksCallback: null, ), ); } typedef $$UploadTasksTableProcessedTableManager = ProcessedTableManager< _$UploadTaskDb, $UploadTasksTable, UploadTask, $$UploadTasksTableFilterComposer, $$UploadTasksTableOrderingComposer, $$UploadTasksTableAnnotationComposer, $$UploadTasksTableCreateCompanionBuilder, $$UploadTasksTableUpdateCompanionBuilder, ( UploadTask, BaseReferences<_$UploadTaskDb, $UploadTasksTable, UploadTask>, ), UploadTask, PrefetchHooks Function() >; class $UploadTaskDbManager { final _$UploadTaskDb _db; $UploadTaskDbManager(this._db); $$UploadTasksTableTableManager get uploadTasks => $$UploadTasksTableTableManager(_db, _db.uploadTasks); }